how to use "Read more" in product page

  • Posts: 203
  • Thank you received: 7
4 years 5 months ago #324624

hi
is it possible use read more in the description of each product? i do some setting and can show read more in description editor but it not work and do nothing for me.
is there any way if i have many description about one product to brink that with something such as read more capability?
thank you

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

  • Posts: 4816
  • Thank you received: 654
  • MODERATOR
4 years 5 months ago #324641

Hello,

In order to better answer you, can you details your needs and your context.
Can you provide :
- Url to see the context
- Annotated screenshot
- Details if you just want a read more button to display the whole description or just cut the text in half, and so the read more button purpose is to display the end of the description ?...

We can invite you to proceed a search in our forum through using the following keyword like : Read more button
Awaiting news to progress on your subject.

Regards

Last edit: 4 years 5 months ago by Philip.

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

  • Posts: 203
  • Thank you received: 7
4 years 5 months ago #324685

hi
thank you for your reply
yes i want a read more button to display the whole description or just cut the text in half, and so the read more button purpose is to display the end of the description.

Attachments:
Last edit: 4 years 5 months ago by sadaf3d.

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

  • Posts: 4816
  • Thank you received: 654
  • MODERATOR
4 years 5 months ago #324690

Hello,

Follow me step by step to add this feature in your product description :
1. Have a look on this documentation to discover how to process with the HikaShop Override system.
2. Now go to customize your product/show_default, and the idea is to replace the description part, around line 195 :


3. Now in your folder view, YourWebsite\components\com_hikashop\views\product\tmpl, open the show_tabulat.php, or like previous via the product/show_tabular
4. Go around line 70, you will this :
...
	$this->setLayout('show_block_img');
	echo $this->loadTemplate();
?>
	<div id="hikashop_product_description_main_mini" class="hikashop_product_description_main_mini"><?php
		// DISPLAY the product description
		if(!empty($this->element->product_description)) {
			$function = 'mb_substr';
			if(!function_exists($function))
				$function = 'substr';
			$resume = $function(strip_tags(preg_replace('#<hr *id="system-readmore" */>.*#is','',$this->element->product_description)),0,300);
			if (!empty($this->element->product_description) && strlen($this->element->product_description)>300)
				$resume .= " ...<a href='#hikashop_show_tabular_description'>".JText::_('READ_MORE')."</a>";
			echo JHTML::_('content.prepare',$resume);
		}
	?></div>
<?php
	if(!empty...
In show_default, you have to replace the part that start with <div id="hikashop_product_description_main_min... and that finish with ?></div>

=> This part manage your description with in it by default a read more that cut to 300 characters, feel free to modify this parameters to better fit your needs.

Hope this will fit your needs.
Regards

Last edit: 4 years 5 months ago by Philip.

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

Time to create page: 0.067 seconds
Powered by Kunena Forum