• Resolved

    (@educationguideonline)


    Hi, I want to show an error message for the partial payment gateway. Now I tried these lines of code. But it is not working! (already disabled COD for partial payment). Please tell me the exact function by which my code will work……

    ////////////////////////////////////////////////////////
    add_action( ‘woocommerce_review_order_before_payment’, ‘purnendu_cod_message_on_checkout’);
    function purnendu_cod_message_on_checkout() {
    $cartvalue = WC()->cart->total;
    if ($cartvalue>=600)
    {
    if (is_enable_wallet_partial_payment())
    {
    echo “Sorry COD is not available for Wallet Payment”;
    }
    else {
    echo “Hurray! Your order is COD Eligible”;
    }
    }
    else {
    echo “COD IS NOT AVAILABLE”;
    }
    }

    The page I need help with: [log in to see the link]

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

    (@subratamal)

    Hi @educationguideonline

    I have modified your code. But this will not work until you override woocommerce/checkout/payment.php template to the themes folder and define a custom hook there.

    add_action('woocommerce_review_order_before_payment', 'purnendu_cod_message_on_checkout');
    
    function purnendu_cod_message_on_checkout() {
        $cartvalue = WC()->cart->get_total('edit');
        if ($cartvalue >= 600) {
            if (is_enable_wallet_partial_payment()) {
                echo 'Sorry COD is not available for Wallet Payment';
            } else {
                echo 'Hurray! Your order is COD Eligible';
            }
        } else {
            echo 'COD IS NOT AVAILABLE';
        }
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Help for Coding issue’ is closed to new replies.