- Posts: 68
- Thank you received: 0
Extra short description on product page
12 years 11 months ago #126595
by kopretina
Extra short description on product page was created by kopretina
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.
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.
Please Log in or Create an account to join the conversation.
12 years 11 months ago #126606
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Extra short description on product page
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,
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.
Please Log in or Create an account to join the conversation.
12 years 11 months ago #128111
by kopretina
Replied by kopretina on topic Extra short description on product page
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?
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.
12 years 11 months ago #128180
by Xavier
Replied by Xavier on topic Extra short description on product page
Hi,
You have to customize the Regex.
Maybe something like that can work:
You have to customize the Regex.
Maybe something like that can work:
Code:
<?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.
12 years 11 months ago - 12 years 11 months ago #128207
by kopretina
Replied by kopretina on topic Extra short description on product page
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 ...
Warning: preg_replace() [function.preg-replace]: Compilation failed: nothing to repeat at offset 0 in /data/web ...
Last edit: 12 years 11 months ago by kopretina.
Please Log in or Create an account to join the conversation.
12 years 11 months ago #128214
by Xavier
Replied by Xavier on topic Extra short description on product page
Code:
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.
12 years 11 months ago #128218
by kopretina
Replied by kopretina on topic Extra short description on product page
Thank you Xavier. It is working perfectly.
Please Log in or Create an account to join the conversation.
Time to create page: 0.182 seconds