Abh Posted February 25, 2010 Share Posted February 25, 2010 Cand apesi pe link-ul subcategoriei in breadcrumbs, apare ce se vede in poza. Din pacate nu-mi dau seama ce anume produce acel rezultat. Ce vreau eu e acelasi efect, dar cand apesi pe un buton, si sa apara continutul celor doua subcategorii pe care le am in Home.Am instalat modulul Home Categories pe care stau de doua zile incercand sa-l fac sa afiseze subcategorii, fara succes. Din ce imi dau seama, codul din homecategories.php, in afara celui care tine de BO e: function hookHome($params) { global $smarty; $category = new Category(1); $nb = intval(Configuration::get('HOME_categories_NBR')); $smarty->assign(array( 'category' => $category, 'lang' => Language::getIsoById(intval($params['cookie']->id_lang)), )); return $this->display(__FILE__, 'homecategories.tpl'); } M-am tot invartit prin classes si category.php, am gasit niste metode cum ar fi getAllSubCats(), dar nu reusesc sa le folosesc. Sugestii? Link to comment Share on other sites More sharing options...
Abh Posted February 25, 2010 Author Share Posted February 25, 2010 ok, cred ca am gasit oarecum functia, $subcategories = $category->getChildren(18, 3); unde 18 e id-ul categoriei. Cu ceva modificari pe orbeste in .tpl am reusit sa-mi afiseze numarul de subcategorii ale categoriei 18, fara nume, fara linkuri, toate duc inca spre /category.php?id_category=0 Link to comment Share on other sites More sharing options...
Abh Posted February 25, 2010 Author Share Posted February 25, 2010 Am reusit: function hookHome($params) { global $smarty; $category = new Category(1); $nb = intval(Configuration::get('HOME_categories_NBR')); $subcategories_al = $category->getChildren(9, 3); $subcategories_ne = $category->getChildren(13, 3); $smarty->assign(array( 'category' => $category, 'alimentare' => $subcategories_al, 'nealimentare' => $subcategories_ne, 'lang' => Language::getIsoById(intval($params['cookie']->id_lang)), )); return $this->display(__FILE__, 'homecategories.tpl'); } cele doua subcategorii principale, id 9 si id 13;Pe urma, in homecategories.tpl: {foreach from=$alimentare item=category name=Children} {assign var='categoryLink' value=$link->getcategoryLink($category.id_category, $category.link_rewrite)} {$category.name|truncate:35} name}" title="{$category->name}" id="categoryImage" /> {/foreach} {foreach from=$nealimentare item=category name=Children} {assign var='categoryLink' value=$link->getcategoryLink($category.id_category, $category.link_rewrite)} {$category.name|truncate:35} name}" title="{$category->name}" id="categoryImage" /> {/foreach} cate un div pentru fiecare.Si css-ul: div.mainpage{ padding-left:20px; margin:5px 0;} div.mainpage ul {list-style:none;} div.mainpage li { float: left; width: 100px; margin-right:5px;} div.mainpage li img{ width: 95px; border: 1px solid #fff;} Rezultat final in poza.Intrebare: cum pot face sa apara asta doar cand dau click pe un buton? Daca fac link direct imi da: PHP Fatal error: Class 'Module' not found in C:\\Program Files\\EasyPHP5.3.0\\www\\prestashop\\modules\\homecategories\\homecategories.php on line 4, referer: http://localhost/prestashop/ Link to comment Share on other sites More sharing options...
Abh Posted February 26, 2010 Author Share Posted February 26, 2010 N-am reusit sa-l fac sa functioneze direct de la buton (am un meniu orizontal), dar am creat un alt fisier cu urmatorul continut si am bagat link catre el: <?php include(dirname(__FILE__).'/../../config/config.inc.php'); include(dirname(__FILE__).'/../../header.php'); include(dirname(__FILE__).'/homecategories.php'); $homecategories = new homecategories(); echo $homecategories->hookHome(); include(dirname(__FILE__).'/../../footer.php'); ?> Link to comment Share on other sites More sharing options...
Abh Posted February 26, 2010 Author Share Posted February 26, 2010 Intrebare de CSS: Ce se intampla cu acele imagini? Nu reusesc sa le fac sa umple patratul cum face imaginea default.http://cumperipentruacasa.ro/modules/homecategories/cumpara.php Link to comment Share on other sites More sharing options...
The Ge Posted February 27, 2010 Share Posted February 27, 2010 Cred ca cel mai simplu ar fi sa folosesti o poza patrata din cele generate de Presta.Ex: in loc de 17-category.jpg pui 17-medium.jpg sau 17-large.jpg. Tu stii cum ai codul in tpl. Link to comment Share on other sites More sharing options...
Abh Posted February 27, 2010 Author Share Posted February 27, 2010 am rezolvat, am schimbat din name}" title="{$category->name}" id="categoryImage" /> in name}" title="{$category->name}" id="categoryImage" /> 17-category era generata in 500x150, din cauza aia imi aparea ingustata, pentru ca pe margini era plin de alb. Link to comment Share on other sites More sharing options...
Recommended Posts