Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在 Magento 中,我试图在购物篮阶段对总价值进行四舍五入。我申请了折扣券并以 0.24 之类的小数结束。我想将它四舍五入到最接近的数字。
它不会像舍入显示值那么简单。总计需要发送到 Paypal、Sagepay 等...
您必须覆盖“总计”总类并在那里实现舍入。请参阅销售模块 config.xml(销售/总计部分)和税务模块 config.xml(相同,销售/总计部分)。检查 Mage_Sales_Model_Quote_Address_Total_Grand 的代码
您必须在 collectTotals() 方法或某些在收集总计时调用 get 的方法中执行此操作。最好的选择是税收计算对象/方法。