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