Jump to content

Réduction de 0,00€ appliquée aux produits dans le panier


Recommended Posts

Bonjour,

 

Je viens de faire une mise à jour de PS 1.6.0.11 vers 16.0.14, et je remarque le bug/problème suivant :

 

Une réduction de 0,00€ s'applique systématiquement à mes produits dans le panier. Je n'ai aucune réduction, ou de regle panier configurée dans mon CMS. Cette réduction n'a aucun lieu d'être, et n’apparaît pas dans la liste et fiche produit

 

vn.jpg

 

Quelqu'un pourrait m'aider avec ceci ?

 

Merci d'avance

Thomas

Link to comment
Share on other sites

  • 2 weeks later...

Merci pour ta réponse, ne connaissant pas très bien le langage peux-tu m'indiquer là ou on met les conditions :

 

             {if !$priceDisplay}
            {if isset($product.reduction_type) && $product.reduction_type == 'amount'}
                    {assign var='priceReduction' value=($product.price_wt - $product.price_without_specific_price)}
                    {assign var='symbol' value=$currency->sign}
                    {else}
                    {assign var='priceReduction' value=(($product.price_without_specific_price - $product.price_wt)/$product.price_without_specific_price) * 100 * -1}
                    {assign var='symbol' value='%'}
                    {/if}
{else}
{if isset($product.reduction_type) && $product.reduction_type == 'amount'}
{assign var='priceReduction' value=($product.price - $product.price_without_specific_price)}
{assign var='symbol' value=$currency->sign}
                    {else}
                    {assign var='priceReduction' value=(($product.price_without_specific_price - $product.price)/$product.price_without_specific_price) * 100 * -1}
                    {assign var='symbol' value='%'}
                    {/if}
{/if}
{if $symbol == '%'}
 {$priceReduction|round|string_format:"%d"}{$symbol} 
{else}
 {$priceReduction|string_format:"%.2f"}{$symbol} 
{/if}
 
jc
Link to comment
Share on other sites

Remplace le code de la ligne 50 à 89 par ceci :)

	<td class="cart_unit" data-title="{l s='Unit price'}">
		<span class="price" id="product_price_{$product.id_product}_{$product.id_product_attribute}{if $quantityDisplayed > 0}_nocustom{/if}_{$product.id_address_delivery|intval}{if !empty($product.gift)}_gift{/if}">
			{if !empty($product.gift)}
				<span class="gift-icon">{l s='Gift!'}</span>
			{else}
            	{if !$priceDisplay}
					<span class="price{if isset($product.is_discounted) && $product.is_discounted && $product.e_pourcentage > 0} special-price{/if}">{convertPrice price=$product.price_wt}</span>
				{else}
               	 	<span class="price{if isset($product.is_discounted) && $product.is_discounted && $product.e_pourcentage > 0} special-price{/if}">{convertPrice price=$product.price}</span>
				{/if}
				{if isset($product.is_discounted) && $product.is_discounted && $product.e_pourcentage > 0}
                	<span class="price-percent-reduction small">
            			{if !$priceDisplay}
            				{if isset($product.reduction_type) && $product.reduction_type == 'amount'}
                    			{assign var='priceReduction' value=($product.price_wt - $product.price_without_specific_price)}
                    			{assign var='symbol' value=$currency->sign}
                    		{else}
                    			{assign var='priceReduction' value=(($product.price_without_specific_price - $product.price_wt)/$product.price_without_specific_price) * 100 * -1}
                    			{assign var='symbol' value='%'}
                    		{/if}
						{else}
							{if isset($product.reduction_type) && $product.reduction_type == 'amount'}
								{assign var='priceReduction' value=($product.price - $product.price_without_specific_price)}
								{assign var='symbol' value=$currency->sign}
                    		{else}
                    			{assign var='priceReduction' value=(($product.price_without_specific_price - $product.price)/$product.price_without_specific_price) * 100 * -1}
                    			{assign var='symbol' value='%'}
                    		{/if}
						{/if}
						{if $symbol == '%'}
							{$priceReduction|round|string_format:"%d"}{$symbol}
						{else}
							{$priceReduction|string_format:"%.2f"}{$symbol}
						{/if}
                    </span>
					<span class="old-price">{convertPrice price=$product.price_without_specific_price}</span>
				{/if}
			{/if}
		</span>
	</td>

Mon collègue a également réussi a retirer ce problème de réduction pour la plupart des produits, sans devoir remplacer ce code. Je vais lui demander comment il à fait. Il reste des produits résiduels pour lesquels les réductions persistaient, d'où l'utilité de ce code.

 

On s'est rendu compte que la réduction était un bug lié à l'arrondi des prix TVAC. si tu changes ta règle d'arrondis dans les paramètres de Presta, tu verras que les réductions peuvent disparaitre.

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