Extra short description on product page

  • Posts: 68
  • Thank you received: 0
11 years 1 month ago #126595

Hi,

I would like to know if there exist any way, how to add an extra short description to the product page and will be always unique for each product.
This short text should appeare in the product listing in category.

I know now it is possible to use the <hr> to put the text, which shoul appeare in category.
But our klient ask to have extra short text, which is not the part of the desrtiption.

The example is her: dpm-images.fr/photo/43-leica-set-macro-e...category_pathway-132
The short text is marked at the picture in attachement.

Attachments:

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

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
11 years 1 month ago #126606

Hi,

That you are pointing is a product custom field. It allow to create new "columns" for your products with a specific type (text, date, list..).
You can add a "text product custom field" and modify your product listing view in order to display this custom field.

You can also use the product description with the "read more" separator and edit the product page view in order to not display the begin of the description (before the "read more" tag separator). So you will have two different descriptions in a single field.

Product custom fields required a commercial version of HikaShop. It gives you a good flexibility but it is possible for your case, to it without.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 68
  • Thank you received: 0
11 years 1 month ago #128111

Hi,

I have put the "read more" tag into the description of the product. The part, whis is before (intro text) is displayed in the category listing as should be, but is also visible in the detail of product page. I don´t want to display this part on the detail of the product page.
How can I correct the code in "show_default" to do this?

Now is there this code:

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

Could you help me with this?

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

  • Posts: 13201
  • Thank you received: 2322
11 years 1 month ago #128180

Hi,

You have to customize the Regex.
Maybe something like that can work:

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

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

  • Posts: 68
  • Thank you received: 0
11 years 1 month ago #128207

I use the code a have the warning code on the product page:

Warning: preg_replace() [function.preg-replace]: Compilation failed: nothing to repeat at offset 0 in /data/web ...

Last edit: 11 years 1 month ago by kopretina.

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

  • Posts: 13201
  • Thank you received: 2322
11 years 1 month ago #128214

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

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

  • Posts: 68
  • Thank you received: 0
11 years 1 month ago #128218

Thank you Xavier. It is working perfectly.

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

Time to create page: 0.074 seconds
Powered by Kunena Forum