WooCommerce Cart unable to delete items
-
Hi,
Good work on the plugin π
I currently have the following plugins installed:
WPML Multilingual CMS by OnTheGoSystems version 3.1.8.4,
WooCommerce Multilingual by OnTheGoSystems version 3.4.4-beta1,
WooCommerce by WooThemes version 2.2.8,
WordPress Importer by wordpressdotorg version 0.6.1,
WPML Media by OnTheGoSystems version 2.1.8,
WPML String Translation by OnTheGoSystems version 2.0.14,
WPML Translation Management by OnTheGoSystems version 1.9.9and i am running the base twenty twelve theme.
lets say i add two items to my basket, and i output the contents of my WC cart:
array (size=2) '02522a2b2726fb0a03bb19f2d8d9524d' => array (size=5) 'product_id' => int 134 'variation_id' => string '' (length=0) 'variation' => string '' (length=0) 'quantity' => int 1 'data' => object(WC_Product_Simple)[2330] public 'id' => int 134 public 'post' => object(WP_Post)[4042] ... public 'product_type' => string 'simple' (length=6) '9fc3d7152ba9336a670e36d0ed79bc43' => array (size=5) 'product_id' => int 133 'variation_id' => string '' (length=0) 'variation' => string '' (length=0) 'quantity' => int 1 'data' => object(WC_Product_Simple)[2355] public 'id' => int 133 public 'post' => object(WP_Post)[2318] ... public 'product_type' => string 'simple' (length=6)
and i click on the remove button link :
the has passed to this link at the moment matches correctly with the item i am trying to delete, but when the cart reloads after deletion the product is still there.
After further inspection by outputting the cart from within the /woocommerce/includes/class-wc-form-handler.php in the update_cart_action method the cart hashes change:
string '02522a2b2726fb0a03bb19f2d8d9524d' (length=32) // hash of $_GET variable passed array (size=2) 'b0575d6f6d2889a01b86578e1598c59d' => array (size=5) 'product_id' => int 134 'variation_id' => string '' (length=0) 'variation' => string '' (length=0) 'quantity' => int 1 'data' => object(WC_Product_Simple)[2330] public 'id' => int 134 public 'post' => object(WP_Post)[2328] ... public 'product_type' => string 'simple' (length=6) 'bbd6d2efdf3c54ec3fa28f7efb851190' => array (size=5) 'product_id' => int 133 'variation_id' => string '' (length=0) 'variation' => string '' (length=0) 'quantity' => int 1 'data' => object(WC_Product_Simple)[2361] public 'id' => int 133 public 'post' => object(WP_Post)[2360] ... public 'product_type' => string 'simple' (length=6) array (size=2) 'b0575d6f6d2889a01b86578e1598c59d' => array (size=5) 'product_id' => int 134 'variation_id' => string '' (length=0) 'variation' => string '' (length=0) 'quantity' => int 1 'data' => object(WC_Product_Simple)[2330] public 'id' => int 134 public 'post' => object(WP_Post)[2328] ... public 'product_type' => string 'simple' (length=6) 'bbd6d2efdf3c54ec3fa28f7efb851190' => array (size=5) 'product_id' => int 133 'variation_id' => string '' (length=0) 'variation' => string '' (length=0) 'quantity' => int 1 'data' => object(WC_Product_Simple)[2361] public 'id' => int 133 public 'post' => object(WP_Post)[2360] ... public 'product_type' => string 'simple' (length=6)
so it looks like when a cart item is deleted it is using the wrong has, but when the cart loads again it is using the old cart hashes.
Any ideas?
also no matter what language i try and remove an item from the cart no hashes match.
Thanks
James
- The topic ‘WooCommerce Cart unable to delete items’ is closed to new replies.