Skip to content

Instantly share code, notes, and snippets.

@webtoffee-git
Created April 3, 2024 10:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webtoffee-git/45afdf5d34afa1cb31d38816bfbc1c62 to your computer and use it in GitHub Desktop.
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)
<?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