如何解决如何设置代码片段以在使用 paypal 时禁用 yith 积分奖励
我正在寻找一种在使用 paypal 作为付款方式时禁用 yith 积分奖励的方法。
我有此代码可以禁用特定产品的 yith 积分奖励,但找不到禁用付款方式的方法
其他代码是 yith 用于排除特价商品并在兑换时禁用赚取积分的默认代码。
我认为在使用 paypal 时混合使用这些可能会禁用赚取积分。
我真的很想得到一些帮助!
'exclude_product_on_sale' => array(
'name' => esc_html__( 'Exclude on sale products','yith-woocommerce-points-and-rewards' ),'desc' => esc_html__( 'If enabled,sale products will not assign points to your users','yith-type' => 'onoff','type' => 'yith-field','id' => 'ywpar_exclude_product_on_sale','default' => 'no',),
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',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;
}
}
'disable_point_earning_while_reedeming' => array(
'name' => esc_html__( 'Do not assign points to orders in which the user is redeeming points','desc' => esc_html__( 'Enable to not assign points to orders in which the user redeems points','id' => 'ywpar_disable_earning_while_reedeming','deps' => array(
'id' => 'ywpar_enable_points_upon_sales','value' => 'yes','type' => 'hide',
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。