0
votes

I would like to rename the URL path of the shopping cart from checkout/cart to checkout/adverts.

I have tried the following two methods:

Catalog > URL Rewrite Management: Custom

enter image description here

I have also tried doing it using a custom module, with the following in my config.xml:

<global>
   <rewrite>
      <mynamespace_mymodule_checkout_cart>
        <from><![CDATA[#^/checkout/cart#]]></from>
        <to>/checkout/adverts</to>
      </mynamespace_mymodule_checkout_cart>
   </rewrite>
</global>

Both methods have gone to the correct URL path, but shown a 404 Error page - is there something else I need to do? Magento ver. 1.5.0.1

2

2 Answers

0
votes

What happen if you add a empty controller to your custom module

<?php
require_once('Mage/Checkout/controllers/CartController.php');
class Mynamespace_Mymodule_CartController extends Mage_Checkout_CartController
{

}
0
votes

As R.S said you have to extend CartController.php in your module

<?php
   require_once('Mage/Checkout/controllers/CartController.php');
    class Mynamespace_Mymodule_CartController extends Mage_Checkout_CartController
       {
       }
 ?>

in it copy the indexAction() of Mage/Checkout/controllers/CartController.php

Also in your local.xml write

<mymodule_cart_adverts> 
 // copy the xml code inside <checkout_cart_index> ... </checkout_cart_index> here
</mymodule_cart_adverts>

I havent tried it but it should work