Jump to content

[Résolu]Afficher logo fabricant dans la product-list


Tchupa

Recommended Posts

Bonsoir le monde,

 

voilà je voudrais afficher le logo du fabricant dans la product-list pour chaque produit, j'ai réussi a l'exécuter sur la fiche produit mais impossible de l'afficher sur la product-list j'ai a la place l'image d'erreur 404.

 

J'ai mis ce bout de code

 

<img src="{$img_manu_dir}{$product_manufacturer->id}.jpg" alt="{$product_manufacturer->name}" />

 

Dans la div :

 

<div class="right_block">

 

Donc si quelqu'un a une idée du pourquoi ça ne fonctionne pas.

 

Merci.

 

Cordialement Tchupa.

Link to comment
Share on other sites

Bonsoir le monde,

 

voilà je voudrais afficher le logo du fabricant dans la product-list pour chaque produit, j'ai réussi a l'exécuter sur la fiche produit mais impossible de l'afficher sur la product-list j'ai a la place l'image d'erreur 404.

 

J'ai mis ce bout de code

 

<img src="{$img_manu_dir}{$product_manufacturer->id}.jpg" alt="{$product_manufacturer->name}" />

 

Dans la div :

 

<div class="right_block">

 

Donc si quelqu'un a une idée du pourquoi ça ne fonctionne pas.

 

Merci.

 

Cordialement Tchupa.

 

Sur la page product-list, l'appel n'est pas le même que sur la page product.

{if $product.manufacturer_id}<img src="{$img_manu_dir}{$product.id_manufacturer}-small.jpg" class="logo-marque" alt="{$product.manufacturer_name}" />{/if}

Link to comment
Share on other sites

Salut,

 

J'utilise ce code sur 1.4, regarde ça te vas...

 

<!-- Manufacturer-->
{if $product.id_manufacturer}
<img src="{$img_manu_dir}{$product.id_manufacturer}-small.jpg" alt="{$product.manufacturer_name}" class="img_manuf"/>
{/if}

 

PS : c'est le meme que ci-dessus... et ça marche en théorie.

 

 

V++

 

Atch

Link to comment
Share on other sites

Bonjour,

 

Merci Atch , je pense qu'il devait y avoir une erreur dans le code précédent car le tiens fonctionne correctement.

 

A effectivement, l'erreur provient du {if $product.manufacturer_id}... au lieu de {if $product.id_manufacturer}

J'avais pas fait gaffe.

 

Bonne continuation et merci pour le résolu dans le titre ;)

 

V++

 

Atch

Link to comment
Share on other sites

  • 1 month later...
  • 4 weeks later...
  • 4 weeks later...

bonjour ,

voila j ai rajouter la ligne de commande mais rien ne ce pass et til possible que mon theme soit incompatible ??

 

merci

 

 

A effectivement, l'erreur provient du {if $product.manufacturer_id}... au lieu de {if $product.id_manufacturer}

J'avais pas fait gaffe.

 

Bonne continuation et merci pour le résolu dans le titre ;)

 

V++

 

Atch

bonjour ,

voila j ai rajouter la ligne de commande mais rien ne ce pass et til possible que mon theme soit incompatible ??

 

merci

Link to comment
Share on other sites

Le placement du code c'est où tu veux le mettre. après modulation avec le css.

Après le vidage des caches, cela n'apparait pas ? Version 1.4.X ?

version 1.4.6.2

 

et voici le code :

 

{*

* 2007-2011 PrestaShop

*

* NOTICE OF LICENSE

*

* This source file is subject to the Academic Free License (AFL 3.0)

* that is bundled with this package in the file LICENSE.txt.

* It is also available through the world-wide-web at this URL:

* http://opensource.org/licenses/afl-3.0.php

* If you did not receive a copy of the license and are unable to

* obtain it through the world-wide-web, please send an email

* to [email protected] so we can send you a copy immediately.

*

* DISCLAIMER

*

* Do not edit or add to this file if you wish to upgrade PrestaShop to newer

* versions in the future. If you wish to customize PrestaShop for your

* needs please refer to http://www.prestashop.com for more information.

*

* @author PrestaShop SA <[email protected]>

* @copyright 2007-2011 PrestaShop SA

* @version Release: $Revision: 6909 $

* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)

* International Registered Trademark & Property of PrestaShop SA

*}

<script type="text/javascript" src="{$js_dir}/prod_slide.js"></script>

{if isset($products)}

<!-- Manufacturer-->

{if $product.id_manufacturer}

<img src="{$img_manu_dir}{$product.id_manufacturer}-small.jpg" alt="{$product.manufacturer_name}" class="img_manuf"/>

{/if}

<!-- Products list -->

<div class="list">

{assign var='nbItemsPerLine' value=3}

<ul>

{foreach from=$products item=product name=products}

<li class="{if $smarty.foreach.products.first}first_item{elseif $smarty.foreach.products.last}last_item{else}item{/if} {if $smarty.foreach.products.iteration%$nbItemsPerLine == 0}last_item_of_line{elseif $smarty.foreach.products.iteration%$nbItemsPerLine == 1}{/if} {if $smarty.foreach.products.iteration > ($smarty.foreach.products.total - ($smarty.foreach.products.total % $nbItemsPerLine))}last_line{/if}">

<div class="prod_wrap"></br>

 

<a class="prod_snimka" href="{$product.link}"><img src="{$link->getImageLink($product.link_rewrite, $product.id_image, 'home')}" alt="{$product.name|escape:html:'UTF-8'}" /></a>

<div class="prod_name" style="width: 220px; height: 35px;"><a style="color: #333; font-weight: bold; font-size: 12px; " href="{$product.link}">{$product.name|truncate:30:'...'|escape:'htmlall':'UTF-8'}</a><span class="price_container">{if $product.show_price AND !isset($restricted_country_mode) AND !$PS_CATALOG_MODE}<span class="price">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span>{else}</span><div style="height:21px;">{/if}</div>

<div class="prod_info">

<a href="{$product.link}">

{if (!$PS_CATALOG_MODE AND ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))}

{if isset($product.available_for_order) && $product.available_for_order && !isset($restricted_country_mode)}<span class="availability">{if ($product.allow_oosp || $product.quantity > 0)}{l s='Available'}{elseif (isset($product.quantity_all_versions) && $product.quantity_all_versions > 0)}{l s='Product available with different options'}{else}{l s='Out of stock'}{/if}</span>{/if}

{/if}

<br />

<span style="color: #322617; font-size: 11px;">{$product.description_short|strip_tags|truncate:60:'...'}</span>

 

</a>

</div>

</div>

{if isset($comparator_max_item) && $comparator_max_item}

<p class="compare"><input type="checkbox" onclick="checkForComparison({$comparator_max_item})" class="comparator" id="comparator_item_{$product.id_product}" value="{$product.id_product}" /> <label for="comparator_item_{$product.id_product}">{l s='Select to compare'}</label></p>

{/if}

</li>

{/foreach}

</ul>

</div>

<!-- /Products list -->

{/if}

Link to comment
Share on other sites

Le placement du code c'est où tu veux le mettre. après modulation avec le css.

Après le vidage des caches, cela n'apparait pas ? Version 1.4.X ?

j ai tout fait fait comme vous m avez dit .

mais meme apres vider mon cache par le ftp (dans le fichier compile et cache ) ca s affiche bizzarement

.

Link to comment
Share on other sites

  • 4 months later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...