descrtiption before readmore on product table list

  • Posts: 20
  • Thank you received: 2
11 years 5 months ago #151072

-- url of the page with the problem -- : vlaspo-dev.dyndns-server.com/air-learnin...gory/17-engelen.html
-- HikaShop version -- : 2.3.0
-- Joomla version -- : 3.2.2
-- PHP version -- : 5.5.10

I want to place the a description on the product listing table.
I have add the

<?php echo $this->row->product_description; ?>

but now i see the full description and want to show only before the read-more line

I have tried this
<?php echo JHTML::_('content.prepare',preg_replace('#<hr *id="system-readmore" */>#i','',$this->element->product_description)); ?>
but with no luck..

can someone help me?
this is part of the listing-table.php
<td class="hikashop_product_name_row">
						<span class="hikashop_product_name">
							<?php if($this->params->get('link_to_product_page',1)){ ?>
								<a href="<?php echo $link;?>">
							<?php }
								echo $this->row->product_name;
							if($this->params->get('link_to_product_page',1)){ ?>
								</a>
							<?php } ?>
						</span>
						<?php if(!empty($this->row->extraData->afterProductName)) { echo implode("\r\n",$this->row->extraData->afterProductName); } ?>
						<?php echo JHTML::_('content.prepare',preg_replace('#<hr *id="system-readmore" */>#i','',$this->element->product_description)); ?>
					</td>

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

  • Posts: 13201
  • Thank you received: 2322
11 years 5 months ago #151165

Hi,

In the second code, you use $this->element instead of $this->row.

<?php echo substr(strip_tags(preg_replace('#<hr *id="system-readmore" */>.*#is','',$this->row->product_description)),0,300); ?>

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

Time to create page: 0.070 seconds
Powered by Kunena Forum