任何人都知道如何将Magento的折扣分组?如何设置每组的最大总折扣?以及如何设置最大总折扣? 例如:
Discount Group 1:
a. Early Bird Discount = 10%
b. Member of ABC Organization = 8%
c. Member of BCD Organization = 5%
-----Total Maximum discount for this discount group = 15%
Discount Group 2:
a. Buy more than 5 items = 10%
b. Member of DFG Organization = 5%
c. Member of ASD Organization = 5%
-----Total Maximum discount for this discount group = 15%
-----Total Maximum discount for ALL discount group = 25%
答案 0 :(得分:6)
不可否认,通过Magento的标准功能无法实现您所需的完全相同的功能。但您可以使用折扣组创建自定义,并通过观察事件salesrule_validator_process
来验证折扣金额。
一步一步的发展建议:
salesrule_validator_process
创建观察者:
$observer->getEvent()->getRule()
- 当前申请规则的模型$observer->getEvent()->getItem()
- 应用此规则的当前报价项$observer->getEvent()->getAddress()
- 应用此规则的当前引用地址$observer->getEvent()->getQuote()
- 客户的当前报价$observer->getEvent()->getQty()
- 用于计算折扣的项目的数量:固定项目折扣,项目价格百分比,项目价格百分比$observer->getEvent()->getResult()
- Varien_Object包含作为折扣应用的数据,现在有两个属性。
getDiscountAmount()
- 当前显示货币的折扣金额getBaseDiscountAmount()
- 基本网站货币的折扣金额