0

I am creating a custom checkout step in Magento to allow customers to pick a delivery date based on their postcode,

I have already created the extra step, but I want to be able to pass the postcode that the customer enters from step 1 to step 2 so I can then give a shipping date option based on the customer's postcode,

just wondered what's the best way to pass the data from step 1 to step 2 $_post $_session? cookie?

0

It should already be saved in the data since postcode is a standard M2 field.

You should be able to access it in php by:

 public function __construct(
    \Magento\Checkout\Api\Data\ShippingInformationInterface $addressInformation
) {
    $this->addressInformation = $addressInformation;
}

$addressInformation->getShippingAddress()->getPostcode();
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.