graphee Posted July 12, 2011 Share Posted July 12, 2011 Salut a tous,je cherche une solution pour faire un lien vers la catégorie d'un produit plutot que vers la fiche produit dans le module "home featured"je fait un site ou je n'utilise pas dutout les fiches produits, uniquement les listings donc faudrait que j'arrive a faire des liens vers la catégire a partir de ce code : {foreach from=$products item=product name=homeFeaturedProducts} {assign var='productLink' value=$link->getProductLink($product.id_product, $product.link_rewrite)}getImageLink($product.link_rewrite, $product.id_image, 'home')}" alt="{$product.legend}" /> {if $displayname} {$product.name|escape:htmlall:'UTF-8'|truncate:45} {/if} {if $displayprice}{displayWtPrice p=$product.price}{/if} {/foreach} merci de votre aide Link to comment Share on other sites More sharing options...
Ukoo - Guillaume Posted July 12, 2011 Share Posted July 12, 2011 Salut,En utilisant la balise {debug} de Smarty dans le tpl de homefeatured, on se rend compte que pour chaque produit on récupère bien l'id de sa catégorie (default_category).Tu devrait pouvoir modifier le lien en remplaçant les "{$product.link}" par "{$base_dir}category.php?id_category={$product.id_category_default}" 1 Link to comment Share on other sites More sharing options...
graphee Posted July 19, 2011 Author Share Posted July 19, 2011 ça marche PARFAITEMENT, merci bien Link to comment Share on other sites More sharing options...
Ukoo - Guillaume Posted July 19, 2011 Share Posted July 19, 2011 Pas de quoi ^^ Link to comment Share on other sites More sharing options...
prose Posted August 29, 2011 Share Posted August 29, 2011 bonjour, moi je voudrais classer les produits sur homefeatured par catégories. Si 1 produit alors sur 1 ligne Si 2 produits de la catégorie sur 1 ligne avec 2 produits Si 3 produits de la catégorie sur 1 ligne avec 2 produits + un lien vers la catégorie .... comment faire ? Link to comment Share on other sites More sharing options...
gueyome Posted November 19, 2013 Share Posted November 19, 2013 ça marche PARFAITEMENT, merci bien Salut graphee, peux tu me copier coller ce que tu as modifié pour finalement arriver à cela? Merci bcp! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now