Read More & Description Link in Category

  • Posts: 62
  • Thank you received: 0
9 years 11 months ago #214730

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

<?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 .= " … <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.

  • Posts: 84305
  • Thank you received: 13700
  • MODERATOR
9 years 11 months ago #214746

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:

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

  • Posts: 62
  • Thank you received: 0
9 years 11 months ago #214786

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.057 seconds
Powered by Kunena Forum