Disable cashback reward program programmatically
-
Hi
I want to disable cashback reward program programmatically for wholesalers. The following code does not work
<?php class YWP_Tera_Wallet { public function __construct() { add_filter( 'woo_wallet_form_cart_cashback_amount', array( $this, 'desactivate_plugin_wallet' ), 10 ); add_filter( 'woo_wallet_form_order_cashback_amount', array( $this, 'desactivate_plugin_wallet1' ), 10, 2 ); } /** * Tera Wallet For wholsale */ function desactivate_plugin_wallet( $amount ) { if ( current_user_can( 'wholsale' ) ) { return 0; } else { return $amount; } } /** * Tera Wallet For wh */ function desactivate_plugin_wallet1( $amount, $order_id ) { if ( current_user_can( 'wholsale' ) ) { return 0; } else { return $amount; } } } new YWP_Tera_Wallet();
Thanks
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Disable cashback reward program programmatically’ is closed to new replies.