- Posts: 62
- Thank you received: 0
Read More & Description Link in Category
11 years 2 weeks ago #214730
by ninjab
Read More & Description Link in Category was created 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?
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
-- 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 .= " … <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.
11 years 2 weeks ago #214746
by nicolas
Replied by nicolas on topic Read More & Description Link in Category
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:
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.
11 years 2 weeks ago #214786
by ninjab
Replied by ninjab on topic Read More & Description Link in Category
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