简体   繁体   中英

How we can send woocommerce cart details from one website to another when user navigates from site A to site B

If a buyer navigates from Site A to Site B, any products in the cart on Site A will be added to the cart on Site B.

We need to prevent this from occurring repeatedly - if they move between sites 5 times, we do not want to end up with quantity 5 of an item in the cart on Site B if it is only quantity 1 in the cart on Site A

Put the cart contents into a cookie on form submit during a button event.
When navigating to another page (on the same domain), then the cookie contents can be read. nothing needs to be written when loading another page.
This also has the advantage that when the user leaves and comes back later, his cart will still hold his items.

Another option is to hold the cart contents in a database.

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