On the checkout/cart page I need to change the Shopping cart title.
Where can I find it in the code?
On the checkout/cart page I need to change the Shopping cart title.
Where can I find it in the code?
Never edit core files in Magento!
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"
The file in question is:
/app/code/core/Mage/Checkout/controllers/CartController.php
->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!!"
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