Repository › Forums › Support › WooCommerce Extended Coupon Features PRO › how to select 2 free products on products with 2 quantity › Reply To: how to select 2 free products on products with 2 quantity
December 7, 2018 at 12:56 pm
#4391
numep
Participant
Ok think I found the solution for this:
// Add free products or adjust the quantity
$cart_item_key = $this->set_free_product_amount_in_cart( 854, 1 );
foreach ( $free_product_ids as $product_id => $qty ) {
$cart_item_key = $this->set_free_product_amount_in_cart( $product_id, $qty );
}
}
UPDATE: Only problem it wont remove when coupon is not valid 🙁