【问题标题】:conflicting two magento extension冲突的两个 magento 扩展
【发布时间】:2014-11-24 22:27:09
【问题描述】:

我有两个相同的扩展名,但都用于不同的目的。

扩展 A Config.xml

<config>
<modules>
    <Mageworks_Fee>
        <version>0.1.5</version>
    </Mageworks_Fee>
</modules>
<global>
    <sales>
        <quote>
            <totals>
                <fee>
                    <class>fee/sales_quote_address_total_fee</class>
                    <renderer>fee/checkout_totals_fee</renderer>
                    <admin_renderer>fee/adminhtml_sales_order_create_totals_fee</admin_renderer>
                </fee>
            </totals>
        </quote>
        <order_invoice>
            <totals>
                <fee>
                    <class>fee/sales_order_total_invoice_fee</class>
                </fee>
            </totals>
        </order_invoice>
        <order_creditmemo>
            <totals>
                <fee>
                    <class>fee/sales_order_total_creditmemo_fee</class>
                </fee>
            </totals>
        </order_creditmemo>
    </sales>
   </global>
 </config> 

扩展 B Config.xml

 <config>
<modules>
    <Mageworks_Insurance>
        <version>0.1.5</version>
    </Mageworks_Insurance>
</modules>
<global>
    <sales>
        <quote>
            <totals>
                <insurance>
                    <class>insurance/sales_quote_address_total_insurance</class>
        <before>fee</before>
                    <renderer>insurance/checkout_totals_insurance</renderer>
                    <admin_renderer>insurance/adminhtml_sales_order_create_totals_insurance</admin_renderer>
                </insurance>
            </totals>
        </quote>
        <order_invoice>
            <totals>
                <insurance>
                    <class>insurance/sales_order_total_invoice_insurance</class>
                </insurance>
            </totals>
        </order_invoice>
        <order_creditmemo>
            <totals>
                <insurance>
                    <class>insurance/sales_order_total_creditmemo_insurance</class>
                </insurance>
            </totals>
        </order_creditmemo>
    </sales> 
   </global>
 </config>   

两者的总价冲突,请帮助我如何解决这个问题。

【问题讨论】:

  • 你能用一个场景解释一下价格如何受到两个模块的影响,保险和费用总额是如何计算的等等。
  • 我正在使用此扩展程序excellencemagentoblog.com/magento-add-fee-discount-order-total,并且我制作了此扩展程序的另一个副本,请查看此问题中的问题 ....stackoverflow.com/questions/26100747/…
  • 当这两个模块都处于活动状态时,我有总计计算错误,具体来说,税收没有按应有的方式添加到总计中。
  • 您确定仅在启用这些模块时才将税款添加到总计中吗?Magento 中还有几个设置(系统 > 配置 > 销售 > 税),我们可以使用这些设置来包括税到 sutotal,包括税到产品价格等。请在此处仔细检查您的税显示配置系统 > 配置 > 销售 > 税。

标签: magento magento-1.7 magento-1.8 magento-1.4 magento-1.5


【解决方案1】:

这与我遇到的问题相同,目前您仅在一个扩展中添加 before 标签,因此请删除此行。

<before>fee</before>

你必须在两个扩展中设置 afterbefore 标签。

在扩展 A Config.xml 文件中使用这个

<after>subtotal,discount,shipping</after> 
<before>tax,grand_total</before> 

在你的扩展 B Config.xml 文件中使用这个

<after>fee</after> 
<before>tax,grand_total</before> 

希望对你有帮助

【讨论】:

  • 非常感谢.. Vishal Sharma
【解决方案2】:

Magento 使用的排序算法不稳定,可能导致错误的结果。你可以使用这个补丁:https://stackoverflow.com/a/11954867/288568

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2011-07-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-10-18
    • 1970-01-01
    相关资源
    最近更新 更多