Jump to content

Alternate the code


sese

Recommended Posts

Hi guys,

 

Iám trying to change the code.

 

The situation is as follow: the categories only show when they are filled. I want to change this. So that the categories alway show empty or not.

 

this is the code:

 

// remove empty categories

$selected_categories = array ();

foreach($this->selected_categories as $category) {

if ($category->totalItemCount()) {

$selected_categories[] = $category;

}

}

Link to comment
https://forums.phpfreaks.com/topic/255245-alternate-the-code/
Share on other sites

  • 2 weeks later...

You can directly display category from $this->selected_categories array OR just comment count checking line in your code as i have done in your code as follows

 

$selected_categories = array ();

foreach($this->selected_categories as $category) {

  //if ($category->totalItemCount()) {

      $selected_categories[] = $category;

  //}

}

Link to comment
https://forums.phpfreaks.com/topic/255245-alternate-the-code/#findComment-1312553
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.