Created
April 3, 2024 10:30
-
-
Save webtoffee-git/45afdf5d34afa1cb31d38816bfbc1c62 to your computer and use it in GitHub Desktop.
To ensure compatibility with Points and Rewards for WooCommerce plugin by WP Swings (Smart Coupons For WooCommerce by WebToffee)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php //Do not copy this line of code | |
add_filter( 'wt_sc_alter_giveaway_cart_item_data_before_add_to_cart', function( $cart_item_data, $product_id, $variation_id, $quantity ){ | |
if( isset( $cart_item_data['free_product'] ) && 'wt_give_away_product' === $cart_item_data['free_product'] ){ | |
$_POST['wps_wpr_verify_cart_nonce'] = wp_create_nonce( 'wps-cart-nonce' ); | |
} | |
return $cart_item_data; | |
}, 10, 4 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment