Jump to content

Petit coup de gueule / Prix barré, pourcentage


Enduro

Recommended Posts

Je travail actuellement sur la dernière version presta et thème PrestaShop Template 1.4.5.

 

Je remarque qu'il n'y a toujours pas le prix de base (prix barré) ou d'affichage du pourcentage pour les produits avec remise sur la liste de produit ou sur les pages nouveaux produits, promotion !!,...

 

Cette information est seulement indiquée sur le bloc spécial et sur la page produit.

 

Le but d'une promotion est quand même de mettre en avant une remise ! Cette réduction doit donc être visible sur tous les blocs et pages...

 

Marre de rechercher un bout de code qui est différent suivant les versions de presta et tpl.

 

Ce message s'adresse à la Team. Pourquoi n'indiquez vous pas de prix barré / pourcentage sur ces pages ou blocs.

Link to comment
Share on other sites

Salut enduro,

 

c'est vrai que c'est un loupé de la team, mais voici 2 posts qui en parlent avec les solutions :

 

http://www.prestashop.com/forums/topic/107327-en-solde-prix-barre-sur-la-fiche-produit/page__fromsearch__1

et

http://www.prestashop.com/forums/topic/101146-prix-barre-supprimer-apres-mise-a-jours-14/page__fromsearch__1

 

Bon courage

Patrick

Link to comment
Share on other sites

Salut Patrick,

 

Merci pour ton message (bizarre je n'ai pas reçus de mail comme quoi on m'avait répondu).

 

J'ai trouvé un code qui fonctionne (testé sur presta 1.4.6) sur un thread anglais ou j'ai ajouté une div.

 

Si çà peux aider.

 

<div class="price_reduction">
{if $product.price_without_reduction neq $product.price}
		<span class="price-discount">
{if !$priceDisplay}{displayWtPrice p=$product.price_without_reduction}{else}{displayWtPrice p=((($product.price_without_reduction) / (1 + ((($product.rate|intval) / 100)|floatval)))|floatval)}{/if}</span>
	  {if $product.specific_prices}{assign var='pro_specific_prices' value=$product.specific_prices}
	 {if $pro_specific_prices.reduction_type eq 'percentage' && ($pro_specific_prices.from eq $pro_specific_prices.to OR ($smarty.now|date_format:'%Y-%m-%d %H:%M:%S' <= $pro_specific_prices.to && $smarty.now|date_format:'%Y-%m-%d %H:%M:%S' >= $pro_specific_prices.from))}(-{$pro_specific_prices.reduction * 100|floatval}%)
									 {/if}
								{/if}
							{/if}
</div>

 

Il affiche le prix barré et la remise en pourcentage, après tu ajoute les "class" dans ton css (product-list.css de ton thème) pour peaufiner .

 

Ce bout de code devrait être en natif sur presta...

  • Like 1
Link to comment
Share on other sites

Dans ton fichier product-list de ton thème, je l'ai mis après

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

ou avant

<div class="content_price">

   {if (!$PS_CATALOG_MODE AND ((isset($product.show_price) && $product.show_price) || (isset($product.available_for_order) && $product.available_for_order)))}
<div class="price_reduction">
{if $product.price_without_reduction neq $product.price}
	    <span class="price-discount">
{if !$priceDisplay}{displayWtPrice p=$product.price_without_reduction}{else}{displayWtPrice p=((($product.price_without_reduction) / (1 + ((($product.rate|intval) / 100)|floatval)))|floatval)}{/if}</span>
	  {if $product.specific_prices}{assign var='pro_specific_prices' value=$product.specific_prices}
	 {if $pro_specific_prices.reduction_type eq 'percentage' && ($pro_specific_prices.from eq $pro_specific_prices.to OR ($smarty.now|date_format:'%Y-%m-%d %H:%M:%S' <= $pro_specific_prices.to && $smarty.now|date_format:'%Y-%m-%d %H:%M:%S' >= $pro_specific_prices.from))}<span class="reduction">-{$pro_specific_prices.reduction * 100|floatval}%</span>
									 {/if}
							    {/if}
						    {/if}
</div>
   <div class="content_price">
 {if isset($product.show_price) && $product.show_price && !isset($restricted_country_mode)}<span class="price" style="display: inline;">{if !$priceDisplay}{convertPrice price=$product.price}{else}{convertPrice price=$product.price_tax_exc}{/if}</span><br />{/if}

 

Tu créé tes class dans le fichier product-list.css de ton thème si tu veux peaufiner (marge, background,...).

Link to comment
Share on other sites

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...