VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: julianmx on August 24, 2013, 00:17:43 AM

Title: How to: add <p>, <br /> <font > in Prodcut name
Post by: julianmx on August 24, 2013, 00:17:43 AM
II have tried but when I save, it deletes the entire html code or tags that I have included
thank you very much!
Title: Re: How to: add <p>, <br /> <font > in Prodcut name
Post by: jenkinhill on August 24, 2013, 12:28:06 PM
Please be more specific. Product name where? In a module, category page, product details?  And why a <font> tage - you should be using css to control fonts and to add spacing.
Title: Re: How to: add <p>, <br /> <font > in Prodcut name
Post by: julianmx on August 26, 2013, 02:07:01 AM
hi thanks for reply, I need, in this part separates the code (numbers), from the  product name my client wants all codes in a second row o, can we do this,
thanks!



[attachment cleanup by admin]
Title: Re: How to: add <p>, <br /> <font > in Prodcut name
Post by: jenkinhill on August 26, 2013, 11:50:38 AM
That numerical part is the SKU. Dont include the number in the product name, just display the SKU immediately below the name. Looks like you are already using an override template for the category display so the template for you to edit will be in [your-joomla-template]/html/com_virtuemart/category/

For the default VM category template, default.php in version 2.0.22b the following code change adds the SKU immediately beow the product name.

Find this code (around line 285)

<h2><?php echo JHTML::link ($product->link$product->product_name); ?></h2>


replace with


<h2><?php echo JHTML::link ($product->link$product->product_name); ?> <br /> <?php echo JHTML::link ($product->link$product->product_sku?></h2>


The code in youe template file may be slightly different to this, but the same principle applies.

You can make a similar change to the product details template.
Title: Re: How to: add <p>, <br /> <font > in Prodcut name
Post by: julianmx on August 26, 2013, 20:45:27 PM
many thanks for the tip, helped me to work around my problema!

but beyond that I seek to put a <BR/> this because I'm trying to get the pictures be aligned , and the box stay with the same height, and if I put the <BR/>I'll force that the photos are alienated
Title: Re: How to: add <p>, <br /> <font > in Prodcut name
Post by: jenkinhill on August 26, 2013, 23:54:23 PM
You could use phpMyAdmin to edit the product name directly inh the database. The added code may well break product search, though.

Alignments should be managed using css.
Title: Re: How to: add <p>, <br /> <font > in Prodcut name
Post by: Maxim Pishnyak on August 28, 2013, 15:19:29 PM
Could you explain me is it still necessary for you to have <br /> at this stage?