Sidecart on non-WooCommerce page
-
Hi, I want the sidecart to open after adding to cart on this non-woocommerce page, but I can’t get it to work. Is there any script/change we can make so it will work?
It is a variable product and this is what the ajax call processes
$product_id = $_POST['product_id']; $variation_id = $_POST['variation_id']; $maat = $_POST['maat']; $aantal = $_POST['aantal']; global $woocommerce; $varr['attribute_pa_maat'] = $maat; $woocommerce->cart->add_to_cart($product_id,$aantal,$variation_id,$varr,null);
And the ajax call
$.ajax({ type: "POST", url: themedir+"/add_to_cart.php", data: { product_id : product_id, variation_id : variation_id, aantal : aantal, maat : maat, nonce : nonce }, cache: false, success: function(rets){ window.location.href = site_url+"/?atc=1"; }, });
Thanks!
The page I need help with: [log in to see the link]
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Sidecart on non-WooCommerce page’ is closed to new replies.