检查规则是否在购物车规则中通过。

huangapple go评论46阅读模式
英文:

Check if a rule is passed in Cart rules

问题

我可以看到规则应用于购物车,并在 CheckoutCartPageLoadedEvent 事件中使用以下代码:

$event->getPage()->getCart()->getRuleIds()

但是,我如何知道某个规则是否已通过或未通过呢?根据我理解,RuleIds 数组包含了所有已评估的规则,但我无法确定它们是否通过或未通过。

英文:

I can see the rules applied to a cart with

CheckoutCartPageLoadedEvent

$event->getPage()->getCart()->getRuleIds()

but how can I know if a certain rule passed or not? For what I understand the RuleIds array contains all the rules evaulated, but I can't see if they are passed or not.

答案1

得分: 2

ruleIds列表属性应仅包含从当前Context对象或当前Cart对象检索的rule实体的ID,这些实体的评估结果为true。如果包括某个ID,则表示规则的条件得到满足,否则表示条件未得到满足。

英文:

Both ruleIds list properties retrieved from either the current Context object or the current Cart object should only contain the ids of rule entities that evaluated to true. If an id is included, the rule's conditions were met, otherwise they weren't.

huangapple
  • 本文由 发表于 2023年2月18日 23:49:38
  • 转载请务必保留本文链接:https://go.coder-hub.com/75494495.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定