- Posts: 94
- Thank you received: 4
Modifying the product page modules
4 years 1 month ago #343902
by bfred
Modifying the product page modules was created by bfred
-- 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.
-- 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.
4 years 1 month ago #343904
by nicolas
Replied by nicolas on topic Modifying the product page modules
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:
This is the code displaying the "modules under the product page".
So you could add such line of code before to add some text:
where xx is the id of the module in the Joomla modules manager.
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:
Code:
echo JModuleHelper::renderModule($module);
So you could add such line of code before to add some text:
Code:
if($module->id == xx) {
$mainProductCategory = reset($this->categories);
echo 'also available from '. $mainProductCategory->category_name;
}
The following user(s) said Thank You: bfred
Please Log in or Create an account to join the conversation.
4 years 1 month ago #343951
by bfred
Replied by bfred on topic Modifying the product page modules
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.
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.
4 years 1 month ago #343955
by nicolas
Replied by nicolas on topic Modifying the product page modules
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
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.
4 years 1 month ago #343964
by bfred
Replied by bfred on topic Modifying the product page modules
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.
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.223 seconds