Created
December 2, 2020 07:50
-
-
Save kreamweb/b47645c7dadcf9ed293bdc28f1666a4e to your computer and use it in GitHub Desktop.
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 | |
if( class_exists('YITH_WC_Points_Rewards_Frontend')){ | |
add_filter('ywpar_get_product_point_earned', 'ywpar_get_product_point_earned_gift_card', 10, 2 ); | |
function ywpar_get_product_point_earned_gift_card( $points, $product ){ | |
if( $product->is_type('gift-card')){ | |
$points = 0; | |
} | |
return $points; | |
} | |
add_filter('ywpar_calculate_rewards_discount_item_price', 'ywpar_calculate_rewards_discount_item_price', 10, 3); | |
function ywpar_calculate_rewards_discount_item_price( $price, $value, $product_id){ | |
$product = wc_get_product( $product_id ); | |
if( $product->is_type('gift-card')){ | |
$price = 0; | |
} | |
return $price; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment