简体   繁体   中英

How to access Liquid variables outside of Shopify

We are having two instances of the website right now. One is the old one containing the cart and a WP instance for pages, posts and gallery functionality. Now, to cut down on development time, we have decided to seamlessly integrate the look & feel of the old website to the new one. And with that, we need to have the following links working from the new website(wordpress side)

  1. The login/logout link. If customer is logged in and would visit one of the WP pages, the section for the My account should reflect the logged in customer's details.
  2. View Cart/ Cart details. The number of checked out items and cost should reflect in the wp website for purchases done within the Shopify domain.
  3. Checkout - same as #2.

For a clearer picture(I hope), the header area looked like this - both in Shopify and our WP theme (can't post images yet):

Home | About | Shop | Gallery

My Account | Logout
View Cart(0 items/$0.0) | Checkout

Any suggestions/inputs to make the bold items working even when in wordpress is greatly appreciated.

Thank you.

Unfortunately, this is going to be really tricky, because for security reasons, your browser can't read the cookies where Shopify stores a reference to the cart on a domain that's not your shop.

What you could however do to sidestep this issue is:

  • Create a page in your Shopify store that displays the header and style it to look the same as what you have in WP
  • Put an iframe in your WP site with that Shopify page as its source

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM