Skip to content

Instantly share code, notes, and snippets.

@srinathweb
Forked from jaromirmuller/Url.php
Created May 11, 2016 09:44
Show Gist options
  • Select an option

  • Save srinathweb/1ef9ac3eb019d5d3f9ef6bbb97bfb5e6 to your computer and use it in GitHub Desktop.

Select an option

Save srinathweb/1ef9ac3eb019d5d3f9ef6bbb97bfb5e6 to your computer and use it in GitHub Desktop.

Revisions

  1. @jaromirmuller jaromirmuller created this gist Oct 18, 2014.
    18 changes: 18 additions & 0 deletions Url.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    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);
    }
    }
    22 changes: 22 additions & 0 deletions config.xml
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    <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>