duan2428 2014-08-27 00:03
浏览 87
已采纳

Amasty促销不在Magento模块中工作

I have a cashier module that replaces the ordinary checkout i Magento 1.8. It has a unique url, such as mystore.com/mycashier

My problem is that the discount breakdowns (labels and individual discount amounts) in Amasty is not showing up in the cart. This is working in for example mystore.com/checkout/cart or mystore.com/checkout/onepage, but not in mystore.com/mycashier.

I found these specific lines in discount.phtml:

<?php if (is_array($this->getTotal()->getFullInfo())) : ?>
<?php foreach ($this->getTotal()->getFullInfo() as $info): ?>

$this->getTotal()->getFullInfo() is NULL in mystore.com/mycashier. So I tried to track down with profiler what was going on:

The following lines are found in the profiler when visiting mystore.com/checkout/cart but not when visiting mystore.com/mycashier:

OBSERVER: amasty_promo_model_observer   
CORE::create_object_of::Amasty_Rules_Model_SalesRule_Rule_Condition_Product_Combine
CORE::create_object_of::Amasty_Rules_Model_SalesRule_Rule_Condition_Product
OBSERVER: amasty_rules_model_observer

However, notice that the total discount amount is visible and working perfectly, just not the individual discount labels and amounts.

What can I do to make this work and how do i do it?

Any ideas are appreciated!

Thanks!

  • 写回答

2条回答 默认 最新

  • drol55885602 2014-09-02 09:24
    关注

    Finally I found the solution, thanks to Amasty.

    In the cashier module I needed to trigger the salesrule_validator_process through getTotals(), specifically from Mage::getModel('checkout/cart')->getQuote()

    So I added two lines before the layout rendering in the indexController file for the module:

        $new_quote = Mage::getModel('checkout/cart')->getQuote();
        $new_quote->collectTotals();
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化
  • ¥15 Mirare PLUS 进行密钥认证?(详解)
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证
  • ¥20 想用ollama做一个自己的AI数据库
  • ¥15 关于qualoth编辑及缝合服装领子的问题解决方案探寻
  • ¥15 请问怎么才能复现这样的图呀