php - Product name limit in magento -



php - Product name limit in magento -

i need limit length of product name on front end end.

i using magento 1.4.2, can help?

you can in template files... assuming want limit name on product view page, re-create app/design/frontend/base/default/template/catalog/product/view.phtml theme in e.g. app/design/frontend/interface/theme/template/catalog/product/view.phtml. in line 52, have like

<h1><?php echo $_helper->productattribute($_product, $_product->getname(), 'name') ?></h1>

you can alter in:

<h1> <?php // define maximum length of product name here $maxlength = 10; $productname = $_helper->productattribute($_product, $_product->getname(), 'name'); echo substr($productname, 0, $maxlength); ?> </h1>

please seek describe question in more detail next time...

hope helps.

php mysql magento-1.4 magento

Comments

Popular posts from this blog

java - How to pass parameters between Request-Scoped Controllers? -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -

actionscript 3 - Flex: moving a point with rotation doesnt change the point XY? -