Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ////checkbox ellenorzes
- add_filter( 'woocommerce_add_cart_item_data', 'bbloomer_store_gift', 10, 2 );
- function bbloomer_store_gift( $cart_item, $product_id ) {
- $free_product_id = 8692;
- $quantity = 1;
- if( isset( $_POST['is-gift'] ) && $_POST['is-gift'] == "igen" && $product_id != $free_product_id ) {
- WC()->cart->add_to_cart( $free_product_id, $quantity );
- }
- return $cart_item;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement