Jump to content

[SOLUCIONADO] Cambiar la foto thumbnails de la categoria del menu horizontal


luiskar

Recommended Posts

Pues eso, me gustaria mover la imagen  para que el menu quedara asi:

ejemplo-3.png

 

Lo he conseguido desde chrome pero no lo encuentro en los archivos. Alguien sabe si es posible?

 

Vale ya he visto donde es, modificando la funcion en blocktopmenu.php con el siguiente codigo, que encontraras en la linea 593

    protected function generateCategoriesMenu($categories, $is_children = 0)
    {
        $html = '';

        foreach ($categories as $key => $category) {
            if ($category['level_depth'] > 1) {
                $cat = new Category($category['id_category']);
                $link = Tools::HtmlEntitiesUTF8($cat->getLink());
            } else {
                $link = $this->context->link->getPageLink('index');
            }

            /* Whenever a category is not active we shouldnt display it to customer */
            if ((bool)$category['active'] === false) {
                continue;
            }

            $html .= '<li'.(($this->page_name == 'category'
                && (int)Tools::getValue('id_category') == (int)$category['id_category']) ? ' class="sfHoverForce"' : '').'>';
					if ((int)$category['level_depth'] > 1 && !$is_children) {
							$files = scandir(_PS_CAT_IMG_DIR_);
							if (count(preg_grep('/^'.$category['id_category'].'-([0-9])?_thumb.jpg/i', $files)) > 0) {
								foreach ($files as $file) {
									if (preg_match('/^'.$category['id_category'].'-([0-9])?_thumb.jpg/i', $file) === 1) {
										$html .= '<img src="'.$this->context->link->getMediaLink(_THEME_CAT_DIR_.$file)
										.'" alt="'.Tools::SafeOutput($category['name']).'" title="'
										.Tools::SafeOutput($category['name']).'" class="imgm" />';
									}
								}	
							}
						}
				
					$html .= '<a href="'.$link.'" title="'.$category['name'].'">'.$category['name'].'</a>';
				
            if (isset($category['children']) && !empty($category['children'])) {
                $html .= '<ul>';
                $html .= $this->generateCategoriesMenu($category['children'], 1);
                $html .= '</ul>';
            }

            $html .= '</li>';
        }

        return $html;
    }
Link to comment
Share on other sites

  • nadie locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...