If this tutorial is not what you were looking for, you still have any questions, suggestions or concerns - feel free to let us know. Please help us to serve you better!

Your Name

Your Email

Your Message (required)

captcha

Featured templates

Magento. How to change number of characters displayed in product titles (if there is no reference to it in phtml)

Hello! This video tutorial shows how to change the number of characters displayed in product titles in Magento (if there is no reference to it in phtml).

Magento. How to change number of characters displayed in product titles

Sometimes the number of characters for product titles is not set in .phtml files.

This is definitely what you may want to change since the long product names will not look nice:

magento_how_to_change_characters_numbers_for_priducr_titles_1

Let’s learn how to do that.

Let’s say you want to set the number of characters in product titles on the products listing page:

magento_how_to_change_characters_numbers_for_priducr_titles_2

  1. Using your FTP/Hosting control panel File Manager navigate to /app/design/frontend/default/themeXXX/template/catalog/product/ directory to locate the list.phtml file.

  2. Open the file for editing and look for the following line of code:

<?php echo $_helper->productAttribute($_product, $_product->getName(), 'name') ?>

Replace it with the following code:

<?php echo substr($_helper->productAttribute($_product, $_product->getName() , 'name'), 0,10) ; ?>

magento_how_to_change_characters_numbers_for_priducr_titles_3

You may change the value of 10 to any other value to limit the product name to the desired number of characters.

Save the file to apply changes.

Navigate to your store front-end and refresh the page to see changes.

You can see the product names are now limited to 10 characters:

magento_how_to_change_characters_numbers_for_priducr_titles_4

This is the end of the tutorial. You have learnt how to change the number of characters displayed in product titles in your Magento store.

Feel free to check the detailed video tutorial below:

Magento. How to change number of characters displayed in product titles