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

#   Incorrect "number of products"

##

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

Less More

- Posts: 8
- Thank you received: 0
-
-

14 years 6 months ago [\#47519](#47519) by [pjaaar](/forum/user/7158-pjaaar "View pjaaar's Profile")  *[Incorrect "number of products"](/forum/3-bug-report/47519-incorrect-number-of-products#47519 "Hi,  Joomla version: 2.5.4 HikaShop version: 1.5.7  Here is the catalogue structure I use:  Category 1 -- Category 1.1 -- Category 1.1.1 (5 products here) -- Category 1.1.2 (5 products here) -- Category 1.2 -- Category 2.1.1 (5 products here) -- Category 2.1.2 (5 products here)  I got an incorrect number of products at the first level (I'm talking about a category listing), I got this:  Category 1 (0) -- Category 1.1 (0) -- Category 1.2 (0)  Finally, at a second level, I got correct results:  Category 1.1 (10) -- Category 1.1.1 (5) -- Category 1.1.2 (5)  How can I change the query to make that the number of products across the categories is correct?  Sry for ma bad language,  Thx in advance")* was created by *[pjaaar](/forum/user/7158-pjaaar "View pjaaar's Profile")*

Hi,

Joomla version: 2.5.4
HikaShop version: 1.5.7

Here is the catalogue structure I use:

Category 1
-- Category 1.1
-- Category 1.1.1 (5 products here)
-- Category 1.1.2 (5 products here)
-- Category 1.2
-- Category 2.1.1 (5 products here)
-- Category 2.1.2 (5 products here)

I got an incorrect number of products at the first level (I'm talking about a category listing), I got this:

Category 1 (0)
-- Category 1.1 (0)
-- Category 1.2 (0)

Finally, at a second level, I got correct results:

Category 1.1 (10)
-- Category 1.1.1 (5)
-- Category 1.1.2 (5)

How can I change the query to make that the number of products across the categories is correct?

Sry for ma bad language,

Thx in advance

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC80NzUxOS1pbmNvcnJlY3QtbnVtYmVyLW9mLXByb2R1Y3RzP3RtcGw9bWFya2Rvd24=) 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: 86363
- Thank you received: 14296
-
-

14 years 6 months ago [\#47681](#47681) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Incorrect "number of products"](/forum/3-bug-report/47519-incorrect-number-of-products#47681 "Hi,  Joomla version: 2.5.4 HikaShop version: 1.5.7  Here is the catalogue structure I use:  Category 1 -- Category 1.1 -- Category 1.1.1 (5 products here) -- Category 1.1.2 (5 products here) -- Category 1.2 -- Category 2.1.1 (5 products here) -- Category 2.1.2 (5 products here)  I got an incorrect number of products at the first level (I'm talking about a category listing), I got this:  Category 1 (0) -- Category 1.1 (0) -- Category 1.2 (0)  Finally, at a second level, I got correct results:  Category 1.1 (10) -- Category 1.1.1 (5) -- Category 1.1.2 (5)  How can I change the query to make that the number of products across the categories is correct?  Sry for ma bad language,  Thx in advance")*

Hi,

Try to download again the package from our website and install it again over your current hikashop. We made some changes which should avoid that.
If that doesn't solve the problem, please provide more information on how to reproduce the problem like screenshots of the options of your module/menu.

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

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

Less More

- Posts: 8
- Thank you received: 0
-
-

14 years 6 months ago [\#47822](#47822) by [pjaaar](/forum/user/7158-pjaaar "View pjaaar's Profile")  Replied by *[pjaaar](/forum/user/7158-pjaaar "View pjaaar's Profile")* on topic *[Re: Incorrect "number of products"](/forum/3-bug-report/47519-incorrect-number-of-products#47822 "Hi,  Joomla version: 2.5.4 HikaShop version: 1.5.7  Here is the catalogue structure I use:  Category 1 -- Category 1.1 -- Category 1.1.1 (5 products here) -- Category 1.1.2 (5 products here) -- Category 1.2 -- Category 2.1.1 (5 products here) -- Category 2.1.2 (5 products here)  I got an incorrect number of products at the first level (I'm talking about a category listing), I got this:  Category 1 (0) -- Category 1.1 (0) -- Category 1.2 (0)  Finally, at a second level, I got correct results:  Category 1.1 (10) -- Category 1.1.1 (5) -- Category 1.1.2 (5)  How can I change the query to make that the number of products across the categories is correct?  Sry for ma bad language,  Thx in advance")*

Ok, thank you for your attention but my pb isn't solved.

In attachment #1 there is my products structure, there is no product in "POS" or "Industriel" but there are some products in "Câblé" or "Sans fil"

attachments #2 &amp; #3 are what I currently see in front end

[ ![ss1.png](/forum/attachment/3585) ](/forum/attachment/3585 "ss1.png")

[ ![ss2.png](/forum/attachment/3586) ](/forum/attachment/3586 "ss2.png")

[ ![ss3.png](/forum/attachment/3587) ](/forum/attachment/3587 "ss3.png")

[ ![ss4.png](/forum/attachment/3588) ](/forum/attachment/3588 "ss4.png")

[ ![ss5.png](/forum/attachment/3589) ](/forum/attachment/3589 "ss5.png")

- [ ![ss1.png](/forum/attachment/3585) ](/forum/attachment/3585 "ss1.png") [ ](/forum/attachment/3585?download=1 "ss1.png")
- [ ![ss2.png](/forum/attachment/3586) ](/forum/attachment/3586 "ss2.png") [ ](/forum/attachment/3586?download=1 "ss2.png")
- [ ![ss3.png](/forum/attachment/3587) ](/forum/attachment/3587 "ss3.png") [ ](/forum/attachment/3587?download=1 "ss3.png")
- [ ![ss4.png](/forum/attachment/3588) ](/forum/attachment/3588 "ss4.png") [ ](/forum/attachment/3588?download=1 "ss4.png")
- [ ![ss5.png](/forum/attachment/3589) ](/forum/attachment/3589 "ss5.png") [ ](/forum/attachment/3589?download=1 "ss5.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC80NzUxOS1pbmNvcnJlY3QtbnVtYmVyLW9mLXByb2R1Y3RzP3RtcGw9bWFya2Rvd24=) 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: 86363
- Thank you received: 14296
-
-

14 years 6 months ago [\#47940](#47940) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Incorrect "number of products"](/forum/3-bug-report/47519-incorrect-number-of-products#47940 "Hi,  Joomla version: 2.5.4 HikaShop version: 1.5.7  Here is the catalogue structure I use:  Category 1 -- Category 1.1 -- Category 1.1.1 (5 products here) -- Category 1.1.2 (5 products here) -- Category 1.2 -- Category 2.1.1 (5 products here) -- Category 2.1.2 (5 products here)  I got an incorrect number of products at the first level (I'm talking about a category listing), I got this:  Category 1 (0) -- Category 1.1 (0) -- Category 1.2 (0)  Finally, at a second level, I got correct results:  Category 1.1 (10) -- Category 1.1.1 (5) -- Category 1.1.2 (5)  How can I change the query to make that the number of products across the categories is correct?  Sry for ma bad language,  Thx in advance")*

Please change the file administrator/components/com_hikashop/classes/category.php by the one in the archive enclosed and it should solve the problem.

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

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

Less More

- Posts: 8
- Thank you received: 0
-
-

14 years 6 months ago [\#47981](#47981) by [pjaaar](/forum/user/7158-pjaaar "View pjaaar's Profile")  Replied by *[pjaaar](/forum/user/7158-pjaaar "View pjaaar's Profile")* on topic *[Re: Incorrect "number of products"](/forum/3-bug-report/47519-incorrect-number-of-products#47981 "Hi,  Joomla version: 2.5.4 HikaShop version: 1.5.7  Here is the catalogue structure I use:  Category 1 -- Category 1.1 -- Category 1.1.1 (5 products here) -- Category 1.1.2 (5 products here) -- Category 1.2 -- Category 2.1.1 (5 products here) -- Category 2.1.2 (5 products here)  I got an incorrect number of products at the first level (I'm talking about a category listing), I got this:  Category 1 (0) -- Category 1.1 (0) -- Category 1.2 (0)  Finally, at a second level, I got correct results:  Category 1.1 (10) -- Category 1.1.1 (5) -- Category 1.1.2 (5)  How can I change the query to make that the number of products across the categories is correct?  Sry for ma bad language,  Thx in advance")*

First, thx a lot for your help, the pb still not resolved ![:unsure:](/media/kunena/emoticons/18.png ":unsure:")

Here is the reality in the back end:

Category 1: 0 object
Category 1.1: 0 object
Category 1.1.1: 1 object
Category 1.1.2: 2 objects
Category 1.2: 0 object
Category 1.2.1: 18 objects
Category 1.2.2: 8 objects
Category 2: 15 objects
Category 2.1: 4 objects

With the version 1 of category.php I had these results in the front end:

First level:
Category 1: 0 object (wrong)
Category 1.1: 0 object (wrong)
Category 1.2: 0 object (wrong)
Category 2: 19 objects (correct)
Category 2.1: 4 objects (correct)

Second levels are fine.

With the version 2 of category.php I had these results:

First level:
Category 1: 0 object (wrong)
Category 2: 19 objects (correct)
Category 2.1: 4 objects (correct)

Second levels are fine.

I want:

First level:
Category 1: 29 objects (count of all products in sub categories...)
Category 1.1: 3 object
Category 1.2: 26 object
Category 2: 19 objects
Category 2.1: 4 objects

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC80NzUxOS1pbmNvcnJlY3QtbnVtYmVyLW9mLXByb2R1Y3RzP3RtcGw9bWFya2Rvd24=) 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: 86363
- Thank you received: 14296
-
-

14 years 6 months ago [\#48031](#48031) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Incorrect "number of products"](/forum/3-bug-report/47519-incorrect-number-of-products#48031 "Hi,  Joomla version: 2.5.4 HikaShop version: 1.5.7  Here is the catalogue structure I use:  Category 1 -- Category 1.1 -- Category 1.1.1 (5 products here) -- Category 1.1.2 (5 products here) -- Category 1.2 -- Category 2.1.1 (5 products here) -- Category 2.1.2 (5 products here)  I got an incorrect number of products at the first level (I'm talking about a category listing), I got this:  Category 1 (0) -- Category 1.1 (0) -- Category 1.2 (0)  Finally, at a second level, I got correct results:  Category 1.1 (10) -- Category 1.1.1 (5) -- Category 1.1.2 (5)  How can I change the query to make that the number of products across the categories is correct?  Sry for ma bad language,  Thx in advance")*

Sure I understand what you want. We don't have the problem anymore on our end with that file.
Are you sure that you uploaded it properly on your website ?

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

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

Less More

- Posts: 8
- Thank you received: 0
-
-

14 years 6 months ago [\#49136](#49136) by [pjaaar](/forum/user/7158-pjaaar "View pjaaar's Profile")  Replied by *[pjaaar](/forum/user/7158-pjaaar "View pjaaar's Profile")* on topic *[Re: Incorrect "number of products"](/forum/3-bug-report/47519-incorrect-number-of-products#49136 "Hi,  Joomla version: 2.5.4 HikaShop version: 1.5.7  Here is the catalogue structure I use:  Category 1 -- Category 1.1 -- Category 1.1.1 (5 products here) -- Category 1.1.2 (5 products here) -- Category 1.2 -- Category 2.1.1 (5 products here) -- Category 2.1.2 (5 products here)  I got an incorrect number of products at the first level (I'm talking about a category listing), I got this:  Category 1 (0) -- Category 1.1 (0) -- Category 1.2 (0)  Finally, at a second level, I got correct results:  Category 1.1 (10) -- Category 1.1.1 (5) -- Category 1.1.2 (5)  How can I change the query to make that the number of products across the categories is correct?  Sry for ma bad language,  Thx in advance")*

Yeah I'm pretty sure ![:)](/media/kunena/emoticons/3.png ":)")

Can u tell me what modifications you made?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC80NzUxOS1pbmNvcnJlY3QtbnVtYmVyLW9mLXByb2R1Y3RzP3RtcGw9bWFya2Rvd24=) 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: 86363
- Thank you received: 14296
-
-

14 years 6 months ago [\#49209](#49209) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Incorrect "number of products"](/forum/3-bug-report/47519-incorrect-number-of-products#49209 "Hi,  Joomla version: 2.5.4 HikaShop version: 1.5.7  Here is the catalogue structure I use:  Category 1 -- Category 1.1 -- Category 1.1.1 (5 products here) -- Category 1.1.2 (5 products here) -- Category 1.2 -- Category 2.1.1 (5 products here) -- Category 2.1.2 (5 products here)  I got an incorrect number of products at the first level (I'm talking about a category listing), I got this:  Category 1 (0) -- Category 1.1 (0) -- Category 1.2 (0)  Finally, at a second level, I got correct results:  Category 1.1 (10) -- Category 1.1.1 (5) -- Category 1.1.2 (5)  How can I change the query to make that the number of products across the categories is correct?  Sry for ma bad language,  Thx in advance")*

I changed the code: Code:

foreach($element as $k =&gt; $v){ $element[$k]=(int)$v; } $filters[] = 'a.category_parent_id IN ('.implode(',',$element).')'; $this-&gt;type=0;

to: Code:

if($all){ $this-&gt;database-&gt;setQuery('SELECT category_left,category_right FROM '.hikashop_table('category').' WHERE category_id IN ('.implode(',',$element).')'); $leafs = $this-&gt;database-&gt;loadObjectList(); $conditions = array(); foreach($leafs as $v){ $conditions[] = '(a.category_left &gt; '.$v-&gt;category_left.' AND a.category_right &lt; '.$v-&gt;category_right.')'; } $filters[] = '('.implode(' OR ',$conditions).')'; $this-&gt;type=0; }else{ foreach($element as $k =&gt; $v){ $element[$k]=(int)$v; } $filters[] = 'a.category_parent_id IN ('.implode(',',$element).')'; $this-&gt;type=0; }

in that file.

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

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

Less More

- Posts: 8
- Thank you received: 0
-
-

14 years 6 months ago [\#49419](#49419) by [pjaaar](/forum/user/7158-pjaaar "View pjaaar's Profile")  Replied by *[pjaaar](/forum/user/7158-pjaaar "View pjaaar's Profile")* on topic *[Re: Incorrect "number of products"](/forum/3-bug-report/47519-incorrect-number-of-products#49419 "Hi,  Joomla version: 2.5.4 HikaShop version: 1.5.7  Here is the catalogue structure I use:  Category 1 -- Category 1.1 -- Category 1.1.1 (5 products here) -- Category 1.1.2 (5 products here) -- Category 1.2 -- Category 2.1.1 (5 products here) -- Category 2.1.2 (5 products here)  I got an incorrect number of products at the first level (I'm talking about a category listing), I got this:  Category 1 (0) -- Category 1.1 (0) -- Category 1.2 (0)  Finally, at a second level, I got correct results:  Category 1.1 (10) -- Category 1.1.1 (5) -- Category 1.1.2 (5)  How can I change the query to make that the number of products across the categories is correct?  Sry for ma bad language,  Thx in advance")*

In category / listing_img_title.php
Code:

&lt;span class="hikashop_category_name"&gt; &lt;a href="&lt;?php echo $link;?&gt;"&gt; &lt;?php echo $this-&gt;row-&gt;category_name; if($this-&gt;params-&gt;get('number_of_products',0)){ echo ' (error here for category #33'.$this-&gt;row-&gt;number_of_products.')'; } ?&gt; &lt;/a&gt; &lt;/span&gt;

What Defines number_of_products? Where is it defined?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC80NzUxOS1pbmNvcnJlY3QtbnVtYmVyLW9mLXByb2R1Y3RzP3RtcGw9bWFya2Rvd24=) 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: 86363
- Thank you received: 14296
-
-

14 years 6 months ago [\#49457](#49457) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Incorrect "number of products"](/forum/3-bug-report/47519-incorrect-number-of-products#49457 "Hi,  Joomla version: 2.5.4 HikaShop version: 1.5.7  Here is the catalogue structure I use:  Category 1 -- Category 1.1 -- Category 1.1.1 (5 products here) -- Category 1.1.2 (5 products here) -- Category 1.2 -- Category 2.1.1 (5 products here) -- Category 2.1.2 (5 products here)  I got an incorrect number of products at the first level (I'm talking about a category listing), I got this:  Category 1 (0) -- Category 1.1 (0) -- Category 1.2 (0)  Finally, at a second level, I got correct results:  Category 1.1 (10) -- Category 1.1.1 (5) -- Category 1.1.2 (5)  How can I change the query to make that the number of products across the categories is correct?  Sry for ma bad language,  Thx in advance")*

$this-&gt;params-&gt;get('number_of_products',0) comes from the option "Show the number of products" of the listing module.
$this-&gt;row-&gt;number_of_products is calculated in the file
omponents/com_hikashop/views/category/view.html.php

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

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

Less More

- Posts: 8
- Thank you received: 0
-
-

14 years 6 months ago -  14 years 6 months ago [\#49468](#49468) by [pjaaar](/forum/user/7158-pjaaar "View pjaaar's Profile")  Replied by *[pjaaar](/forum/user/7158-pjaaar "View pjaaar's Profile")* on topic *[Re: Incorrect "number of products"](/forum/3-bug-report/47519-incorrect-number-of-products#49468 "Hi,  Joomla version: 2.5.4 HikaShop version: 1.5.7  Here is the catalogue structure I use:  Category 1 -- Category 1.1 -- Category 1.1.1 (5 products here) -- Category 1.1.2 (5 products here) -- Category 1.2 -- Category 2.1.1 (5 products here) -- Category 2.1.2 (5 products here)  I got an incorrect number of products at the first level (I'm talking about a category listing), I got this:  Category 1 (0) -- Category 1.1 (0) -- Category 1.2 (0)  Finally, at a second level, I got correct results:  Category 1.1 (10) -- Category 1.1.1 (5) -- Category 1.1.2 (5)  How can I change the query to make that the number of products across the categories is correct?  Sry for ma bad language,  Thx in advance")*

Code:

SELECT count(a.product_id) AS number_of_products,a.category_id FROM #__hikashop_product_category AS a INNER JOIN #__hikashop_product AS b ON a.product_id=b.product_id AND b.product_published&gt;0 WHERE a.category_id IN (29,30,31,32,33,35,46,47) GROUP BY a.category_id

Here is the result in mysql:
Code:

number_of_products category_id 6 29 2 30 2 32 1 33 15 35 1 46 4 47

I debugged the file components/com_hikashop/views/category/view.html.php line #183 - #187

Note: in the id's, #47 is a sub category of #35 and results are fine but #31 has two sub categories (#38 &amp; #39) and the results are going wrong (0)

[ ![Untitled.png](/forum/attachment/3802) ](/forum/attachment/3802 "Untitled.png")

- [ ![Untitled.png](/forum/attachment/3802) ](/forum/attachment/3802 "Untitled.png") [ ](/forum/attachment/3802?download=1 "Untitled.png")

Last edit: 14 years 6 months ago by [pjaaar](/forum/user/7158-pjaaar "View pjaaar's Profile").

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

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

Less More

- Posts: 8
- Thank you received: 0
-
-

14 years 6 months ago -  14 years 6 months ago [\#49472](#49472) by [pjaaar](/forum/user/7158-pjaaar "View pjaaar's Profile")  Replied by *[pjaaar](/forum/user/7158-pjaaar "View pjaaar's Profile")* on topic *[Re: Incorrect "number of products"](/forum/3-bug-report/47519-incorrect-number-of-products#49472 "Hi,  Joomla version: 2.5.4 HikaShop version: 1.5.7  Here is the catalogue structure I use:  Category 1 -- Category 1.1 -- Category 1.1.1 (5 products here) -- Category 1.1.2 (5 products here) -- Category 1.2 -- Category 2.1.1 (5 products here) -- Category 2.1.2 (5 products here)  I got an incorrect number of products at the first level (I'm talking about a category listing), I got this:  Category 1 (0) -- Category 1.1 (0) -- Category 1.2 (0)  Finally, at a second level, I got correct results:  Category 1.1 (10) -- Category 1.1.1 (5) -- Category 1.1.2 (5)  How can I change the query to make that the number of products across the categories is correct?  Sry for ma bad language,  Thx in advance")*

So, I gave up.

I moved all the products in a new set of categories (the same structure as the first one :S ) &amp; it works.

But thx for your time

Last edit: 14 years 6 months ago by [pjaaar](/forum/user/7158-pjaaar "View pjaaar's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC80NzUxOS1pbmNvcnJlY3QtbnVtYmVyLW9mLXByb2R1Y3RzP3RtcGw9bWFya2Rvd24=) 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.102 seconds

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