Wp-graphql-woocommerce: Ajax call /?wc-ajax=get_refreshed_fragments clears cart when plugin installed

Created on 25 Sep 2019  路  2Comments  路  Source: wp-graphql/wp-graphql-woocommerce

Steps to reproduce the behavior:
I have installed vanilla Woocommerce with Storefront theme and this plugin with wp-graphql.

When I click add to cart the product is added to the cart and page refreshed with correct items in cart. However on page load there is an ajax call /?wc-ajax=get_refreshed_fragments. Response from that cart clears cart_hash cookie and returns 0 products in cart.

This does not happen when plugin is deactivated.

Screenshots
Screenshot 2019-09-25 at 08 12 35

bug failing utility

Most helpful comment

The is most likely due to the QL_Session_Handler. Sounds like it's preventing the woocommerce session cookie from being updated property. This is definitely a bug, since the QL_Session_Handler shouldn't be used on non-GraphQL request. I'm not too familiar with the wc-ajax action, I'll have to look into it. :thinking:

All 2 comments

The is most likely due to the QL_Session_Handler. Sounds like it's preventing the woocommerce session cookie from being updated property. This is definitely a bug, since the QL_Session_Handler shouldn't be used on non-GraphQL request. I'm not too familiar with the wc-ajax action, I'll have to look into it. :thinking:

Fixed in #146. @pristas-peter thanks for catching this one. It would have been a pain down the line.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

huniqcast picture huniqcast  路  4Comments

kenchoong picture kenchoong  路  5Comments

dpacmittal picture dpacmittal  路  5Comments

aresrioja10 picture aresrioja10  路  6Comments

zamson picture zamson  路  4Comments