Hi @omarcp
The plugin allow to avoid to earn points if the customer use a coupon.
Thread Starter
omarcp
(@omarcp)
Can you tell me where is that option?
Hi @omarcp
You can find this option in YITH->Points And Rewards->Point Settings
Thread Starter
omarcp
(@omarcp)
there is not such option there, it is supposed to be the one that says “on sale”?
It is not possible remove the option to earn point if a coupon is applied.
But inside YITH->Points And Rewards->Point Settings you can find the option
“Remove points when coupons are used”
If it is “ON” it possible remove the amount of the discount from the total of points gained.
Thread Starter
omarcp
(@omarcp)
Is there a code snippet to make yith points do not earn point if any coupon is used?
Thread Starter
omarcp
(@omarcp)
We need to find a way to stop earning points when a coupon is being used.
It looks like the plugin don’t allow to avoid to earn points if the customer use a coupon as Salvatore Strano (@salvostrano) said.
Hello,
you can use this snippet that you can add inside the file functions.php of your theme:
add_filter('ywpar_calculate_points_on_cart', 'ywpar_check_coupons');
function ywpar_check_coupons( $points ){
if( ! WC()->cart ){
return $$points;
}
$coupon_applied = WC()->cart->get_applied_coupons();
return count( $coupon_applied) > 0 ? 0 : $points;
}