Skip to content

Instantly share code, notes, and snippets.

@srinathweb
Forked from jaromirmuller/Url.php
Created May 11, 2016 09:44
Show Gist options
  • Save srinathweb/1ef9ac3eb019d5d3f9ef6bbb97bfb5e6 to your computer and use it in GitHub Desktop.
Save srinathweb/1ef9ac3eb019d5d3f9ef6bbb97bfb5e6 to your computer and use it in GitHub Desktop.
checkout/bag url rewrite
<config>
<global>
<rewrite>
<mynamespace_mymodule_checkout_cart>
<from>
<![CDATA[ #^/checkout/bag# ]]>
</from>
<to>/checkout/cart</to>
</mynamespace_mymodule_checkout_cart>
</rewrite>
<models>
<getready_rewrite>
<class>Getready_Rewrite_Model</class>
</getready_rewrite>
<core>
<rewrite>
<url>Getready_Rewrite_Model_Core_Url</url>
</rewrite>
</core>
</models>
</global>
</config>
class Getready_Rewrite_Model_Core_Url extends Mage_Core_Model_Url {
/**
* Build url by requested path and parameters
*
* @param string|null $routePath
* @param array|null $routeParams
* @return string
*/
public function getUrl($routePath = null, $routeParams = null) {
if ( $routePath == 'checkout/cart' ) {
$routePath = 'checkout/bag';
}
return parent::getUrl($routePath, $routeParams);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment