MaartenPol Posted July 1, 2010 Share Posted July 1, 2010 Is it possible to show the prices excluding tax in the order confirmation? I found out that the prices called in the mail_conf.html file are defined in the classes/PaymentModule.php but I can't figure out how to define a price without tax.Thanks Link to comment Share on other sites More sharing options...
rocky Posted July 2, 2010 Share Posted July 2, 2010 Yes, you just have to change the first parameter in the getOrderTotal() function calls from true to false. Do you want the tax to be included on the order, but excluded on the email that is sent? That may be confusing if the customer views their order history and sees different prices than the email they were sent. 1 Link to comment Share on other sites More sharing options...
MaartenPol Posted July 2, 2010 Author Share Posted July 2, 2010 Well, I have a B2B website. All prices on the website are nicely ex tax. But on the final invoice there has to be tax displayed as the other company of course has to pay taxes. In the cart and PDF invoice I got it all sorted out. Only the mail is quite a pain. So what I try to accomplish is that the product prices are -tax, the totals should also be -tax. But at the end I need to display the tax and the total + tax.So something like this: product price -tax ------------ total total -tax tax tax ------------ total total +tax If it matters, I have presta 1.3.1.1 Link to comment Share on other sites More sharing options...
rocky Posted July 3, 2010 Share Posted July 3, 2010 It is the following code in classes/PaymentModules.php that you need to change: '{total_paid}' => Tools::displayPrice($order->total_paid, $currency, false, false), '{total_products}' => Tools::displayPrice($order->total_paid - $order->total_shipping - $order->total_wrapping + $order->total_discounts, $currency, false, false), '{total_discounts}' => Tools::displayPrice($order->total_discounts, $currency, false, false), '{total_shipping}' => Tools::displayPrice($order->total_shipping, $currency, false, false), '{total_wrapping}' => Tools::displayPrice($order->total_wrapping, $currency, false, false)); {total_paid} is the last total line above (so it should include tax), {total_products} is the product line above (so it should exclude tax). I'm not sure about the other two lines above. I guess you'll need to change new variables for them. As an example, you can remove the tax in the total products by changing the {total_products} line above to: '{total_products}' => Tools::displayPrice($order->total_products), I hope it points you in the right direction. Link to comment Share on other sites More sharing options...
MaartenPol Posted July 6, 2010 Author Share Posted July 6, 2010 I ended up making some extra php variables: $total_products_notax = $order->total_products; $total_products = $order->total_paid - $order->total_shipping - $order->total_wrapping + $order->total_discounts; $total_paid_notax = $total_products_notax + $order->total_shipping + $order->total_wrapping - $order->total_discounts; $total_paid = $total_paid_notax * 1.19; $total_tax = $total_paid - $total_paid_notax; I call those variables in the $data array : '{total_paid}' => Tools::displayPrice($total_paid, $currency, false, false), '{total_paid_notax}' => Tools::displayPrice($total_paid_notax, $currency, false, false), '{total_products}' => Tools::displayPrice($total_products, $currency, false, false), '{total_products_notax}' => Tools::displayPrice($total_products_notax), '{total_discounts}' => Tools::displayPrice($order->total_discounts, $currency, false, false), '{total_shipping}' => Tools::displayPrice($order->total_shipping, $currency, false, false), '{total_tax}' => Tools::displayPrice($total_tax, $currency, false, false), '{total_wrapping}' => Tools::displayPrice($order->total_wrapping, $currency, false, false)); I works fine now. There is only one thing bothering me. Here I use hard coded the tax rate: $total_paid = $total_paid_notax * 1.19; How to get that out?? Link to comment Share on other sites More sharing options...
mirec Posted August 3, 2010 Share Posted August 3, 2010 Hello, can anyone post me the right way, how to show in order confirmation mail total price with tax, total price without tax and total tax? thanks in advance Link to comment Share on other sites More sharing options...
netman Posted September 14, 2010 Share Posted September 14, 2010 Hi MaartenPol,Could you post your modified PaymentModule.php file? I got stuck with some of the coding. Your help is much appreciated.Thanks Link to comment Share on other sites More sharing options...
klubas Posted October 25, 2010 Share Posted October 25, 2010 dear rocky,How to make Unit price to show without tax in products table (order_conf.html) ? Link to comment Share on other sites More sharing options...
rocky Posted October 26, 2010 Share Posted October 26, 2010 Have you tried going to Customers > Groups, editing the customer groups and changing "Price display method" to "Tax excluded"? If that doesn't do what you want, you will need to manually edit the code on lines 243 and 254: '.Tools::displayPrice(Product::getTaxCalculationMethod() == PS_TAX_EXC ? $price : $price_wt, $currency, false, false).' Comment out the code so that the price without tax is always displayed. For example: '.Tools::displayPrice(/*Product::getTaxCalculationMethod() == PS_TAX_EXC ? */$price/* : $price_wt*/, $currency, false, false).' Link to comment Share on other sites More sharing options...
klubas Posted October 26, 2010 Share Posted October 26, 2010 Thank you, rockyCode editing solution helped realy much! Now I can show both unit price+tx, and price-tx in same mail. Link to comment Share on other sites More sharing options...
klubas Posted October 26, 2010 Share Posted October 26, 2010 Dear rocky, one problem in Total price at (order_conf):now if product price (without tx) is 14,35eur and quantity is 2pcs. then total price is shown 28,69eur (not 28,70eur as should) one cent is mising...I think problem is with this line: '.Tools::displayPrice((intval($product['cart_quantity']) - $customizationQuantity) * (Product::getTaxCalculationMethod() == PS_TAX_EXC ? $price : $price_wt), $currency, false, false).' Link to comment Share on other sites More sharing options...
rocky Posted October 27, 2010 Share Posted October 27, 2010 Try using the Tools::ps_round function like this: '.Tools::displayPrice(Tools::ps_round((intval($product['cart_quantity']) - $customizationQuantity) * (Product::getTaxCalculationMethod() == PS_TAX_EXC ? $price : $price_wt), 2), $currency, false, false).' Link to comment Share on other sites More sharing options...
klubas Posted October 27, 2010 Share Posted October 27, 2010 No this did not worked. It it is still showing 28,69eur.... Link to comment Share on other sites More sharing options...
Arieswe Posted February 4, 2011 Share Posted February 4, 2011 Kubas, what did you do??? I have the same problem. The invoice is ok (thank god) but the email conf is not ok. Link to comment Share on other sites More sharing options...
klubas Posted February 9, 2011 Share Posted February 9, 2011 I did not found the solution Link to comment Share on other sites More sharing options...
Arieswe Posted February 10, 2011 Share Posted February 10, 2011 Hej Klubas, I've made some changes and for me it is ok. You can give it a try. I have added this to PaymentModule.php.(around line 230) $unit_price = Product::getPriceStatic($product['id_product'], (bool)(Product::getTaxCalculationMethod() == PS_TAX_INC), $product['id_product_attribute'], 2, NULL, false, true, $product['cart_quantity']); The $unit_price calculation is now ok. And i have changed the display within the td. old situation '.Tools::displayPrice((intval($product['cart_quantity']) - $customizationQuantity) * (Product::getTaxCalculationMethod() == PS_TAX_EXC ? $price : $price_wt), $currency, false, false).' new situation '.Tools::displayPrice(($unit_price * $product['cart_quantity']), $currency, false, false).' Display with the rounded unit_price. This is working for me in Version 1.3.2.3 Link to comment Share on other sites More sharing options...
ScubaLessonsInc Posted October 11, 2011 Share Posted October 11, 2011 So having solved this can you explain it so others will be able to do it? What file gets edited, exactly where? Change what to what? Does this work in 1.4.4.1? Link to comment Share on other sites More sharing options...
Noracuts Posted November 6, 2012 Share Posted November 6, 2012 It is the following code in classes/PaymentModules.php that you need to change: '{total_paid}' => Tools::displayPrice($order->total_paid, $currency, false, false), '{total_products}' => Tools::displayPrice($order->total_paid - $order->total_shipping - $order->total_wrapping + $order->total_discounts, $currency, false, false), '{total_discounts}' => Tools::displayPrice($order->total_discounts, $currency, false, false), '{total_shipping}' => Tools::displayPrice($order->total_shipping, $currency, false, false), '{total_wrapping}' => Tools::displayPrice($order->total_wrapping, $currency, false, false)); {total_paid} is the last total line above (so it should include tax), {total_products} is the product line above (so it should exclude tax). I'm not sure about the other two lines above. I guess you'll need to change new variables for them. As an example, you can remove the tax in the total products by changing the {total_products} line above to: '{total_products}' => Tools::displayPrice($order->total_products), I hope it points you in the right direction. I'm trying to do a similar thing with my shop (PS 1.5.1) I understand to edit paymentmodules.php, but which file and where do I add the calculations for the new variables? I would like to have shipping (without tax), Total (without tax), Total tax, Grand Total... Link to comment Share on other sites More sharing options...
kmikruta Posted March 14, 2015 Share Posted March 14, 2015 Hello,Is there any working solution for 1.6.0.9 ? Link to comment Share on other sites More sharing options...
rocky Posted March 14, 2015 Share Posted March 14, 2015 What specifically are you wanting a solution for? There's actually a few different questions in this topic. Link to comment Share on other sites More sharing options...
scolink Posted January 22, 2016 Share Posted January 22, 2016 I have the same problem, i want that appears in mail confirmation prices without taxes how can i do that ? What i have to edit please 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