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

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 安装svn网络有问题怎么办
  • ¥15 Python爬取指定微博话题下的内容,保存为txt
  • ¥15 vue2登录调用后端接口如何实现
  • ¥65 永磁型步进电机PID算法
  • ¥15 sqlite 附加(attach database)加密数据库时,返回26是什么原因呢?
  • ¥88 找成都本地经验丰富懂小程序开发的技术大咖
  • ¥15 如何处理复杂数据表格的除法运算
  • ¥15 如何用stc8h1k08的片子做485数据透传的功能?(关键词-串口)
  • ¥15 有兄弟姐妹会用word插图功能制作类似citespace的图片吗?
  • ¥15 latex怎么处理论文引理引用参考文献