How to disable cashback to be used with coupon at the same time?

[ad_1]

@labetenoirre Please use the attached code in theme functions.php file to disable cashback if coupon applied in an order.

add_filter( 'process_woo_wallet_general_cashback', 'process_woo_wallet_general_cashback_callback', 10, 2 );
if ( ! function_exists( 'process_woo_wallet_general_cashback_callback' ) ) {
/**
* Disable cashback if coupon applied.
*
* @param bool $process
* @param WC_Order $order
* @return bool
*/
function process_woo_wallet_general_cashback_callback( $process, $order ) {
if ( count( $order->get_coupon_codes() ) > 0 ) {
$process = false;
}
return $process;
}
}

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer