yasic Posted November 22, 2012 Share Posted November 22, 2012 Hi, i'm starting to get crazy here, I want to change the order confirmation mail and i want to include: Total products price without taxes Discounts Delivery without taxes All taxes combined (products + delivery) Total price with tax I can't find the hooks to use in the mail template, the only one that works correctly is total_paid Can someone tell me which hooks to use to get the list above? Thanks Link to comment Share on other sites More sharing options...
yasic Posted November 23, 2012 Author Share Posted November 23, 2012 Is this that complicated? If someone can give me a link with some further reading, i'd be very thankful Link to comment Share on other sites More sharing options...
yasic Posted November 28, 2012 Author Share Posted November 28, 2012 Sorry for reposting again, but my problem is really more complicated than i thought, i need the total price without taxes, the taxes total as well as the price with taxes only for one language which is why i don't know how to change the mail settings in php. anyone? Link to comment Share on other sites More sharing options...
sebkos Posted November 28, 2012 Share Posted November 28, 2012 Hi yasic, all variables (hooks as you said) for order confirmation mail are prepared in PaymentModule.php class. Look at that file and investigate what variables you can use in mail templates. If you need other ones just add them into that class. Mail templates are separate files for each language so there is no problem to show "price with tax" only for one. Link to comment Share on other sites More sharing options...
yasic Posted November 28, 2012 Author Share Posted November 28, 2012 Hi yasic, all variables (hooks as you said) for order confirmation mail are prepared in PaymentModule.php class. Look at that file and investigate what variables you can use in mail templates. If you need other ones just add them into that class. Mail templates are separate files for each language so there is no problem to show "price with tax" only for one. hi sebkos, thanks for your help, the problem is i haven't found a site yet where i can see how to write new variables, could you give me an example or a link? thanks Link to comment Share on other sites More sharing options...
sebkos Posted November 28, 2012 Share Posted November 28, 2012 Some hints you can find in mentioned file. For example there are shipping costs with and without tax $order->total_shipping_tax_excl = (float)$this->context->cart->getPackageShippingCost((int)$id_carrier, false, null, $order->product_list); $order->total_shipping_tax_incl = (float)$this->context->cart->getPackageShippingCost((int)$id_carrier, true, null, $order->product_list); only thing to do is to add them to variables '{total_shipping_incl}' => Tools::displayPrice($order->total_shipping_tax_incl, $this->context->currency, false), '{total_shipping_excl}' => Tools::displayPrice($order->total_shipping_tax_excl, $this->context->currency, false), and then use those variables in mail template <td style="background-color: #dde2e6; padding: 0.6em 0.4em;">{total_shipping_incl}</td> <td style="background-color: #dde2e6; padding: 0.6em 0.4em;">{total_shipping_excl}</td> Link to comment Share on other sites More sharing options...
yasic Posted November 30, 2012 Author Share Posted November 30, 2012 this makes things clearer, but i tried with the shipping costs first, i added them to the variables and then to the mail template, but now it always shows shipping costs at 0€ and the total_products is now without taxes. what is it that i'm missing? Link to comment Share on other sites More sharing options...
sebkos Posted November 30, 2012 Share Posted November 30, 2012 It works for me, that example didn't touch products prices. Compare original files and modified ones, maybe there are typographic errors. 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