I want to allow adding items to the cart even when a user is not logged-in. This works on a local version on a localhost, but in a remote server version, it doesn't work, and I'm not sure why, and couldn't see any immediate differences.
One difference I can see is in the paths where the versions are installed, affecting the path of the cookie, in the local version it's /pathname/
and in the remote it's simply the root path (/
). After adding in the local version I can see cookies saved:
woocommerce_cart_hash
and woocommerce_items_in_cart
,
they are not saved when adding items in the remote version.
The add is made with a request to ?add-to-cart
endpoint.
Any directions or leads as to how to resolve this will be appreciated.