I created a custom step checkout after payment step.
This new step calls "Resume Order".
In that step, I need to show the selected shipping address, selected payment method.
I know that checkout is built with js, so how can I get all the previous selected items from shipping, payment and cart?
The step is already created like magento documentation
So, how to bring previous selected data from previous checkout steps?
Best Answer
See the sidebar code. It's a good example.
vendor/magento/module-checkout/view/frontend/layout/checkout_index_index.xml
vendor/magento/module-checkout/view/frontend/web/js/view/summary
Example:
1) Get Payment from quote
Magento_Checkout/js/model/quote
:quote.paymentMethod()
. See here: vendor/magento/module-checkout/view/frontend/web/js/action/select-payment-method.js2) Shipping Address and Billing Address:
quote.billingAddress()
andquote.shippingAddress()
.3) Quote items data:
quote.totals().items
Can read more here: https://magento.stackexchange.com/a/133732/33057