Magento 从购物车中删除商品/删除报价操作不完整 - 价格规则错误
有人注意到引用没有被正确删除吗? 例如,优惠券代码变量在您从购物车中删除产品后保留该值。
尝试:
1.为产品设置一些购物车价格规则,并使其在标题部分显示横幅。
2. 将产品[仅此产品]添加到结帐/购物车,以触发规则并在结帐/购物车上显示横幅。
3。从购物车中删除产品,您将看到横幅仍显示在标题部分。
笔记。如果您的购物车中有其他产品,则此操作将不起作用,因为当您删除触发规则和横幅的产品时,优惠券
代码将被属于购物车中其他产品的代码替换。 因此,只有当购物车中只有触发规则和横幅的产品时,此错误才会起作用。
如果有人解决了这个问题或者可以复制这些条件:我很乐意就 magento 的缺陷进行对话,以便从购物车中删除适当的产品 - 这意味着适当的报价刷新。
- code/core/Mage/Sales/Model/Quote.php -> public function removeItem($itemId)
在 Magento 企业版上找到
Did anybody notice that the quote is not being deleted properly?
For example the coupon code variable keeps the value after you delete a product from cart.
Try:
1. Set some Shopping Price Cart Rule to a product and make it display a banner on the header section.
2. Add the product [only this product] to checkout/cart in order to trigger the rule and show the banner on the checkout/cart.
3. Delete the product from cart and you will see the banner still showing on the header section.
Note. If you have another product in cart this will not work because when you delete the one that triggered the rule&banner the Coupon
Code will get replaced with the one that belongs to this other product in cart.
SO this bug only works if only the product that triggers the rule&banner is in cart.
If anybody has a fix on this or can replicate these conditions: I'd love to have a conversation about magento's deficiency to make a proper product delete from cart - which implies a proper quote refresh.
- code/core/Mage/Sales/Model/Quote.php -> public function removeItem($itemId)
Found on Magento Enterprise Edition
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
sales_quote_remove_item
事件来修复它。1)创建新扩展(这里是如何做到这一点的好答案:如何在 Magento 中创建 Hello world 扩展?)并将下一部分添加到您的 config.xml 中:
2)创建文件 app/code/local/Your/Extension/Model/Observer.php :
之后清除 Magento缓存并尝试重复问题 - 它应该消失。
You can use
sales_quote_remove_item
event for fixing it.1) Create new extension (here is good answer how to do it: How to create a Hello world extension in Magento?) and add next section to your config.xml:
2) Create file app/code/local/Your/Extension/Model/Observer.php :
After that clear Magento cache and try to repeat issue - it should gone.