bug with filter on categories

  • Posts: 24
  • Thank you received: 0
11 years 11 months ago #80090

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.

  • Posts: 13201
  • Thank you received: 2322
11 years 11 months ago #80154

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.

  • Posts: 24
  • Thank you received: 0
11 years 11 months ago #80217

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.

  • Posts: 13201
  • Thank you received: 2322
11 years 11 months ago #80345

Hi,

Can you try to replace the foreach by:

		if(!empty($rows)){
			foreach($rows as $k => $row){
				$classbadge->loadBadges($rows[$k]);
			}
		}

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

  • Posts: 24
  • Thank you received: 0
11 years 11 months ago #80356

Tks for your help,It works.
I also modify /components/com_hikashop/views/product/tmpl/listing_div.php on line 34 with

if(!empty($this->rows))
$row = reset($this->rows);

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

Time to create page: 0.045 seconds
Powered by Kunena Forum