News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Changing productname

Started by Mecmiklo, February 03, 2013, 21:36:07 PM

Previous topic - Next topic

Mecmiklo

Hello,
im trying to change the way virtuemart displays the productname in the product overview.

When the productname exceeds a certain length, virtuemart cuts it off and places the part that is cut of beneath the  first part.
This way the box in which the product is located (class="spacer") gets bigger than the ones with shorter names.
What i want to do is write a small php code that cuts the name to a certain length and then adds three dots at the end.

Example:

"Productnamewhichistoolong will be cut to Productnam..."
Instead of: Productnamewhich
                   istoolong

What i found is the line: <h2><?php echo JHTML::link ($product->link, $product->product_name); ?></h2> 
in /httpdocs/components/com_virtuemart/views/category/tmpl/Default.php

This line produces the productname plus link to the productpage.

Can anyone tell me how i can get that productname plus link within a variable? So i can run it through the code before echoing it to the website.

Or is there maybe another way to do this?

Im using joomla 2.5 with virtuemart 2.0.18a

Thnx.

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

Mecmiklo

#2
Thnx for the quick reaction.