WooCommerce - excelling eCommerce
$woocommerce->cart->add_to_cart (1 post)

  1. proden22
    Posted 2 years ago #

    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?


Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic