Display related product to a product variant

  • Posts: 1057
  • Thank you received: 11
  • Hikashop Business
8 years 6 months ago #239344

Hi! How can I display a related product to a product variant. I added a row manually in phpmyadmin but nothing.

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

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
8 years 6 months ago #239347

Hi,

The related products listing is displayed for the main product. There is no system in place to refresh the related products listing on the product page when you change the variant selected.
You would need to do several things to handle that:
1. Add custom HTML code in the product/show view file around the display of the module area at the bottom to have an id finishing with _main like the other areas in product/show_default
2. Add custom PHP code in the product/show view file to load the module area once for each variant while forcing the product_id to the id of the variant and adding HTML code around each with a specific id like done for the other areas in product/show
3. edit the file administrator/components/com_hikashop/types/characteristic.php and modify the javascript there to support the switch of the module area.
4. modify the components/com_hikashop/views/product/view.html.php file in the listing function to load the products based on the id of the variant and not the id of the main product when provided by your custom code in the product/show view file.

So for a developer, it's not a problem, but otherwise it's quite complex to do.

The following user(s) said Thank You: verzevoul

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

Time to create page: 0.051 seconds
Powered by Kunena Forum