Pass category as a parameter to module

  • Posts: 639
  • Thank you received: 16
  • Hikashop Business
10 years 2 months ago #206647

-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.4.1

I want a Hikashop Content Module to show different categories depending on the product showing but I don't want to create 30 different modules one for each available category, so I would like to be able to invoke the module inside the show_default.php by passing a parameter to the module taken from a custom field.

Is this possible?

Would be something like a loadposition statement...

{loadhikamodule MyCustomizableModule this->row->category_type_for_CustomizableModule}

What you think? Should exist a trick...

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

  • Posts: 84304
  • Thank you received: 13699
  • MODERATOR
10 years 2 months ago #206650

Hi,

I don't know of such trick. It's possible, if you develop your own loadposition content tag plugin.

An easier solution would be to have different modules (one for each category) and specify the id of the module in a custom product field. Then, you could use the value of the field with a standard loadposition module in order to load the correct module.

The following user(s) said Thank You: PeterChain

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

  • Posts: 639
  • Thank you received: 16
  • Hikashop Business
10 years 2 months ago #206700

[quote="An easier solution would be to have different modules (one for each category) and specify the id of the module in a custom product field. Then, you could use the value of the field with a standard loadposition module in order to load the correct module.[/quote]

This is exactly what I do and what I want to avoid as there can be more than 50 categories so it means 50 modules to be made, but all of them look exactly the same except from the category shown.

So, this is exactly why I want the category parameter transferable through parametrization

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

  • Posts: 13201
  • Thank you received: 2322
10 years 2 months ago #206724

Hi,

So on a product page, you want to display a module listing categories in relation with the currently displayed product, right ?
I think that a good solution will be to edit the view used by the module, and in that view get the current CID of the displayed product and based on this information change the categories to display.

The following user(s) said Thank You: PeterChain

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

  • Posts: 639
  • Thank you received: 16
  • Hikashop Business
10 years 2 months ago #206817

This sounds interesting, I will consider this solution.

Thanks a lot!

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

Time to create page: 0.070 seconds
Powered by Kunena Forum