I currently have a Wordpress Multisite set up with WooCommerce. My goal is to have a shared shopping cart in a GUEST session for a subbblog mapped domain, and full domain itself.
ie the shopping cart would be the same for:
While I can get the carts working independently, they will have their own cookies on each respective domain.
3 cookies manage the shopping cart experience:
- woocommerce_items_in_cart
- woocommerce_cart_hash
- wp_woocommerce_session_
(Where wp_woocommerce_session_ will be something like this in practice:)
- wp_woocommerce_session_e235b4c0280f7763c7ffd1dd8492f8a2
(ref: https://docs.woothemes.com/document/woocommerce-cookies/)
I modified the function wc_setcookie in the file: includes/wc-core-functions.php to set the cookies for both domains|paths with the following:
A normal cookie is set in this function via:
- setcookie( $name, $value, $expire, COOKIEPATH, COOKIE_DOMAIN, $secure );
I will add an additional cookie (for each cookie set with:
- $temp1 = get_blog_details();
- setcookie( $name, $value, $expire, $temp1->path, $temp1->domain, $secure );
However these secondary cookies are not seen when going to the other domain path.
So the question is how can I accomplish execute this via extra coding or server modifications in NGINX or with both.
Thank you for your time