Basic understanding: add item to cart and customers
-
Hey there,
so I am authenticating the woo commerce standard REST Api way:
Basic auth with customer key and secret.I’d like to add an item to the cart now using the documented endpoint:
https://docs.cocart.xyz/#add-item-to-cartThis works fine, I can add any item I want.
But now I have a basic understanding question:
What if I want ANY customer or ANY not logged in user to add an item to a cart?
How would I need to authenticate with the API in this case?My first intuition was that I need to pass the
woocommerce_cart_hash
as an argument (I can see this hash is available via cookies in the Storefront) which would identify the cart of the user but that seems not to be supported.Here is my usecase:
I have build a product-configurator which lets you puzzle together 4 different products from a list of products.
Via click on “Add to cart” I want the 4 items to be added to the CURRENT cart of the given user OR also to a user that might not be logged in (login is not required to use the configurator).
I though CoCart would be THE solution for my problem but it seems not so intuitive now. Or am I missing something essential here?Thanks for your support and keep on the good work.
- The topic ‘Basic understanding: add item to cart and customers’ is closed to new replies.