In this tutorial we will teach you how to change the length of product names in different parts of your Magento store, including the product listing and home pages.
Sometimes, the name appears not complete, and you want to encrease the number of symbols in it, or vice versa, you want to shorten the name on specific pages.
Changing the number of symbols in products names on the home page
Usually there are 2 blocks with products on the home page – New products and Special Products (some templates do not include Specials block).
To change the number of symbols in the “New” products names, go to your server using the FTP or hosting cpanel and look for the new.phtml file in the “app/design/frontend/default/themeXXX/template/catalog/product” directory:
Locate the class=”product-name” and edit the number of symbols in mb_substr($small_getName, 0, …,’UTF-8′).’…’;} function:
Check the update on the frontend of your site after saving the changes.
The number of symbols in the names of Specials can be changed in the sale_carousel_list.phtml (or the sale_default_list.phtml, depending on the widget type used in the template) file in the app/design/frontend/default/themeXXX/template/catalog/product/widget/sale/” folder:
Edit the number in code starting from <h3 class=”product-name”> part and save the changes:
Changing the number of symbols on product listing pages
The number of symbols on product listing pages (category page) can be updated in the list.phtml file in the “app/design/frontend/default/themeXXX/template/catalog/product” folder on your server. The code is similar to the one in the previous files:
NOTE: Remember that the lines as well as the the code may differ a little depending on a template.
We hope the tutorial was useful for you. Feel free to check the detailed video tutorial below: