- Posts: 16
- Thank you received: 0
How to add short description on product list?
-- Joomla version -- : 3.3.1
-- PHP version -- : 5.3.28
-- Browser(s) name and version -- : safari 7.0.6
I swear I have looked for a while in the forum but didn't find the answer. I have looked carefully on the tutorial, documentation, topics and bug reports...
On my main product list page I would like to display a short description of each product. (before the add to cart button)
Didn't find any option in the settings.
Do I have to hack the display files?
Or is it because I'm running the Starter version?
Thanks.
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
I have added the little hack in the listing_img_title file between end of product name and product price.
it displays 175 caracters from the regular description and replace last space by '...' and Read More.
you can manage class 'shortdesc' has you want.
I'm not pro so the hack can certainly be improved.
Please Log in or Create an account to join the conversation.
- Posts: 21
- Thank you received: 0
Im trying but didn´t get any result yet, just to confirm, you said in the liting_img_title but... from product, right?
cheers
Please Log in or Create an account to join the conversation.
Yes from product. But are you sure that you are using the "image and title" display type ?
You can check that in your menu / module settings.
www.hikashop.com/support/support/documen...ize-the-display.html
Please Log in or Create an account to join the conversation.
- Posts: 32
- Thank you received: 0
/components/com_hikashop/views/product/tmpl
Please Log in or Create an account to join the conversation.
- Posts: 21
- Thank you received: 0
I have "read more" enable in the shop, and a read more line in my product description...
is there anything else that needs to be changed? or just that...?
cheers!
Please Log in or Create an account to join the conversation.
- Posts: 21
- Thank you received: 0
I got it now!

Just one last question... is there anything I can do in that file just to get image 2 more similar to image 1?
like... image to the left.. name and short description in the center and price to the right?
Because squares in image 2 are too big..

thanks a lot for your help
Please Log in or Create an account to join the conversation.
You can edit the products listing menu/module via the menu Display>Content menus/modules and change the "type of layout" option to "table" and that should make it look similar.
Please Log in or Create an account to join the conversation.
- Posts: 21
- Thank you received: 0
Please Log in or Create an account to join the conversation.
If you want to add the description on the products listing with a table layout, here is a thread about that:
www.hikashop.com/forum/4-how-to/75263-us...-in-productlist.html
Please Log in or Create an account to join the conversation.
- Posts: 21
- Thank you received: 0
Please Log in or Create an account to join the conversation.
Phil wrote:
This might help others. It does the trick.
I have added the little hack in the listing_img_title file between end of product name and product price.
it displays 175 caracters from the regular description and replace last space by '...' and Read More.
you can manage class 'shortdesc' has you want.
I'm not pro so the hack can certainly be improved.
Code:<!-- description --> <div class="shortdesc"> <?php $maxLength = 175; $longDesc = $this->row->product_description; if (strlen($longDesc)>$maxLength){ $longDesc = substr($longDesc, 0, $maxLength); $position_espace = strrpos($longDesc, " "); $longDesc = substr($longDesc, 0, $position_espace); $longDesc = $longDesc." ... "; } echo $longDesc; echo '<a href="'.$link.'">Read more</a>'; ?> </div> <!-- EO description -->
I use this code
And it works great.
Is any way to strip html tags?
Now if there is <strong> tag in first scentence and if it not closed before character limit, all site from there is bold.
Please Log in or Create an account to join the conversation.
Change the line:
$longDesc = $this->row->product_description;
to:
$longDesc = strip_tags($this->row->product_description);
Please Log in or Create an account to join the conversation.