我想跳过
payment method
当
Grandtotal
是零
任何帮助将不胜感激。
谢谢!!
最新回答
- 2019-12-51 #
- 2019-12-52 #
上述问题的受影响文件是
{Magento-Root-Folder}/app/design/frontend/{YourTheme}/default/template/checkout/onepage/payment/methods.phtml
请注意,如果模板文件夹中没有"checkout"文件夹,请务必从
{Magento-Root-Folder}/app/design/frontend/base/default/template/checkout
复制它 到您的模板文件夹; 确保你保持结构相同在这个文件(methods.phtml)中我们实际查看了可用的付款(第45行),这是我们需要调整一点的地方。
1)将此行放在文件顶部的任意位置以获取当前报价数据(我们将在步骤2中使用它)
$quote_data = Mage::helper('checkout')->getQuote()->getData();
它将包含 $quote_data[grand_total]
2)搜索围绕第45行迭代的付款方式
foreach ($methods as $_method): $_code = $_method->getCode();
我们需要检查$ _code('free'表示zero Subtotal Checkout)并在同一个foreach中添加一个简单的if子句:
if ($_code == "free" && $quote_data[grand_total] < 1) { // if payment method is free and grand total '0' // this is where your action should happen $class_show_pm = ""; // will be used to show/hide 'dt' tag $radio_checked = "checked"; // will be used to enable/disable radio button $radio_onclick = "payment.switchMethod(" .$_code .")"; // will be used to load js code } else { $class_show_pm = "none"; $radio_checked = ""; $radio_onclick = ""; }
如果总计0太
,您可以查看此跳过付款步骤我希望这会有所帮助
相关问题
- 将QTy + Location添加到订单视图页面,Demac Magento-Multi-Location-Inventory Extensionmagento1.9magentoordersmagentomultistoremagentocolumnmagentolocations2019-12-05 21:42
- checkout:以magento编程方式创建订单magento1.9magentocheckoutmagentoshippingmethodsmagentopaymentmethodsmagentoquote2019-12-05 21:40
- magento 1.9:无法结帐错误在下订单之前,请同意所有条款和条件magento1.9magentocheckoutmagentotemplatemagentoprogrammingmagentotermsandconditions2019-12-05 21:42
- magento 1.9:如何用"不需要"更改邮政编码所需的字段?magento1.9magentocheckoutmagentoonepagecheckout2019-12-05 21:39
- checkout:Magento如何在为客人下订单之前更新结算/发货订单magento1.9magentocheckoutmagentobillingmagentoeditorder2019-12-05 21:38
试试这个!
Overwrite Mage_Checkout_Block_Onepage_Payment class:
最后,覆盖
[Update]
How you overwrite opcheckout.js?
现在打开 checkout/onepage.phtml 当前主题中的模板.防爆.我的情况是默认的 rwd/default
添加以下行:
我已经使用带有样本数据的全新安装测试了M1.9.4.1。