Show categorys that have certain products attached

  • Posts: 5
  • Thank you received: 0
10 years 4 weeks ago #211790

-- HikaShop version -- : 2.4.0
-- Joomla version -- : 3.4.3

Hi,
It sounds easy enough, but I will try to explain what im trying to do.

I have MANY different products that ranges from oil to grease and cleaning.
All these products are well categorised.
I have also categorised the products into 3 other categories something like:
Products for the industry
Products for the food industry
Chemistry and cleaning

I cant just nest categories under the 3 categories, because many products in the food industry cant also be used in the regularly industry and so on.

The thing I want to do, is to have a way to show the categories that have products attached with for example the categori "Products for the industry".

I got it to work by showing all the products and not the categories.

I had a idea, that Tags on the products could be my solution, but I think it's only for Joomla search.

Any help is appreciated.
/Kim

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

  • Posts: 12953
  • Thank you received: 1778
10 years 4 weeks ago #211798

Hello Kim,

The thing I want to do, is to have a way to show the categories that have products attached with for example the categori "Products for the industry".

Then in that case, you should directly :
- Create an "Industry" unpublished category (if you don't want it to be displayed through your category listing
- Add that category the products that you want to be displayed through your product listing
- Use that category through the "" option of your product listing content menu/module via "Hikashop->Display->Views->Content menus/modules".

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

  • Posts: 5
  • Thank you received: 0
10 years 3 weeks ago #211899

Hi Mohamed
Many thanks for your reply.

I can't seem to follow you, because what you are describing sounds to me just like the standard way of showing a category with products. Or maby im just a bit to slow today.

Category 1 (Some of the products are also assigned Category Industry)
---Category 1.1
---Category 1.2 (Some of the products are also assigned Category Industry)
Category 2 (Some of the products are also assigned Category Industry)
---Category 2.1
---Category 2.2
Category 3 (Some of the products are also assigned Category Industry)
---Category 3.1 (Some of the products are also assigned Category Industry)
---Category 3.2
Category industry

Now. I hope you can see where i'm heading.
I want to display the categories that has products that is assigned to the industry category. And of cause some of the categories also have other products and I dont want them to show up.

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

  • Posts: 12953
  • Thank you received: 1778
10 years 3 weeks ago #211944

Hi,
My bad, I though that you wanted to display the products which were on the "Industry" category.

There is no option to do what you want, but the solution will be to directly use a category listing and also develop a plugin using the "onBeforeCategoryListingLoad" trigger which will enable to filter the categories regarding if they have products which are on the "Industry" category :

onBeforeCategoryListingLoad(&$filters)

This function will be triggered by HikaShop the categories are loaded in order to be displayed on categories listings on the front end and back end. The $filters variable will be an array of conditions which will then be combined in order to form the MySQL query which will be used to load the categories. That can enable you to change the way the categories are loaded on your website listings by adding or removing conditions on that query.

www.hikashop.com/support/documentation/6...eCategoryListingLoad

Note that some development skills will be required.

Last edit: 10 years 3 weeks ago by Mohamed Thelji.

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

  • Posts: 5
  • Thank you received: 0
10 years 3 weeks ago #212014

Hi,
Okay thanks. Maybe I can figure something out.

BR Kim

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

Time to create page: 0.048 seconds
Powered by Kunena Forum