Katzele Posted January 11, 2010 Share Posted January 11, 2010 Bonjour les gens ;-)J'aimerai que sur la page listing produits les prix en soldes ou en promo affichent le montant de la réduction si la réduc est en pourcentage, genre 200€ (barré) remise -10% 180€ (en rouge)En suivant ce message :http://www.prestashop.com/forums/viewthread/11467/developpement_et_modules/resolu_afficher_prix_reduit__prix_dorigine_dans_productlist_dot_tplj'ai réussi à afficher mon prix barré et mon nouveau prix, avec mention en solde au dessus, mais impossible de mettre le pourcentage de la réducMon site :http://www.katzelkraft.fr/prices-drop.phpla partie modifiée de mon fichier product-list.tpl : {if $product.on_sale} {l s='On sale!'} {convertPrice price=$product.price_without_reduction} {convertPrice price=$product.price} {elseif ($product.reduction_price != 0 || $product.reduction_percent != 0) && ($product.reduction_from == $product.reduction_to OR ($smarty.now|date_format:'%Y-%m-%d' <= $product.reduction_to && $smarty.now|date_format:'%Y-%m-%d' >= $product.reduction_from))} {convertPrice price=$product.price_without_reduction} {convertPrice price=$product.price} {else} {convertPrice price=$product.price} {/if} {if ($product.allow_oosp OR $product.quantity > 0) && $product.customizable != 2} {l s='Add to cart'} {else} {l s='Add to cart'} {/if} {l s='View'} Si une bonne âme pouvait m'aider... merci d'avance. Link to comment Share on other sites More sharing options...
lennynero Posted January 17, 2010 Share Posted January 17, 2010 Bonjour,as-tu trouvé la soluce our ton problème, sinon je peux te proposer la mienne que j'ai trouvée sur un post mais il manque le % de remisecordialment Link to comment Share on other sites More sharing options...
Katzele Posted January 18, 2010 Author Share Posted January 18, 2010 En fait c'est justement ça qui me manque aussi, le pourcentage, sinon j'ai réussi à mettre le prix fort barré et le prix réduit en rouge.En tout cas merci, c'est gentil de ta part. Link to comment Share on other sites More sharing options...
lennynero Posted January 18, 2010 Share Posted January 18, 2010 Ok j'ai pu regrouper deux topics et j'ai trouvé ma réponse....Regadre mon site et dis moi si c'est ce que tu veux!bye Link to comment Share on other sites More sharing options...
opportunite Posted January 29, 2010 Share Posted January 29, 2010 Salut à tous,lennynero, t'as solution m'intéresse.peux tu me donner la manip. ?Merci. Link to comment Share on other sites More sharing options...
gianvi Posted February 3, 2010 Share Posted February 3, 2010 Ciaoif you can share the changes made on each file (product and Homefeatured i think) would be great Link to comment Share on other sites More sharing options...
cockpitinferno Posted January 14, 2011 Share Posted January 14, 2011 je fais un petit déterrage de post car j'ai un peu cherché pour le pourcentage mais n'ai rien trouvé.j'ai réussi à afficher le prix barré dans la liste mais j'aimerai ajouter le pourcentage. qqun aurait il une idée? merci Link to comment Share on other sites More sharing options...
cockpitinferno Posted January 19, 2012 Share Posted January 19, 2012 je remonte ce post car aparrement ca n'a pas été ajouté à la v1.4. qqun a t il trouvé depuis une solution? Link to comment Share on other sites More sharing options...
cockpitinferno Posted January 19, 2012 Share Posted January 19, 2012 j'ai eu l'idée de prendre le code de "product.php" pour le mettre dans product list mais ca ne fonctionne pas, j'ai ajouté ce code à product-list: {if $product->specificPrice AND $product->specificPrice.reduction_type == 'percentage'} <p id="reduction_percent">{l s='price reduced by'} <span id="reduction_percent_display">{$product->specificPrice.reduction*100}</span> %{l s=')'}</p> {/if} et ca n'affiche rien. qqun aurait une idée du pourquoi? merci d'avance. Link to comment Share on other sites More sharing options...
loulou66 Posted January 19, 2012 Share Posted January 19, 2012 coucou dans le module dompromo light on a : <div class="price-discount" style="text-align:center;">{displayWtPrice p=$product.price_without_reduction}</div> pour le prix sans reduction {if $product.reduction_percent|intval}<div class="reduction" style="text-align:center;">(-{$product.reduction_percent|intval}%)</div>{/if} pour la reduction en % <div><div style="color:#{$blockpriceColor};text-align:center;font-weight:bold;font-size:1.1em">{displayWtPrice p=$product.price}</div></div></div> pour le prix avec reductiuon @++ Loulou66 Link to comment Share on other sites More sharing options...
cockpitinferno Posted January 19, 2012 Share Posted January 19, 2012 merci pour ta réponse, je viens d'essayer et ca ne fonctionne pas non plus. Link to comment Share on other sites More sharing options...
loulou66 Posted January 19, 2012 Share Posted January 19, 2012 Coucou bon alors j'ai module block_special por les promo <!-- MODULE Block specials --> <div id="special_block_right" class="block products_block exclusive blockspecials"> <h4><a href="{$link->getPageLink('prices-drop.php')}" title="{l s='Specials' mod='blockspecials'}">{l s='Specials' mod='blockspecials'}</a></h4> <div class="block_content"> {if $special} <ul class="products clearfix"> <li class="product_image"> <a href="{$special.link}"><img src="{$link->getImageLink($special.link_rewrite, $special.id_image, 'medium')}" alt="{$special.legend|escape:html:'UTF-8'}" height="{$mediumSize.height}" width="{$mediumSize.width}" title="{$special.name|escape:html:'UTF-8'}" /></a> </li> <li> {if $special.specific_prices} {assign var='specific_prices' value=$special.specific_prices} {if $specific_prices.reduction_type == 'percentage' && ($specific_prices.from == $specific_prices.to OR ($smarty.now|date_format:'%Y-%m-%d %H:%M:%S' <= $specific_prices.to && $smarty.now|date_format:'%Y-%m-%d %H:%M:%S' >= $specific_prices.from))} <span class="reduction"><span>-{$specific_prices.reduction*100|floatval}%</span></span> {/if} {/if} <h5><a href="{$special.link}" title="{$special.name|escape:html:'UTF-8'}">{$special.name|escape:html:'UTF-8'}</a></h5> <span class="price-discount">{if !$priceDisplay}{displayWtPrice p=$special.price_without_reduction}{else}{displayWtPrice p=$priceWithoutReduction_tax_excl}{/if}</span> <span class="price">{if !$priceDisplay}{displayWtPrice p=$special.price}{else}{displayWtPrice p=$special.price_tax_exc}{/if}</span> </li> </ul> <p> <a href="{$link->getPageLink('prices-drop.php')}" title="{l s='All specials' mod='blockspecials'}">» {l s='All specials' mod='blockspecials'}</a> </p> {else} <p>{l s='No specials at this time' mod='blockspecials'}</p> {/if} </div> </div> <!-- /MODULE Block specials --> ça m'affiche bien le prix barré le pourcentage et le prix réduit normalement ça prend les variable de ps @++ loulou66 Link to comment Share on other sites More sharing options...
cyndi Posted September 17, 2012 Share Posted September 17, 2012 (edited) Bonjour J'ai mis ce code: {if isset($product.reduction) && $product.reduction && isset($product.show_price) && $product.show_price && !$PS_CATALOG_MODE} {assign var='specific_prices' value=$special.specific_prices} <span class="new" style="padding-top:14px;">-{$specific_prices.reduction*100|floatval}%</span> Pour afficher les pourcentages de réduc, mais ca bug. Dès fois il indique 5% ou 45 % ? Le bon montant étant 45%. Voici l'adresse du site avec le code utilisé http://www.netacha.be/demo/2-musique-ipods Si vous raffraichissez votre page ca change à chaque fois ... Edited September 17, 2012 by cyndi (see edit history) Link to comment Share on other sites More sharing options...
coeos.pro Posted September 17, 2012 Share Posted September 17, 2012 Pour afficher les pourcentages de réduc, mais ca bug. Dès fois il indique 5% ou 45 % ? Le bon montant étant 45%. grosso modo 200€-45% ça doit faire 110€ et non 191€, où 5% est certainement la bonne réduction... bon, je vais être sympa je vais te donner LA cause de ton erreur : Coucou bon alors j'ai module block_special por les promo 1 Link to comment Share on other sites More sharing options...
domi77185 Posted November 11, 2012 Share Posted November 11, 2012 Bonjour, Je lis un peu tard, mais le problème a l'air résolu..... Link to comment Share on other sites More sharing options...
fxdesca Posted January 29, 2013 Share Posted January 29, 2013 Bonjour, Je lis un peu tard, mais le problème a l'air résolu..... Quelqu'un pourrait-il donner le bon code svp ? Merci Link to comment Share on other sites More sharing options...
coeos.pro Posted January 29, 2013 Share Posted January 29, 2013 Quelqu'un pourrait-il donner le bon code svp ? Merci Si tu as un problème il vaut mieux créer un nouveau sujet à mon avis. Link to comment Share on other sites More sharing options...
Recommended Posts