Get number of products of category for a Module

  • Posts: 5
  • Thank you received: 0
10 years 6 months ago #192392

-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.0

Hi, I have created a Module Tree Filter using html list and I put it in a HTML Custom module. This module will appear in products page. I want to know if there ir possible to put de number of products for each category, I mean, I already have the categories and products in Hikashop component, and I will put a link on each category of my Module tree. I have design this menu because I need to have First, Second and Third level of categories and subcategories. Could you help me please?

My module tree is like this:

By Application
- Oil
By Condition
- Oil Quick
By Type
- Truck
For Metal Manufacturing
- Industrial

...and I want that each category and subcategory show the number of product (as module content of hikashop does):

By Application (20)
- Oil (2)
By Condition (4)
- Oil Quick (8)
By Type (1)
- Truck (9)
For Metal Manufacturing (22)
- Industrial (2)


Thanks. I am getting crazy with that

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

  • Posts: 12953
  • Thank you received: 1778
10 years 6 months ago #192402

Hello,
If you have created your module using some custom HTML code, you'll have to manually enter your "number of product per category" on your custom HTML code.

Last edit: 10 years 6 months ago by Mohamed Thelji.

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

  • Posts: 2143
  • Thank you received: 747
10 years 6 months ago #192518

Hi,

While Mohamed is certainly right with his statement when considering "Joomla and HikaShop only", let me introduce you to NoNumber's "Sourcerer" . It's a sweet little extension enabling the fellow user to insert PHP and other code inside {source} tags - in Custom HTML modules, articles and elsewhere.

I'm using it for other purposes than HikaShop, but can confirm that it's simple and does its job perfectly well. All you need to do is insert the right PHP code once, and from then on the dynamic content will be displayed. Not to mention that the free version should have all the power you need for this task. Worth a try? ;)


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )

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

  • Posts: 5
  • Thank you received: 0
10 years 6 months ago #192544

Hello,

That is the thing. I do not know what is the php code to put in the custom module to call the number of products that a category has. I want to insert that line that i don't know in each list like this:

<li>category A (php code here to know how many products are in the category) </li>
<li>category B (php code here to know how many products are in the category) </li>
<li>category C (php code here to know how many products are in the category) </li>


Could you help me please???

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

  • Posts: 13201
  • Thank you received: 2322
10 years 6 months ago #192727

Hi,

I recommend to use the default HikaShop categories listing module, enable the option to display the number of products.
This module can be used as any other Joomla modules so, you can display it on a product page.
To display it only on the product page, you can use the extension "advanced module manager".

Then if you need to manage 3 category levels, in all cases it will require PHP code, and as it's a customization, we can't really help you on that. If you are not a developer, we recommend to post your request in the commercial jobs section of this forum.

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

Time to create page: 0.087 seconds
Powered by Kunena Forum