2

How can I get store information in KnockOut?

For example: When a customer selects "Pickup @ Store" as shipping method, I need to update the shipping address to the address of the store.

The customer has the option to not ship to his home address but pick the package up up at a physical shop location. In that case the shipping information should show the shop location address and not the customer address. So i need the shop location address configured in the backend of Magento. How can i pass that information (configuration settings) to Knockout?

  • What is the Pickup @ Store" as shipping method? Can you explain more details? – Khoa TruongDinh Feb 28 '17 at 14:24
  • @KhoaTruongDinh: i added some extra information, "Pickup @ Store" is to not ship the package but get it at a physical store – Stijn Duynslaeger - Echron Feb 28 '17 at 14:44
  • 1
    You can store the shop shipping details in window.checkoutData element, and you can use it from knockout js – seeni Feb 28 '17 at 15:22
1

Correct answer is in the comments above

You can store the shop shipping details in window.checkoutData element, and you can use it from knockout js – seeni

Useful link to add variable to window.checkoutConfig: http://www.magestore.com/magento-2-tutorial/how-to-add-more-variable-to-window-checkoutconfig/

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.