We are working on a project for a shipping carrier which works with a network of pickup points. The customer selects a pickup point (closest to their address) in the checkout, and picks it up there when their order has arrived.
The problem we are facing is that when a customer chooses to go through the checkout and immediately register, the customer shipping address that is being saved is the one from the pickup point. The real problem here is that we need the pickup point address on the order to be able to print the labels etc..., but need to prevent Magento from saving said address on to the customer so that they are not able to select it as a possible shipping address in their following checkout.
Ideas tried so far:
- Observer on "customer_address_save_before". It seems to let me prevent the saving of the address, but I can't detect whether it was called in the checkout process or not.
- Using the override where the pickup point address is saved. Setting the "save_in_address_book" to false has no effect (probably because we're registering).
Last idea I have is to simulate a guest checkout, but I have no idea how to do that.
Could anyone point me in the right direction?