Magento Extension Rewrite Config.xml

51 Views Asked by At

I have rewrite tag in config.xml of mageworld onestepcheckout.

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

But the problem is it redirects child domain url to http://child.domain/index.php/checkout/onepage/success/

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

Any idea how to fix?

1

There are 1 best solutions below

0
fantasticrice On

You may want to extend the Mage_Checkout_Helper_Url::getCheckoutUrl() method instead with your own helper. Something like this will cause Magento to use your method to generate the checkout page URL instead of the default:

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));
    }
}