• I want to add multiple product variations to my cart via ajax at once. I call this function via ajax for each product variation:

    WC()->cart->add_to_cart( $product_id, $quantity, $variation_id, $variation, null )

    After the loop has finished, only one products is added to the cart.
    I think the problem is related to the last variable, I am passing.

    $cart_item_data

    What is wrong there, or what do I have to pass there, tha I cann ad multiple variations at one?

    https://wordpress.org/plugins/woocommerce/

The topic ‘Adding multiple Products to cart via php’ is closed to new replies.