Quantcast
Channel: WordPress.org Forums » [WooCommerce] Support
Viewing all articles
Browse latest Browse all 104029

proden22 on "$woocommerce->cart->add_to_cart"

$
0
0

When I program:

$woocommerce->cart->add_to_cart( $group_product_id, 1);
with $group_product_id being the product post ID (e.g. 300), the shopping cart shows a quantity of 2 not 1.

When I directly enter the URL (e.g.http://www.mystore.com/shop/stuff?add_to_cart=300), the shopping cart shows a quantity of 1 (the correct expected behavior).

Any suggestions would be really helpful.

Thank you.

P.S. Bonus question: is there any way to program adding multiple items to the cart (not grouped or variations) before taking the user to the cart page?

http://wordpress.org/extend/plugins/woocommerce/


Viewing all articles
Browse latest Browse all 104029

Trending Articles