2

On the checkout/cart page I need to change the Shopping cart title.

Where can I find it in the code?

2

3 Answers 3

2

Never edit core files in Magento!

Solution without changing core files

You can define custom translations in your theme, create the following file if it does not exist yet:

app/design/frontend/[package]/[theme]/locale/en_US/translate.csv

(replace en_US if you use a different language)

Note that this should be a project specific theme, not rwd/default or some_bought_theme/default. If you did not already, you can add a child theme next to default and specify this one as theme in the system configuration. You don't need to copy anything from the default directory since Magento falls back automatically, so you only need to add the files that are customized.

In the translate.csv you can add your custom translations. Since the translated string is "Shopping Cart" and it's coming from the Mage_Checkout module, you need to add this line:

"Mage_Checkout::Shopping Cart","Whatever you want to display instead"
0

The file in question is:

/app/code/core/Mage/Checkout/controllers/CartController.php

  • Check line 180 (in version 1.9.1)

->getLayout()->getBlock('head')->setTitle($this->__('Shopping Cart'));

Although you should not be editing any core files so you remain update-friendly.


EDIT:

To change the page heading you need to go to your theme and open (based on the 1.9.1 RWD theme):

/app/design/frontend/rwd/default/template/checkout/cart.phtml

and look for and edit:

<h1><?php echo $this->__('Shopping Cart') ?></h1>

Although, again, as explained in my comments you could simply edit your locale file and 'translate' what you wish to change.

eg:

/app/locale/en_US/Mage_Checkout.csv and see in line 295:

"Shopping Cart","Shopping Cart"

and change this to:

"Shopping Cart","Whatever text you want to show instead!!"

9
  • Thanks I can able to edit the title.Inside checkout/cart/ page also I need to change . can you please say the file name with file path
    – Suba sekar
    Commented Feb 25, 2015 at 8:50
  • Change what else (you didn't supply any info!)? Generally speaking you should use a custom language file in your themes locale to 'translate' the text you wish to change.
    – tecjam
    Commented Feb 25, 2015 at 8:55
  • Tecjam can you please help me
    – Suba sekar
    Commented Feb 25, 2015 at 8:55
  • Inside checkout/cart page there is Shopping cart heading and proceed with check out button.Could you please tell me where to change the shopping cart heading .I mean which file and file path.
    – Suba sekar
    Commented Feb 25, 2015 at 9:45
  • See my edit above.
    – tecjam
    Commented Feb 25, 2015 at 9:59
0

As I already answered at "Change Shopping Cart Title" article...

The best and easiest solution that I found and that will not affect the default MAGENTO 2 structure (just changed under my theme) is by Prashant Valanda on "How to modify page title?" article.

Basically you just need to add this code in your XML file. In this case checkout_cart_index.xml:

<referenceBlock name="page.main.title">
    <action method="setPageTitle">
        <argument translate="true" name="title" xsi:type="string">Basket</argument>
    </action>
</referenceBlock>

After change doesn't forget to flush the cache.

php bin/magento cache:flush

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.