[Skip to main content](#vessel-content)

#   Content Module Product Number

##

- **[natselection](/forum/user/4560-natselection "View natselection's Profile")**
- [![natselection's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4560-natselection "View natselection's Profile") Topic Author
- [ Offline](/forum/user/4560-natselection)

Less More

- Posts: 59
- Thank you received: 2
-
- [](http://nswd.co)
-

8 years 1 month ago [\#299710](#299710) by [natselection](/forum/user/4560-natselection "View natselection's Profile")  *[Content Module Product Number](/forum/26-product-category-display/896080-content-module-product-number#299710 "-- HikaShop version -- : 3.5.1 -- Joomla version -- : 3.8.13 -- PHP version -- : 7.2 -- Browser(s) name and version -- : All  We're using the content module to display a grid of categories. In the module settings we have Product number set to Yes to show the number of products in each category. It appears that it counts each product and each variant. Is it possible to exclude variants from being counted?")* was created by *[natselection](/forum/user/4560-natselection "View natselection's Profile")*

-- HikaShop version -- : 3.5.1
-- Joomla version -- : 3.8.13
-- PHP version -- : 7.2
-- Browser(s) name and version -- : All

We're using the content module to display a grid of categories. In the module settings we have Product number set to Yes to show the number of products in each category. It appears that it counts each product and each variant. Is it possible to exclude variants from being counted?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTYwODAtY29udGVudC1tb2R1bGUtcHJvZHVjdC1udW1iZXI/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86584
- Thank you received: 14325
-
-

8 years 4 weeks ago [\#299732](#299732) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Content Module Product Number](/forum/26-product-category-display/896080-content-module-product-number#299732 "-- HikaShop version -- : 3.5.1 -- Joomla version -- : 3.8.13 -- PHP version -- : 7.2 -- Browser(s) name and version -- : All  We're using the content module to display a grid of categories. In the module settings we have Product number set to Yes to show the number of products in each category. It appears that it counts each product and each variant. Is it possible to exclude variants from being counted?")*

Hi,

The count is done based on the link between the elements in the hikashop_product_category table.
Through the interface of HikaShop, it's normally impossible to add entries in that table for variants (since variants don't have a "categories" setting).
However, if there was some custom plugin, or maybe some weird mass action, or maybe some wrongly configured CSV import, it might be possible to have such entry in the hikashop_product_category table, which would explain why variants are counted.
But again, normally, it shouldn't happen.
Could you check the entries in that table through your phpmyadmin ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTYwODAtY29udGVudC1tb2R1bGUtcHJvZHVjdC1udW1iZXI/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[natselection](/forum/user/4560-natselection "View natselection's Profile")**
- [![natselection's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4560-natselection "View natselection's Profile") Topic Author
- [ Offline](/forum/user/4560-natselection)

Less More

- Posts: 59
- Thank you received: 2
-
- [](http://nswd.co)
-

8 years 4 weeks ago -  8 years 4 weeks ago [\#299755](#299755) by [natselection](/forum/user/4560-natselection "View natselection's Profile")  Replied by *[natselection](/forum/user/4560-natselection "View natselection's Profile")* on topic *[Content Module Product Number](/forum/26-product-category-display/896080-content-module-product-number#299755 "-- HikaShop version -- : 3.5.1 -- Joomla version -- : 3.8.13 -- PHP version -- : 7.2 -- Browser(s) name and version -- : All  We're using the content module to display a grid of categories. In the module settings we have Product number set to Yes to show the number of products in each category. It appears that it counts each product and each variant. Is it possible to exclude variants from being counted?")*

Ok, I did some digging and here's what I found...

It's counting incorrectly for a few categories, not all. For example:
Current counts show
Vehicles lifts (90)
Shop Equipment (6)
Other (65)

Actual count should be:
Vehicles lifts (30)
Shop Equipment (3)
Other (31)

If I look at the category "Shop Equipment" which has a category_id of 13:

[ topsecretequipment.com/](https://topsecretequipment.com/)
[ ![400 ](https://i.nswd.co/Top_Secret_Equipment_-_Home_218611C8.png) ](https://i.nswd.co/Top_Secret_Equipment_-_Home_218611C8.png "400 ")

There are only 3 products in that category:
[ topsecretequipment.com/categories/vehicl.../13-k-shop-equipment](https://topsecretequipment.com/categories/vehicle-lifts/product/listing/13-k-shop-equipment)
[ ![400 ](https://i.nswd.co/Top_Secret_Equipment_-_Vehicle_Lifts_218611E0.png) ](https://i.nswd.co/Top_Secret_Equipment_-_Vehicle_Lifts_218611E0.png "400 ")

If I query the hikashop_product_category table to see what's in there for category_id=13 it only returns the three products:
[ ![400 ](https://i.nswd.co/shared_nswdllc_com___localhost___harrettp_equipment___ehz2e_hikashop_product_category___phpMyAdmin_4_8_3_21861241.png) ](https://i.nswd.co/shared_nswdllc_com___localhost___harrettp_equipment___ehz2e_hikashop_product_category___phpMyAdmin_4_8_3_21861241.png "400 ")

So somewhere it's not counting properly and I can't find anything obvious that could be the cause.

Last edit: 8 years 4 weeks ago by [natselection](/forum/user/4560-natselection "View natselection's Profile"). Reason: Fixed image

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTYwODAtY29udGVudC1tb2R1bGUtcHJvZHVjdC1udW1iZXI/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86584
- Thank you received: 14325
-
-

8 years 4 weeks ago [\#299765](#299765) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Content Module Product Number](/forum/26-product-category-display/896080-content-module-product-number#299765 "-- HikaShop version -- : 3.5.1 -- Joomla version -- : 3.8.13 -- PHP version -- : 7.2 -- Browser(s) name and version -- : All  We're using the content module to display a grid of categories. In the module settings we have Product number set to Yes to show the number of products in each category. It appears that it counts each product and each variant. Is it possible to exclude variants from being counted?")*

Hi,

Could it be that these 3 products are in several categories ? Do these products have variants ?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTYwODAtY29udGVudC1tb2R1bGUtcHJvZHVjdC1udW1iZXI/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[natselection](/forum/user/4560-natselection "View natselection's Profile")**
- [![natselection's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4560-natselection "View natselection's Profile") Topic Author
- [ Offline](/forum/user/4560-natselection)

Less More

- Posts: 59
- Thank you received: 2
-
- [](http://nswd.co)
-

8 years 4 weeks ago [\#299782](#299782) by [natselection](/forum/user/4560-natselection "View natselection's Profile")  Replied by *[natselection](/forum/user/4560-natselection "View natselection's Profile")* on topic *[Content Module Product Number](/forum/26-product-category-display/896080-content-module-product-number#299782 "-- HikaShop version -- : 3.5.1 -- Joomla version -- : 3.8.13 -- PHP version -- : 7.2 -- Browser(s) name and version -- : All  We're using the content module to display a grid of categories. In the module settings we have Product number set to Yes to show the number of products in each category. It appears that it counts each product and each variant. Is it possible to exclude variants from being counted?")*

Yes, they are in multiple categories.

For example the Shop Equipment category that is showing 6, all of those are in nested categories:

Shop Equipment
-Frame Benches (2)
-Rotisseries (1)

They also all have 2 variants.

I just tried removing a category from one and the count decreased by one. So it is indeed caused by being in multiple categories that are nested. I would think they they really only should be counted once, no matter the category assignments. We have some menu items that show the parent category list of products, as well as a few that show just a subcategory list of products so removing the parent category woulnd't be optimal.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTYwODAtY29udGVudC1tb2R1bGUtcHJvZHVjdC1udW1iZXI/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86584
- Thank you received: 14325
-
-

8 years 4 weeks ago [\#299787](#299787) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Content Module Product Number](/forum/26-product-category-display/896080-content-module-product-number#299787 "-- HikaShop version -- : 3.5.1 -- Joomla version -- : 3.8.13 -- PHP version -- : 7.2 -- Browser(s) name and version -- : All  We're using the content module to display a grid of categories. In the module settings we have Product number set to Yes to show the number of products in each category. It appears that it counts each product and each variant. Is it possible to exclude variants from being counted?")*

Hi,

Normally, in such case, you would change the "sub element filter" setting to "all sub elements" under the "products options" tab of the menu item showing the parent cartegory list of products.
That way, even without the product in the parent category, it would still display the product in that parent menu while counting it only once.
The goal of counting the product once per category is that suppose that you have categories like that:
main cat 1
- sub cat 1
- sub cat 2
main cat 2
And that you have one product which is in both sub cat 1 and sub cat 2.
When you are on the listing of main cat 1 and and main cat 2, you want to display the count "2" because when you open that category, you want to have the count "1" for both sub cat 1 and sub cat 2.
I hope you can see what I mean.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTYwODAtY29udGVudC1tb2R1bGUtcHJvZHVjdC1udW1iZXI/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[natselection](/forum/user/4560-natselection "View natselection's Profile")**
- [![natselection's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4560-natselection "View natselection's Profile") Topic Author
- [ Offline](/forum/user/4560-natselection)

Less More

- Posts: 59
- Thank you received: 2
-
- [](http://nswd.co)
-

8 years 3 weeks ago [\#299842](#299842) by [natselection](/forum/user/4560-natselection "View natselection's Profile")  Replied by *[natselection](/forum/user/4560-natselection "View natselection's Profile")* on topic *[Content Module Product Number](/forum/26-product-category-display/896080-content-module-product-number#299842 "-- HikaShop version -- : 3.5.1 -- Joomla version -- : 3.8.13 -- PHP version -- : 7.2 -- Browser(s) name and version -- : All  We're using the content module to display a grid of categories. In the module settings we have Product number set to Yes to show the number of products in each category. It appears that it counts each product and each variant. Is it possible to exclude variants from being counted?")*

I think I understand what you mean. I'll give it a try but I suspect I may end up running into a new issue with how we have custom fields setup for product specifications that are different based on category.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTYwODAtY29udGVudC1tb2R1bGUtcHJvZHVjdC1udW1iZXI/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86584
- Thank you received: 14325
-
-

8 years 3 weeks ago [\#299844](#299844) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Content Module Product Number](/forum/26-product-category-display/896080-content-module-product-number#299844 "-- HikaShop version -- : 3.5.1 -- Joomla version -- : 3.8.13 -- PHP version -- : 7.2 -- Browser(s) name and version -- : All  We're using the content module to display a grid of categories. In the module settings we have Product number set to Yes to show the number of products in each category. It appears that it counts each product and each variant. Is it possible to exclude variants from being counted?")*

Hi,

Normally, if the category attached to the product is outside of the category tree of the menu item, it shouldn't be taken into account.
So it should be possible to link the products to the custom fields through the categories, either directly if the custom fields-product links follow your category structure, or with categories outside of the browsable category structure.

Note also that for a custom product field, even if you don't restrict it to categories/products, it will only appear on the product page on the frontend if you set something in it. If you leave the field empty, it won't appear.
So the restriction on the categories/products for the custom product fields is more of an aid for the setup of the products in the backend than something useful on the frontend.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTYwODAtY29udGVudC1tb2R1bGUtcHJvZHVjdC1udW1iZXI/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[natselection](/forum/user/4560-natselection "View natselection's Profile")**
- [![natselection's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4560-natselection "View natselection's Profile") Topic Author
- [ Offline](/forum/user/4560-natselection)

Less More

- Posts: 59
- Thank you received: 2
-
- [](http://nswd.co)
-

8 years 3 weeks ago [\#299965](#299965) by [natselection](/forum/user/4560-natselection "View natselection's Profile")  Replied by *[natselection](/forum/user/4560-natselection "View natselection's Profile")* on topic *[Content Module Product Number](/forum/26-product-category-display/896080-content-module-product-number#299965 "-- HikaShop version -- : 3.5.1 -- Joomla version -- : 3.8.13 -- PHP version -- : 7.2 -- Browser(s) name and version -- : All  We're using the content module to display a grid of categories. In the module settings we have Product number set to Yes to show the number of products in each category. It appears that it counts each product and each variant. Is it possible to exclude variants from being counted?")*

I ended up just pulling all of the subcategories out into a flat list of categories. That turned out to be the only combination with our setup that worked across the different features without causing issues somewhere else.

Thanks for the help Nicolas.

The following user(s) said Thank You: [Philip](/forum/user/34318-philip "View Philip's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI2LXByb2R1Y3QtY2F0ZWdvcnktZGlzcGxheS84OTYwODAtY29udGVudC1tb2R1bGUtcHJvZHVjdC1udW1iZXI/dG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.079 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
