更新时间:2023-11-29 21:39:46
我认为您不需要为此编辑任何代码.使用一些数学技巧.
I don't think you need to edit any code for that. Use some math tricks.
您想给予10%的折扣,但折扣不超过1000美元.
You want to give a 10% discount but no discount bigger than 1000$.
创建2条规则:
编辑-由于您只需要一个规则
使用以下命令在模块中扩展app/code/core/Mage/SalesRule/Model/Validator.php. app/code/local/Namespace/Module/etc/config.xml
Extend the app/code/core/Mage/SalesRule/Model/Validator.php in your module using: app/code/local/Namespace/Module/etc/config.xml
<global>
<models>
<salesrule>
<rewrite>
<validator>Namespace_Module_Model_Validator</rule_collection>
</rewrite>
</salesrule>
</models>
app/code/local/Namespace/Module/Model/Validator.php
app/code/local/Namespace/Module/Model/Validator.php
<?php
Namespace_Module_Model_Validator extends Mage_Core_Model_Validator {
... //place your updated method here