WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. proden22
    Member
    Posted 1 year 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?

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic