Can not hide intro-text in product details page

  • Posts: 18
  • Thank you received: 1
9 years 3 months ago #242229

After the installation of HikaShop in Joomla 351 the option "do not display the intro text into article view” does no longer work. This happens both in HikaShop and Joomla articles. In blog view it is ok, there I have intro text only, but in the product detail intro and full text are displayed without the possibility to hide the intro text. I need to only have the full text in product detail page.
I also noticed that putting the script {loadmodule...} in the intro text side, the inserted module does not work in blog view.
How resolve it?
Thanks for your help,
Yuri

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

  • Posts: 84313
  • Thank you received: 13702
  • MODERATOR
9 years 3 months ago #242240

Hi,

HikaShop has no influence on the display of Joomla articles.
So it's not possible that having HikaShop installed makes the Joomla articles not display properly.
And the "do not display the intro text into article view" of Joomla has no influence on how HikaShop display products.

HikaShop doesn't handle content tags before the read more tag on listings in order to reduce the amount of processing on listings.
If you to have them replaced, you'll have to edit the view file you're using on your listing of products, and change:

preg_replace('#<hr *id="system-readmore" */>.*#is', '', $this->row->product_description)
to:
JHTML::_('content.prepare',preg_replace('#<hr *id="system-readmore" */>.*#is', '', $this->row->product_description))
www.hikashop.com/support/documentation/1...-display.html#layout

And yes, HikaShop displays both the text before and after the readmore on the product page.
If you don't want that, you can edit the show_default view file and change the code:
echo JHTML::_('content.prepare',preg_replace('#<hr *id="system-readmore" */>#i','',$this->element->product_description));
to:
echo JHTML::_('content.prepare',preg_replace('#.*<hr *id="system-readmore" */>#is','',$this->element->product_description));

The following user(s) said Thank You: imcom

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

  • Posts: 18
  • Thank you received: 1
9 years 3 months ago #242759

Thank you very much!
I followed your instructions and it worked!

Last edit: 9 years 3 months ago by imcom.

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

  • Posts: 18
  • Thank you received: 1
9 years 2 months ago #243496

Hi Nicolas, I am back on the subject.
When I insert a custom module in the product detail page - this worked perfectly.
The same module does not working before sytem-readmore. I have more modules with SQL requests for display custom fields from
hikashop_product table before sytem-readmore, in my case this is the "listing_img_desc" front end view.
In the "intro text" (before sytem-readmore) work only the modules with simple html code, but with php does not work.
So, in the module i have: {source} <?php require_once JPATH_SITE.'/folder/sql.php'; ?> {/source}.
The php file contain SQL requests (JDatabase driver based) and this work without errors.

Can you help me to resolve it?

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

  • Posts: 84313
  • Thank you received: 13702
  • MODERATOR
9 years 2 months ago #243525

Hi,

Why do it like that ?
Why not directly put your script code in the module file directly ? There can be only one file in a module:
docs.joomla.org/J3.x:Creating_a_simple_m...oping_a_Basic_Module
In, fact you could directly call your sql script from the view file of HikaShop removing both the need for the content tag and the source code tag, making your page processing faster, and without the problem you have now.
That would simplify your setup and prevent that issue which must come from a processing order issue between the plugin replacing the module tags and the plugin replacing the source tags on your website (you could try changing the ordering of the plugins if you don't want to have a module).

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

  • Posts: 23
  • Thank you received: 0
9 years 2 months ago #243921

Hi Guys,

Is there an equivalent to this to hide the intro text on a category? I've put read mores into the category description and would like it to be hidden when actually in the category. See images for his it currently looks.

Aran

Attachments:

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

  • Posts: 84313
  • Thank you received: 13702
  • MODERATOR
9 years 2 months ago #243924

Hi,

Why not turn off the "show description" setting of your menu item ?
That will remove the description of the category at the top of the products listing , but you'll still have the description of the category that you added in the categories listing display.

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

  • Posts: 23
  • Thank you received: 0
9 years 2 months ago #243966

Hi Nicolas,

Turning off the Show Description hides the text after the read more too which I don't want to do. Basically I want the text before the read more to appear when I hoer over the category image (which currently works) and when I click on the image and go into the category have only the text below the read more showing. Currently I get both all the text above & below the read more showing.

Aran

Attachments:

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

  • Posts: 84313
  • Thank you received: 13702
  • MODERATOR
9 years 2 months ago #243970

Hi,

Ok, I understand now. Then you want to keep that option turned on, and instead edit the file "listing" of the view "category" for your frontend template via the menu Display>Views and change the line:

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

The following user(s) said Thank You: aran.gibbs

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

  • Posts: 23
  • Thank you received: 0
9 years 2 months ago #244017

Thank you Nicolas that worked like a charm.

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

Time to create page: 0.084 seconds
Powered by Kunena Forum