VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: aussiemike on September 18, 2012, 02:21:42 AM

Title: Change length of short description
Post by: aussiemike on September 18, 2012, 02:21:42 AM
Hello
Could anyone direct me to where I change the short description length in category view? I have searched the forum without success. I have approx. 45 characters including spaces at the moment.

Regards
Mike
Title: Re: Change length of short description
Post by: aussiemike on September 18, 2012, 02:27:34 AM
I found it.

/public_html/components/com_virtuemart/views/category/tmpl

Line 256

<?php echo shopFunctionsF::limitStringByWord($product->product_s_desc40'...'?>

Change the 40 to whatever length you need the short description.

Title: Re: Change length of short description
Post by: Gingerweb on February 15, 2023, 14:24:18 PM
Can anyone tell me where this file is in VM 4 please?
I want to increase the length of the short description in category view
thanks
Title: Re: Change length of short description
Post by: jenkinhill on February 15, 2023, 15:19:33 PM
The limit is set in the database. The product_s_desc field in ###_virtuemart_products_en_gb  is set as varchar(2000)    

So the default capacity is 2000 characters. if you change the field to varchar(8000) then you would have 8000 characters, but this would revert to varchar(2000) on an update.
Title: Re: Change length of short description
Post by: GJC Web Design on February 15, 2023, 15:27:32 PM
when displayed it will be 

templates\xxxx\html\com_virtuemart\sublayouts\products.php
Title: Re: Change length of short description
Post by: jenkinhill on February 15, 2023, 16:25:56 PM
Ahh! I missed that you want this in category view. There the default length is set to 60 which obviously can be changed or your override.


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

Title: Re: Change length of short description
Post by: Gingerweb on February 15, 2023, 23:29:02 PM
Quote from: jenkinhill on February 15, 2023, 16:25:56 PM
Ahh! I missed that you want this in category view. There the default length is set to 60 which obviously can be changed or your override.


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



YES that is exactly what i wanted to do - perfect very many thanks guys !!