Skip to main content

Read More & Description Link in Category

More
11 years 2 weeks ago #214730 by ninjab
-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.0

HI there,

I am trying to work out how to get the read more to be a link to the product with this code below. Can someone please help to insert some code to get this to work?
Code:
<?php if(!empty($this->row->product_description)) : ?> <div id="hikashop_product_description_main_mini" class="hikashop_product_description_main_mini"> <?php $resume = substr((preg_replace('#<hr *id="system-readmore" */>.*#is','',$this->row->product_description)),0,350); if (!empty($this->row->product_description) && strlen($this->row->product_description)>350) $resume .= " &hellip; <a href='#description'>".JText::_('READ_MORE')."</a>"; echo JHTML::_('content.prepare',$resume); ?> </div> <?php endif; ?>

I know its this line here: $resume .= " &hellip; <a href='#description'>".JText::_('READ_MORE')."</a>";

But don't know what to put so that it works. Thanks a lot :)

Please Log in or Create an account to join the conversation.

More
11 years 2 weeks ago #214746 by nicolas
Hi,

It depends where you add it.
I suppose that it is in one of the listing_img* view files, and thus, you already have a $link variable defined with the link to the product page.
So you can do that:
Code:
$resume .= " … <a href='".$link."#description'>".JText::_('READ_MORE')."</a>";
The following user(s) said Thank You: ninjab

Please Log in or Create an account to join the conversation.

More
11 years 2 weeks ago #214786 by ninjab
Brilliant, you're a legend Nick. Works now. Many thanks :).

Please Log in or Create an account to join the conversation.

Time to create page: 0.180 seconds
Powered by Kunena Forum