Skip to content

Instantly share code, notes, and snippets.

@kreamweb
Created December 2, 2020 07:50
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 kreamweb/b47645c7dadcf9ed293bdc28f1666a4e to your computer and use it in GitHub Desktop.
Save kreamweb/b47645c7dadcf9ed293bdc28f1666a4e to your computer and use it in GitHub Desktop.
<?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