VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: MAD King on January 05, 2015, 22:45:47 PM

Title: How to Extend Short Product Description in Category View?
Post by: MAD King on January 05, 2015, 22:45:47 PM
I am beginning to dislike VM 3. It gets more and more complicated to figure out what is different compare to VM 2.
Everything seems to have moved and nothing can be found. The documentation for VM3 does not exist.

In VM 2 there was the possibility to change the short text from 40 characters to another length in
components/com_virtuemart/views/category/tmpl/default.php

but this disappeared and I am not able to find it.

Simple things like this cost more and more time.
I would love to have a paid support to solve issues like this in VM 3

Joomla 3.3.6
VM 3.0.2
Title: Re: How to Extend Short Product Description in Category View?
Post by: GJC Web Design on January 05, 2015, 23:02:53 PM
echo shopFunctionsF::limitStringByWord ($product->product_s_desc, 60, ' ...')

components\com_virtuemart\sublayouts\products.php
Title: Re: How to Extend Short Product Description in Category View?
Post by: MAD King on January 05, 2015, 23:10:52 PM
Thank you very much. So, everything is now placed in the sublayouts folder?
Title: Re: How to Extend Short Product Description in Category View?
Post by: jenkinhill on January 05, 2015, 23:20:46 PM
Not everything.  http://docs.virtuemart.net/tutorials/templating-layouts/199-sublayouts.html
Title: Re: How to Extend Short Product Description in Category View?
Post by: MAD King on January 05, 2015, 23:27:51 PM
Ahhh, that is a great improvement.
Title: Re: How to Extend Short Product Description in Category View?
Post by: favdes on June 17, 2015, 12:26:37 PM
Hi everyone,

I've just tried doing this but it doesn't seem to make a difference to the category page. I think the original poster asked to amend the category view page?

Am I doing this wrong? Sorry  :)
Title: Re: How to Extend Short Product Description in Category View?
Post by: jenkinhill on June 17, 2015, 13:12:41 PM
The edit for VirtueMart 3.x is made on the sublayout,  components/com_virtuemart/sublayouts/products.php

The relevant code block is around line 100:

<p class="product_s_desc">
                  <?php // Product Short Description
                  if (!empty($product->product_s_desc)) {
                     echo shopFunctionsF::limitStringByWord ($product->product_s_desc, 60, ' ...') ?>
                  <?php } ?>
</p>

Change the 60 to whatever value you require, and use the edited file as a sublayout override.

If you already have an override for products.php (eg you use a commercial Joomla/VM template) then you should edit that sublayout override.
Title: Re: How to Extend Short Product Description in Category View?
Post by: dsrpmedia on July 20, 2015, 23:10:42 PM
doesn not seem to be making a difference on my site

tried both editing the original file, as well as making a sublayouts folder in com_virtuemart of my templates html folder
Title: Re: How to Extend Short Product Description in Category View?
Post by: mizu on July 26, 2015, 10:59:01 AM

shopFunctionsF::limitStringByWord ($product->product_s_desc, 160, ' ...')

If my category view has 3 columns an I extend the character amount, then the column size also extends accordingly.
I tried to give the product_s_desc class a certain width, but that's surely not the proper way.
What would be the proper solution for it?
Title: Re: How to Extend Short Product Description in Category View?
Post by: Studio 42 on July 27, 2015, 15:12:27 PM
HI,
Do not forget that template do not always follow virtuemart changes, this mean in some case you have to edit old file and not sublayout !
Title: Re: How to Extend Short Product Description in Category View?
Post by: mizu on July 28, 2015, 12:07:23 PM
yes, figured it out. It's a template issue. I managed to achieve the desired layout by some override. All proper now.