Skip to main content

bug with filter on categories

13 years 11 months ago #80090 by wzyefd
Hi,
It seems that a bug on filter when filter on categories in multiple-dropdown style.
I have test on my site and on your demo site.
on my site,there will be two error reportings as below
Warning: Invalid argument supplied for foreach() in components /com_hikashop/views/product/view.html.php on line 565
Warning: reset() expects parameter 1 to be array, null given in /components/com_hikashop/views/product/tmpl/listing_div.php on line 34

on your demo site,there will be no products displayed.
But it will be ok when you choose "all" to filter.

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

13 years 11 months ago #80154 by Xavier
Hi,

We don't have the same lines on our end, could you copy/paste the concerned lines ? (not all the file ;) )

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

13 years 11 months ago #80217 by wzyefd
Warning: Invalid argument supplied for foreach() in components /com_hikashop/views/product/view.html.php on line 565
line 565:foreach($rows as $k => $row){
line 566: $classbadge->loadBadges($rows[$k]);
line 567: }
Warning: reset() expects parameter 1 to be array, null given in /components/com_hikashop/views/product/tmpl/listing_div.php on line 34
line 34: $row = reset($this->rows);

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

13 years 11 months ago #80345 by Xavier
Hi,

Can you try to replace the foreach by:
Code:
if(!empty($rows)){ foreach($rows as $k => $row){ $classbadge->loadBadges($rows[$k]); } }

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

13 years 11 months ago #80356 by wzyefd
Tks for your help,It works.
I also modify /components/com_hikashop/views/product/tmpl/listing_div.php on line 34 with
Code:
if(!empty($this->rows)) $row = reset($this->rows);

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

Time to create page: 0.072 seconds
Powered by Kunena Forum