【问题标题】:Magento Extension Rewrite Config.xmlMagento 扩展重写 Config.xml
【发布时间】:2016-02-22 21:06:23
【问题描述】:

我在 mageworld onestepcheckout 的 config.xml 中有 rewrite 标签。

<rewrite>
   <mw_onestepcheckout_index>
      <from><![CDATA[#^/checkout/onepage/#]]></from>
      <to>/onestepcheckout/index/</to>
    </mw_onestepcheckout_index>
</rewrite>

但问题是它会将子域 url 重定向到 http://child.domain/index.php/checkout/onepage/success/

https://parent.domain/index.php/onestepcheckout/index/success/

知道如何解决吗?

【问题讨论】:

    标签: xml magento magento-1.6


    【解决方案1】:

    您可能希望使用自己的助手扩展Mage_Checkout_Helper_Url::getCheckoutUrl() 方法。这样的事情会导致 Magento 使用您的方法来生成结帐页面 URL 而不是默认的:

    class My_OneStepCheckout_Helper_Url extends Mage_Checkout_Helper_Url
    {
        /**
         * Retrieve checkout url
         *
         * @return string
         */
        public function getCheckoutUrl()
        {
            return $this->_getUrl('onestepcheckout', array('_secure'=>true));
        }
    }
    

    【讨论】:

      猜你喜欢
      • 2014-05-20
      • 2015-01-19
      • 1970-01-01
      • 2014-07-31
      • 1970-01-01
      • 2013-03-19
      • 1970-01-01
      • 2010-11-27
      • 2014-04-24
      相关资源
      最近更新 更多