在Magento代码中处理购物车规则的位置

我想查看magento中的代码,其中检查购物车规则并将其应用于购物车中的商品 在结账之前,我可以在显示信息的模板中找到但是我找不到在哪里检查是否应该应用购物车规则</ p>

编辑1:通过“购物车” 规则被检查“我的意思是”购物车价格规则被检查“(可能有2种不同类型的购物车规则),我正在寻找代码</ p>

”这3项 在购物车中满足购物车规则的条件,ID为15,我知道需要更新项目信息,如项目符合行动条件“</ p>
< / DIV>

展开原文

原文

i want to look at the code in magento where the shopping cart rules are checked and applied to the items in the cart before the checkout, i can find in the templates where the information is displayed but i can't find where it is checked if the cart rule should be applied

EDIT 1: by "shopping cart rules are checked" i mean "shopping cart price rules are checked" (maybe there 2 different types of shopping cart rules), i'm looking for the code that goes

"these 3 items that are in the cart meet the conditions of the shopping cart rule with the id of 15, i know need to update the item information as described by the actions provided that the items meet the conditions in the actions"

2个回答



在以下模块中:Mage_Salesrule,特别是在 app / code / core / Mage / SalesRule / Model / Rule.php < / code> </ p>
</ div>

展开原文

原文

In the following module: Mage_Salesrule, specifically within app/code/core/Mage/SalesRule/Model/Rule.php



在ver。 1.4.2.0关于应用销售规则的主要逻辑是位于 /app/code/core/Mage/SalesRule/Model/Validator.php </ code> </ p> \中的 Mage_SalesRule_Model_Validator </ code> n

另外,如果您在 Mage :: getModel('salesrule / validator')</ code>或 Mage :: getSingleton('salesrule / validator')</ code>语句中查找 / app / code / </ code>目录,您可以看到使用规则处理的位置:

/app/code/core/Mage/SalesRule/Model/Observer.php </ code >结果,
<代码> /app/code/core/Mage/SalesRule/Model/Quote/Discount.php </代码>结果,
<代码> /应用程序/代码/核心/法师/ SalesRule / 型号/报价/ Freeshipping.php </ code> </ p>
</ div>

展开原文

原文

In ver. 1.4.2.0 the main logic about aplying sales rules is in Mage_SalesRule_Model_Validator located in /app/code/core/Mage/SalesRule/Model/Validator.php

Also if you look for Mage::getModel('salesrule/validator') or Mage::getSingleton('salesrule/validator') statements in /app/code/ directory you can see where the rule processing is used:
/app/code/core/Mage/SalesRule/Model/Observer.php
/app/code/core/Mage/SalesRule/Model/Quote/Discount.php
/app/code/core/Mage/SalesRule/Model/Quote/Freeshipping.php

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐