Installed the module Category Groups , when displayed on the page , duplicates the entire contents of XDCategoryGroups.tpl

enter image description here

XDCategoryGroups.tpl

<style type="text/css"> <?php echo $XDcustomCSSCode; ?> .customSizes { padding-left:<?php echo $XDPaddingLeft; ?>px; padding-right:<?php echo $XDPaddingRight; ?>px; height:<?php echo $XDBlockHeight; ?>px; } </style> <div class="box1"> <?php foreach($categories as $category) { // ADD CONDITIONAL INFO FOR SIZING if($XDAutoPadding == 'active'){ $spacingClass = 'customSizes'; } else { $spacingClass = 'autoSpacing'; } ?> <div class="XDCategoryGroupsBlocks <?php echo $spacingClass; ?>"> <?php if($XDposition == 'aboveImage') { if($XDtitleLinks == 'active'){ ?><h2><a href="<?php echo $category['parent_url']; ?>"><?php echo $category['name']; ?></a></h2><?php } else { ?><h2><?php echo $category['name']; ?></h2><?php } } if($XDshowImage == 'yes') { if($XDtitleLinks == 'active'){ ?><a href="<?php echo $category['parent_url']; ?>"><img src="<?php echo $category['image']; ?>" alt="<?php echo $category['name']; ?>"/></a><?php } else { ?><img class="categoryGroupImg" src="<?php echo $category['image']; ?>" alt="<?php echo $category['name']; ?>"/><?php } } if($XDposition == 'belowImage') { if($XDtitleLinks == 'active'){ ?><h2><a href="<?php echo $category['parent_url']; ?>"><?php echo $category['name']; ?></a></h2><?php } else { ?><h2><?php echo $category['name']; ?></h2><?php } } ?> <ul> <?php foreach($category['children'] as $childElement){ echo '<li><a href="'.$childElement['url'].'">'.$childElement['name'].'</a></li>'; } ?> </ul> </div> <?php } ?> </div> 

controller - XDCategoryGroups.php

 <?php class ControllerModuleXDCategoryGroups extends Controller { protected function index() { $this->language->load('module/XDCategoryGroups'); $this->load->model('catalog/category'); $this->load->model('tool/image'); //$this->data['heading_title'] = $this->language->get('heading_title'); if (file_exists('catalog/view/theme/' . $this->config->get('config_template') . '/stylesheet/XDCategoryGroups.css')) { $this->document->addStyle('catalog/view/theme/' . $this->config->get('config_template') . '/stylesheet/XDCategoryGroups.css'); } else { $this->document->addStyle('catalog/view/theme/default/stylesheet/XDCategoryGroups.css'); } $categories = $this->config->get('XDCategoryGroupsBlocks'); $XDSettings = $this->config->get('XDCategoryGroupsSetting'); $this->data['XDposition'] = $XDSettings['titlePosition']; $this->data['XDtitleLinks'] = $XDSettings['titleLinks']; $this->data['XDshowImage'] = $XDSettings['showImage']; $this->data['XDAutoPadding'] = $XDSettings['blockPadding']; $this->data['XDPaddingLeft'] = $XDSettings['blockPaddingLeft']; $this->data['XDPaddingRight'] = $XDSettings['blockPaddingRight']; $this->data['XDBlockHeight'] = $XDSettings['blockHeight']; $this->data['XDcustomCSSCode'] = (isset($XDSettings['customCSSCode']) ? $XDSettings['customCSSCode'] : ''); if(!isset($XDSettings['customImageWidth']) || $XDSettings['customImageWidth'] == ''){ $XDSettings['customImageWidth'] = 250; } $subCatLimit = $XDSettings['categoryLimit']; $cat = array(); $count = 1; $categories = $this->model_catalog_category->getCategories(0); foreach($categories as $category){ $currentCategory = $this->model_catalog_category->getCategory($category['category_id']); $cat[$count]['name'] = $currentCategory['name']; $cat[$count]['parent_url'] = $this->constructPath($category['category_id']); if($category['image'] == ''){ $cat[$count]['image'] = '/image/no_image.jpg'; } else { //$cat[$count]['image'] = HTTPS_SERVER.'image/'.$category['image']; $image = $this->model_tool_image->resize($category['image'], $XDSettings['customImageWidth'], $XDSettings['customImageWidth']); $cat[$count]['image'] = $image; } $cat[$count]['category'] = $category['category_id']; $CategoryChildren = array(); $Children = $this->model_catalog_category->getCategories($category['category_id']); $Children = array_slice($Children, 0, $subCatLimit); foreach($Children as $child){ $CategoryChildren[] = array( 'category_id' => $child['category_id'], 'name' => $child['name'], 'url' => $this->constructPath($category['category_id'], $child['category_id']) ); } $cat[$count]['children'] = $CategoryChildren; $count++; } $this->data['categories'] = $cat; if (file_exists(DIR_TEMPLATE . $this->config->get('config_template') . '/template/module/XDCategoryGroups.tpl')) { $this->template = $this->config->get('config_template') . '/template/module/XDCategoryGroups.tpl'; } else { $this->template = 'default/template/module/XDCategoryGroups.tpl'; } $this->render(); } protected function constructPath($categoryID,$subCategoryID = '') { if($subCategoryID != ''){ $new_path = $categoryID . '_' . $subCategoryID; } else { $new_path = $categoryID; } //$categoryhome = array(); //$category_id = array_shift($this->path); //$results = $this->model_catalog_category->getCategories($parent_id); $categoryURL = $this->url->link('product/category', 'path=' . $new_path); return $categoryURL; } } ?> 

I use ocStore Version 1.5.5.1.2

  • You are exactly the module twice in the admin did not bring to the main? - Andrew Hobbit
  • @AndrewHobbit unfortunately - there is no prntscr.com/b2pija, but when one more output is added, it duplicates it. instead of two 4 - Neka

0