Jump to content

Total différent du prix unitaire dans le panier pour les produits customizés


Sapher

Recommended Posts

Bonjour,
J'ai un problème : dans le panier, pour chaque produit personnalisé, le total est à 0 alors que le prix unitaire est normal.
J'ai regardé comment ça fonctionnait : l'appel de la fonction addCustomizationPrice de la classe Product dans le fichier order.php . J'ai fait des echo test et à prioris ça fonctionne bien. En revanche une fois dans le tpl, la valeur n'existe plus.

Si je ne suis pas très clair :
order.php ligne 420 :

Product::addCustomizationPrice($summary['products'], $customizedDatas);


Je rajoute derrière :

foreach ($summary['products'] as $testproduct) echo '$testproduct[\'total_customization_wt\'] = '. $testproduct['total_customization_wt'] . '.
';


ça marche, il me retourne la bonne valeur.

en revanche une fois dans le tpl (shopping-cart.tpl ligne 62)

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


Je rajoute derrière :

Test : {$product.total_customization_wt}


et ça ne marche pas, il m'affiche "Test :" sans la valeur derrière.

Alors soit j'appelle mal ma variable dans le tpl, soit il y a eu un problème lors de l'assign. Des idées ?

Link to comment
Share on other sites

In my case i've managed to kind of fix it...

Since my customization doesn't have any special price, i just needed to change line 34 in shopping-cart-product-line.tpl from

{if !$priceDisplay || $priceDisplay == 2}{convertPrice price=$product.total_customization_wt}{if $priceDisplay == 2} {l s='+Tx'}{/if}{/if}{if $priceDisplay == 2}
{/if}



to

{if !$priceDisplay || $priceDisplay == 2}{convertPrice price=$product.total_wt}{if $priceDisplay == 2} {l s='+Tx'}{/if}{/if}{if $priceDisplay == 2}
{/if}




Don't know if this helps. :S

Either way, your post helped me.

So thanks. :)

Link to comment
Share on other sites

This won't work if the customization has a different price...

What i did was, since my customization didn't have any extra fees, instead of displaying the customization price, i set the tpl to display the total price of that item.

Beware that if your customization has an extra fee, it won't work.


Glad to help :)

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