Modifying the product page modules

  • Posts: 94
  • Thank you received: 4
1 year 7 months ago #343902

-- HikaShop version -- : 4.6.0
-- Joomla version -- : 4.1.5
-- PHP version -- : 7.4
-- Browser(s) name and version -- : Firefox 103.0.2

Hi!
Thanks a lot for all the previous answers. In fact I am in the process of customizing 'my Hikashop' display with a Joomla! template which doesn't really matches and I'm getting there.
I have managed to add category name under the product name in the product page (though "category" is hardcoded and I need to use the proper translatable term for that), thanks to some code previously posted in the forum a few years back.

I also added a module with other products from the same category below my product display. I would like to actually add something before the category name, like "also available from..." or "more from..." and the category name.
Where do I need to look to achieve that, and in which translatable file should I incorporate that text? I guess hikashop ones get overwritten by updates.

Thank you again for your help.

As a more in depth question do you have some general documentation to make a Hikashop template?

Thank you.

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

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
1 year 7 months ago #343904

Hi

The module will be displayed in the view file product / show , so I would recommend editing that view file via the menu Display>Views to add your text.
There, near the end of the view file, you can find that code:

echo JModuleHelper::renderModule($module);
This is the code displaying the "modules under the product page".
So you could add such line of code before to add some text:
if($module->id == xx) {
 $mainProductCategory = reset($this->categories);
 echo 'also available from '.  $mainProductCategory->category_name;
}
where xx is the id of the module in the Joomla modules manager.

The following user(s) said Thank You: bfred

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

  • Posts: 94
  • Thank you received: 4
1 year 7 months ago #343951

Yes! Thank you very much. So I have my line of text appearing thanks to you but the module title (the category in my case) also appears below in h2 format. I tried editing the module but didn't find any option to remove that title.. or I could use CSS?

What would be your approach in that case then?
Thank you either way, super helpful.

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

  • Posts: 81361
  • Thank you received: 13037
  • MODERATOR
1 year 7 months ago #343955

Hi,

If you edit the module in the Joomla modules manager, you have a "show title" setting that you can turn off:
i.imgur.com/wCrWnzx.png

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

  • Posts: 94
  • Thank you received: 4
1 year 7 months ago #343964

Thank you. That didn't seem to work on my site though. I'll do a css display none for now, I think it's faster for everyone :-)
Thank you.

The following user(s) said Thank You: Philip

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

Time to create page: 0.078 seconds
Powered by Kunena Forum