The carousel does not follow the setting 'Only with products'

  • Posts: 429
  • Thank you received: 19
4 years 1 month ago #326255

Hi, I created a module with content for a category, but when I activate the carousel, the setting 'Only with products' is not observed - all available categories are displayed.

Attachments:

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

  • Posts: 83022
  • Thank you received: 13403
  • MODERATOR
4 years 4 weeks ago #326281

Hi,

You're totally correct.
That setting is currently ignored in carousel mode.
Add the code:

$rows = array();
if($this->params->get('only_if_products','-1')=='-1'){
	$config = hikashop_config();
	$defaultParams = $config->get('default_params');
	$this->params->set('only_if_products',@$defaultParams['only_if_products']);
}
$only_if_products = $this->params->get('only_if_products',0);
foreach($this->rows as $row) {
	if($only_if_products && $row->number_of_products < 1)
			continue;
	$rows[] = $row;
}
$this->rows = $rows;
at the beginning of the view file category / carousel.php via the menu Display>Views and it should work properly.
We'll add that patch on our end for the next version.

The following user(s) said Thank You: neo191987

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

Time to create page: 0.073 seconds
Powered by Kunena Forum