Rdev Posted May 22, 2013 Share Posted May 22, 2013 (edited) Bonjour tout le monde, tout est dans le titre, je veux afficher les prix HT et TTC sur l'email de confirmation de commande j'utilise prestashop 1.5.4.0 Merci pour votre aide Edited June 6, 2013 by radhia005 (see edit history) Link to comment Share on other sites More sharing options...
Mr6 Posted May 22, 2013 Share Posted May 22, 2013 As-tu regardé les modèles de mails ? Link to comment Share on other sites More sharing options...
Rdev Posted May 22, 2013 Author Share Posted May 22, 2013 oui , dans le fichier order_conf.html j'ai la variable {products}, cette variable affiche toute les informations du produit je veux modifier le contenu de cette variable et merci Mr6 Link to comment Share on other sites More sharing options...
carlitos666 Posted May 29, 2013 Share Posted May 29, 2013 (edited) quelqu'un aurait avancé là dessus ? Edited May 29, 2013 by carlitos666 (see edit history) Link to comment Share on other sites More sharing options...
sangria777 Posted June 5, 2013 Share Posted June 5, 2013 ça m’intéresse également, je ne vois pas d’où viens {products}, justement ! Quelqu'un a une idée ? Link to comment Share on other sites More sharing options...
sangria777 Posted June 5, 2013 Share Posted June 5, 2013 je viens de trouver sur un autre post 1 Link to comment Share on other sites More sharing options...
Rdev Posted June 6, 2013 Author Share Posted June 6, 2013 Merci bien sangria777 :) Link to comment Share on other sites More sharing options...
Rdev Posted June 6, 2013 Author Share Posted June 6, 2013 (edited) Bonjour à tous, j'ai réussi d'ajouter le prix TTC et HT sur l’émail de confirmation de commande dans le fichier classes/PaymentModule.php if (!$customization_quantity || (int)$product['cart_quantity'] > $customization_quantity) $products_list .= '<tr style="background-color: '.($key % 2 ? '#DDE2E6' : '#EBECEE').';"> <td style="padding: 0.6em 0.4em;width: 15%;">'.$product['reference'].'</td> <td style="padding: 0.6em 0.4em;width: 35%;"><strong>'.$product['name'].(isset($product['attributes']) ? ' - '.$product['attributes'] : '').'</strong></td> <td style="padding: 0.6em 0.4em; width: 20%;">'.Tools::displayPrice(Product::getTaxCalculationMethod() == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price, $this->context->currency, false).' HT <br /> '.Tools::displayPrice(Product::getTaxCalculationMethod() == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price_wt, $this->context->currency, false).' TTC</td> <td style="padding: 0.6em 0.4em; width: 10%;">'.((int)$product['cart_quantity'] - $customization_quantity).'</td> <td style="padding: 0.6em 0.4em; width: 20%;">'.Tools::displayPrice(((int)$product['cart_quantity'] - $customization_quantity) * (Product::getTaxCalculationMethod() == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price), $this->context->currency, false).' HT <br /> '.Tools::displayPrice(((int)$product['cart_quantity'] - $customization_quantity) * (Product::getTaxCalculationMethod() == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price_wt), $this->context->currency, false).' TTC</td> </tr>'; dans le fichier /mails/order_conf.html <table style="width: 100%; font-family: Verdana,sans-serif; font-size: 11px; color: #374953;"><!-- Title --> <tbody> <tr style="background-color: #b9babe; text-align: center;"> <th style="width: 15%; padding: 0.6em 0;">Référence</th> <th style="width: 35%; padding: 0.6em 0;">Produit</th><th style="width: 20%; padding: 0.6em 0;">Prix unitaire</th><th style="width: 10%; padding: 0.6em 0;">Quantité</th><th style="width: 20%; padding: 0.6em 0;">Prix total</th></tr> <tr> <td colspan="5">{products} </td> </tr> <tr> <td colspan="5">{discounts}</td> </tr> <tr style="text-align: right;"> <td> </td> <td style="background-color: #b9babe; padding: 0.6em 0.4em;" colspan="2">Total produits</td> <td style="background-color: #b9babe; padding: 0.6em 0.4em;">{total_productsht} HT<br />{total_products} TTC</td> </tr> </tbody> </table> et le résultat dans l'image ci-dessous Edited June 6, 2013 by radhia005 (see edit history) Link to comment Share on other sites More sharing options...
sangria777 Posted June 6, 2013 Share Posted June 6, 2013 Dis-moi radhia, d’où est-ce que tu sors ton : {total_productsht} ? Je souhaiterai faire la même chose !! Link to comment Share on other sites More sharing options...
sangria777 Posted June 6, 2013 Share Posted June 6, 2013 Bon j'ai trouvé ! ca se passe dans le fichier PayementModule.php Sur la fonction suivante : if ($id_order_state != Configuration::get('PS_OS_ERROR') && $id_order_state != Configuration::get('PS_OS_CANCELED') && $this->context->customer->id) Moi je suis ligne 566 (mais j'ai pu décaler certaines choses) A la fin, en dessous de total_wrapping, j'ai ajouté la ligne '{total_products_ht}'... '{total_wrapping}' => Tools::displayPrice($order->total_wrapping, $this->context->currency, false), '{total_products_ht}' => Tools::displayPrice($order->total_products, $this->context->currency, false), Voila !! Link to comment Share on other sites More sharing options...
Rdev Posted June 6, 2013 Author Share Posted June 6, 2013 (edited) les prix sont en HT ? moi j'ai mis dans la ligne 603 '{total_productsht}' => Tools::displayPrice($order->total_paid_tax_excl - $order->total_shipping_tax_excl - $order->total_wrapping_tax_excl + $order->total_discounts_tax_excl, $this->context->currency, false), Edited June 6, 2013 by radhia005 (see edit history) Link to comment Share on other sites More sharing options...
sangria777 Posted June 7, 2013 Share Posted June 7, 2013 Heu non, mais je viens de m’apercevoir que ça ne fonctionne pas dans l’environnement de prod. J'ai mal du contrôler, je regarde la semaine prochaine seulement !! J'ai une autre demande : je voudrais afficher le message du client !! Est-ce que c'est possible ? (mailalerte le fait) Mais je ne vois vraiment pas comment l'ajouter !! Link to comment Share on other sites More sharing options...
vermich Posted June 25, 2013 Share Posted June 25, 2013 avez vous du nouveau sur l'affichage du prix HT ? personnellement j'ai suivi vos explication mais j'ai toujours ça {total_productsht} HT 14,48 € TTC Link to comment Share on other sites More sharing options...
Rdev Posted June 25, 2013 Author Share Posted June 25, 2013 bonjour vermich tu est sur quelle version du prestashop ? Link to comment Share on other sites More sharing options...
Rdev Posted June 25, 2013 Author Share Posted June 25, 2013 sur la version 1.5.4.0 dans le fichier classes/PaymentModule.php ligne (382) if (!$customization_quantity || (int)$product['cart_quantity'] > $customization_quantity) $products_list .= '<tr style="background-color: '.($key % 2 ? '#DDE2E6' : '#EBECEE').';"> <td style="padding: 0.6em 0.4em;width: 15%;">'.$product['reference'].'</td> <td style="padding: 0.6em 0.4em;width: 35%;"><strong>'.$product['name'].(isset($product['attributes']) ? ' - '.$product['attributes'] : '').'</strong></td> <td style="padding: 0.6em 0.4em; width: 20%;">'.Tools::displayPrice(Product::getTaxCalculationMethod() == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price, $this->context->currency, false).' HT <br /> '.Tools::displayPrice(Product::getTaxCalculationMethod() == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price_wt, $this->context->currency, false).' TTC</td> <td style="padding: 0.6em 0.4em; width: 10%;">'.((int)$product['cart_quantity'] - $customization_quantity).'</td> <td style="padding: 0.6em 0.4em; width: 20%;">'.Tools::displayPrice(((int)$product['cart_quantity'] - $customization_quantity) * (Product::getTaxCalculationMethod() == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price), $this->context->currency, false).' HT <br /> '.Tools::displayPrice(((int)$product['cart_quantity'] - $customization_quantity) * (Product::getTaxCalculationMethod() == PS_TAX_EXC ? Tools::ps_round($price, 2) : $price_wt), $this->context->currency, false).' TTC</td> </tr>'; et dans la ligne (603) '{total_productsht}' => Tools::displayPrice($order->total_paid_tax_excl - $order->total_shipping_tax_excl - $order->total_wrapping_tax_excl + $order->total_discounts_tax_excl, $this->context->currency, false), et dans le fichier /mails/order_conf.html <table style="width: 100%; font-family: Verdana,sans-serif; font-size: 11px; color: #374953;"><!-- Title --> <tbody> <tr style="background-color: #b9babe; text-align: center;"> <th style="width: 15%; padding: 0.6em 0;">Référence</th> <th style="width: 35%; padding: 0.6em 0;">Produit</th><th style="width: 20%; padding: 0.6em 0;">Prix unitaire</th><th style="width: 10%; padding: 0.6em 0;">Quantité</th><th style="width: 20%; padding: 0.6em 0;">Prix total</th></tr> <tr> <td colspan="5">{products} </td> </tr> <tr> <td colspan="5">{discounts}</td> </tr> <tr style="text-align: right;"> <td> </td> <td style="background-color: #b9babe; padding: 0.6em 0.4em;" colspan="2">Total produits</td> <td style="background-color: #b9babe; padding: 0.6em 0.4em;">{total_productsht} HT<br />{total_products} TTC</td> </tr> </tbody> </table> Link to comment Share on other sites More sharing options...
vermich Posted June 25, 2013 Share Posted June 25, 2013 Après verification le prix HT apparait bien dans le mail envoyé au client. En fait je cherché à l'indiquer dans le mail que je reçoit par intermédiaire du module Alerte Maill Link to comment Share on other sites More sharing options...
Rdev Posted June 25, 2013 Author Share Posted June 25, 2013 j'ai pas modifié le module alert mail mais je pense qu'on modifie le fichier modules/mailalerts/mailalerts.php j'ai pas testé Link to comment Share on other sites More sharing options...
vermich Posted June 25, 2013 Share Posted June 25, 2013 C'est ca il suffit de copier coller ça ligne 379 : '{total_productsht}' => Tools::displayPrice($order->total_paid_tax_excl - $order->total_shipping_tax_excl - $order->total_wrapping_tax_excl + $order->total_discounts_tax_excl, $this->context->currency, false), Link to comment Share on other sites More sharing options...
vermich Posted June 25, 2013 Share Posted June 25, 2013 par contre j'aurais besoin du prix HT et TTC sur chaque produit, aurait tu une idée ? ça existe sur le mail de confirmation de commande envoyé au client et est stocké dans la balise {product} Dans Alerte Email la balise est {item} et ne semble stocké que le ttc. Link to comment Share on other sites More sharing options...
Rdev Posted June 25, 2013 Author Share Posted June 25, 2013 Dsl j'ai pas une idée si vous voulez je vais vous aider le soir bonne journée Link to comment Share on other sites More sharing options...
vermich Posted June 25, 2013 Share Posted June 25, 2013 C'est gentil, je vais essayer de détailler au maximum en attendant. la balise {item} ressort le prix par produit la quantité et le prix total par produit. Celle-ci contient : $items_table .= '<tr style="background-color:'.($key % 2 ? '#DDE2E6' : '#EBECEE').';"> <td style="padding:0.6em 0.4em;">'.$product['product_reference'].'</td> <td style="padding:0.6em 0.4em;"> <strong>' .$product['product_name'].(isset($product['attributes_small']) ? ' '.$product['attributes_small'] : '').(!empty($customization_text) ? '<br />'.$customization_text : ''). '</strong> </td> <td style="padding:0.6em 0.4em; text-align:right;">'.Tools::displayPrice($unit_price, $currency, false).'</td> <td style="padding:0.6em 0.4em; text-align:center;">'.(int)$product['product_quantity'].'</td> <td style="padding:0.6em 0.4em; text-align:right;">'.Tools::displayPrice(($unit_price * $product['product_quantity']), $currency, false).'</td> </tr>'; unit_price correspond au prix affiché récupère la valeur : $unit_price = $product['product_price_wt']; il faudrait donc resortir le prix produit sans taxe mais je ne sais pas comment il s'ecrit Link to comment Share on other sites More sharing options...
vermich Posted June 25, 2013 Share Posted June 25, 2013 j'ai trouvé, il faut remplacer $unit_price = $product['product_price_wt']; par $unit_price = $product['product_price']; Link to comment Share on other sites More sharing options...
sangria777 Posted June 26, 2013 Share Posted June 26, 2013 J'ai fait un nouveau point, les solutions ici fonctionnent très bien ! (Je vous confirme que ma ligne fonctionne. les taxes sont actives) j'ai trouvé ça : {id_order}' => sprintf('%06d', $order->id), Pour indiquer le numéro de la commande Je cherche à indiquer la remise (promo) d'un produit sur le mailalerte mais je n'y parviens pas ! Si quelqu'un a une idée !! Link to comment Share on other sites More sharing options...
tresorsdargan Posted June 29, 2013 Share Posted June 29, 2013 Bonjour, Travaillant surtout avec les pro, cette astuce m'est fort utile et bien suivi les infos et cela fonctionne à un détail près, les prix des produits sont affichés HT dans les 2 prix affichés HT et TTC, par contre le total reprend bien le montant HT et TTC (voir visu). SI quelqu'un pouvait m'orienter... Merci à vous Olivier Link to comment Share on other sites More sharing options...
chrisdig51 Posted April 11, 2014 Share Posted April 11, 2014 bonjour, avez vous trouvé une solution pour faire apparaître le prix en HT dans le mail de confirmation de commande? (Mail recu par le vendeur) Merci a vous Link to comment Share on other sites More sharing options...
chrisdig51 Posted April 11, 2014 Share Posted April 11, 2014 re bonjour, je me retrouve dans le meme cas de figure que tresordargan, c'est a dire que les deux prix affichés sont identique. (prix HT) merci pour votre aide Bonjour,Travaillant surtout avec les pro, cette astuce m'est fort utile et bien suivi les infos et cela fonctionne à un détail près, les prix des produits sont affichés HT dans les 2 prix affichés HT et TTC, par contre le total reprend bien le montant HT et TTC (voir visu).SI quelqu'un pouvait m'orienter...Merci à vousOlivier Link to comment Share on other sites More sharing options...
chrisdig51 Posted April 14, 2014 Share Posted April 14, 2014 Bonjour, je vous fais un petit up car j'ai toujours le meme probleme avec le prix HT qui s'affiche au lieu du prix TTC. merci de votre aide Link to comment Share on other sites More sharing options...
Rdev Posted April 14, 2014 Author Share Posted April 14, 2014 Bonjour, je vous fais un petit up car j'ai toujours le meme probleme avec le prix HT qui s'affiche au lieu du prix TTC. merci de votre aide bonjour, vous pouvez mettre votre code pour le vérifier ? Link to comment Share on other sites More sharing options...
chrisdig51 Posted April 14, 2014 Share Posted April 14, 2014 Bonjour, vous trouverez ci joint mes deux fichiers modifiés, j'ai repris les bout de code évoqués dans la discussion merci pour votre aide order_conf.html PaymentModule.php Link to comment Share on other sites More sharing options...
chrisdig51 Posted April 16, 2014 Share Posted April 16, 2014 Bonjour, est ce que vous avez trouvé quelque chose qui ne va pas dans mon code? merci a vous Link to comment Share on other sites More sharing options...
Rdev Posted April 16, 2014 Author Share Posted April 16, 2014 bonjour, votre code est identique à mon code, mais je n'ai pas trouvé je vais revoir le code après parce que je suis occupée maintenant, mais j'ai une question (vous travaillez sur quelle version du prestashop ? ) Link to comment Share on other sites More sharing options...
chrisdig51 Posted April 16, 2014 Share Posted April 16, 2014 je suis sur la version 1.5.4.1 Link to comment Share on other sites More sharing options...
chrisdig51 Posted May 11, 2014 Share Posted May 11, 2014 bonjour desolé de revenir vers vous mais j'ai toujours le même problème sur mon site merci a vous Link to comment Share on other sites More sharing options...
kotozisy Posted January 16, 2017 Share Posted January 16, 2017 Bonjour à tous, Je suis sur presta 1.6.1.10 et j'ai tenté de faire les modifications pour faire apparaitre le prix+livraison hors taxe mais le mail ne prend pas en compte mes modifications. Pouvez vous m'aider svp. Merci bcp Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now