magento 免邮费价格根据打折后的价格设置
来源:互联网 发布:万网域名交易平台上线 编辑:程序博客网 时间:2024/06/11 19:53
在magento 后台中有设置 免邮费的一项。 但是经过测试实际上价格是小计价格
即购物车里产品价格初步总计,还没有做优惠券等折扣计算。
例如有些网站开发了 积分抵现的功能,亦或是你设置了购物车促销规则,亦或是通过促销规则设置了
优惠券等等情况都会造成最终价格低于达到包邮的价格。
那么我们的修改方法如下:
找到文件 Mage\Shipping\Model\Carrier\Freeshipping.php (在 local 下重写)
修改其中代码:
if (!$this->getConfigFlag('active')) { return false; } $result = Mage::getModel('shipping/rate_result'); $this->_updateFreeMethodQuote($request); if (($request->getFreeShipping()) || ($request->getBaseSubtotalInclTax() >= $this->getConfigData('free_shipping_subtotal')) ) { $result->append($this->addFreeShipping()); }
改为:
if (!$this->getConfigFlag('active')) { return false; } $result = Mage::getModel('shipping/rate_result'); $this->_updateFreeMethodQuote($request); if (($request->getFreeShipping()) || ($request->getPackageValueWithDiscount() >= $this->getConfigData('free_shipping_subtotal')) ) { $result->append($this->addFreeShipping()); }其实就改动了一个函数 即 getPackageValueWithDiscount() 。
函数 getBaseSubtotalInclTax()是获得购物车的小计价格
getPackageValueWithDiscount() 是获得打折后的包裹价格
当然你可以打印出 $request 变量 看一下里面还有那些值。
0 0
- magento 免邮费价格根据打折后的价格设置
- Magento如何设置产品的打折或者优惠价格
- 游戏里的打折促销和低廉价格
- 实现购物商城的在价格中间打折----SpannableString类
- Magento中 可配置产品 价格不根据选项变化
- magento批量修改价格
- magento 设自定义选项,选择后价格变0
- TextView添加删除线 类似打折价格
- Magento价格显示优惠百分比 /及获取产品的价格方案
- magento中通过产品的id得到产品的价格
- Magento网站,cart的Qty改变时即时更新价格
- Magento系统网站价格变为负数的解决办法
- Magento 查询产品SKU和价格的SQL
- 一万有找的Xperia M2 价格降低、品质不打折
- 30. 价格区间设置
- “铁老大”价格坚冰松动 成都火车票打折三成
- magento自定义按价格浏览范围
- Magento利用价格(price)筛选商品
- SATA,SAS,SSD 读写性能测试结果
- 什么是重构
- Majority Element
- HDU-2504-矩形A + B
- Swift-可能值1-可选绑定-可选链
- magento 免邮费价格根据打折后的价格设置
- inner join / left join /right join 处理逻辑
- 两点距离
- 集训 第二篇
- LeetCode--Maximum Product Subarray
- 打印蛇形矩阵-题解
- hadoop的dfs.replication和dfs setrep
- Roman to Integer leetcode
- 数据库问题