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

How to Extend Short Product Description in Category View?

Started by MAD King, January 05, 2015, 22:45:47 PM

Previous topic - Next topic

MAD King

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
Joomla! 4.3.4
VirtueMart 4.2.4 10922

GJC Web Design

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

components\com_virtuemart\sublayouts\products.php
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

MAD King

Thank you very much. So, everything is now placed in the sublayouts folder?
Joomla! 4.3.4
VirtueMart 4.2.4 10922

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

MAD King

Joomla! 4.3.4
VirtueMart 4.2.4 10922

favdes

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  :)

jenkinhill

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.
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

dsrpmedia

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

mizu


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?

Studio 42

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 !

mizu

yes, figured it out. It's a template issue. I managed to achieve the desired layout by some override. All proper now.