How to hide the credit card charging amount after choosing COD in onePage checkout
-
08-10-2020 - |
Question
I've enabled the COD options in a magento ce 1.9.2.4 store. In the onePage checkout if the user choose the COD option it's still visible in the Order Review
a table row telling Your credit card will be charged for
and giving the final value in the base currency. For me I want to hide this row ONLY if the user chosen the COD.
is there's a direct option for that? code hints? and to tell I've thought about a simple jquery solution but IDK is it okay to do so or there's a magento recommended solution? This image taken from fresh installation:
Solution
You can rewrite Mage_Checkout_Block_Cart_Totals::needDisplayBaseGrandtotal() function to achieve this with below code.
public function needDisplayBaseGrandtotal()
{
$quote = $this->getQuote();
$hideForPayment = 'cashondelivery'; // Your Payment method code for which you want to hide message
if ($quote->getBaseCurrencyCode() != $quote->getQuoteCurrencyCode() && $quote->getPayment()->getMethod() != $hideForPayment) {
return true;
}
return false;
}
OTHER TIPS
Did your order review reload after you change the payment method ?
Or you can check if there is JavaScript conflict/error from your browser
Updated :
Check this file, if you want to hide the code is up to you.
app\design\frontend\base\default\template\checkout\onepage\review\totals.phtml
or you can try this one :