Display Short description

  • Posts: 71
  • Thank you received: 0
  • Hikashop Business Hikashop Essential
7 years 8 months ago #277733

-- HikaShop version -- : 3.2.0
-- Joomla version -- : 3.7.5
-- PHP version -- : 5.6.30
-- Browser(s) name and version -- : Chrome 60

HI, I have followed this forum post - www.hikashop.com/forum/4-how-to/32677-sh...roduct-listings.html and I have my content before the Read More showing up in the Block_tags.php view perfect! - heat.colman.net.nz/oztent/product/1-oztent-rv-1

But, how can I adapt the regular description view to now NOT show the content BEFORE the Read More. I am happy to edit the View files, just need to know what to add please.

Regards, Nick

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

  • Posts: 83798
  • Thank you received: 13570
  • MODERATOR
7 years 8 months ago #277772

Hi,

To know which view file you need to edit, you can turn on the "display view files" setting of the HikaShop configuration. All the view files used will be displayed on the page so that you will know exactly what view file displays what.
In your case, I would say that it's either show_tabular or show_default that you'll want to edit.
The modification to do will be this one:
www.hikashop.com/support/forum/product-c...t-layout.html#172688

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

  • Posts: 71
  • Thank you received: 0
  • Hikashop Business Hikashop Essential
7 years 8 months ago #277810

Hi, I have replaced the code as per the post but the short description remains. I am in the right place as I added a test class and I can see this in the inspector.
URL : heat.colman.net.nz/oztent/product/1-oztent-rv-1
Code Added/Altered -
<div id="hikashop_product_description_main" class="hikashop_product_description_main nick" itemprop="description"><?php
echo JHTML::_('content.prepare',preg_replace('#.*<hr *id="system-readmore" */>#i','',$this->element->product_description));
?></div>


Result - still shows the short description (content pre-Read More). Post ReadMore works well

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

  • Posts: 83798
  • Thank you received: 13570
  • MODERATOR
7 years 8 months ago #277840

Hi,

Well, I don't see why it wouldn't work.
Maybe the regex needs to be adapted because of the way the text in the description is.
Maybe try to add the flag "s" to your regex:

echo JHTML::_('content.prepare',preg_replace('#.*<hr *id="system-readmore" */>#is','',$this->element->product_description));

Alternatively and simpler would be to use a custom product field to add the images on the right side of the product page.
That way on the product edition page, you'll have 2 distinct fields, one for the description, one for the right side images area.

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

  • Posts: 71
  • Thank you received: 0
  • Hikashop Business Hikashop Essential
7 years 8 months ago #277899

Thanks the code above did the trick. I did look into the Buiness Edition as an option, but the read more way will be sufficient for now. Thanks again, Nick

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

Time to create page: 0.061 seconds
Powered by Kunena Forum