• anede

    (@labetenoirre)


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

    I need an option to disable one of them when customer is checking out.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Subrata Mal

    (@subratamal)

    @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;
    }
    }
    Thread Starter anede

    (@labetenoirre)

    Hello, it’s not working. I tested it and I can still apply a coupon and use my wallet cashback at the same time.

    Is there a specific part of the functions.php file where I should paste this code?

    Plugin Author Subrata Mal

    (@subratamal)

    @labetenoirre Did you check it by placing an order?

    Thread Starter anede

    (@labetenoirre)

    Yes I did, they’re both being used.

Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.