Skip to content

Instantly share code, notes, and snippets.

@jaromirmuller
Created October 18, 2014 19:25
Show Gist options
  • Save jaromirmuller/132cdd9378e5b1018170 to your computer and use it in GitHub Desktop.
Save jaromirmuller/132cdd9378e5b1018170 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