i am creating a custom button to add products to cart using add_to_cart($product_id, $quantity) function. It's working well for the single property but when I change product_id with another product id then it shows error.
$cart = $woocommerce->cart->add_to_cart($product_id, $quantity);
when I try same with different product_ids it stops working. any solution?