I'm customizing a magento store and I have the following problem.
Imagine that a customer of the store has 4 different delivery addresses, addresses already registered in the system.
Due to the customization I am making, I offer the customer who is buying in the store the option to choose which address he wants to deliver through a
<select>, on a page outside the magento.
I have the deed code in the database, that is, the
entity_id number for the address I want to change in the request that is in progress, according to the client's selection.
And that's exactly where my problem lies:
I need to tell the magento the address code I want to use at the checkout to finalize the order.
Magento by default, throws the client's default address in the ShippingAddress
Example of what I need:
$checkout->setShippingAddress(entity_id), however, I can not make it work.
using the command below, I can get all the data from the checkout open:
I need to change the delivery address to a new address, which is already registered in the system.
Can someone help me?
I do not know what to do anymore.
Thanks in advance for your help.