Prestashop 1.7 add new variables into email total_shipping_tax_excl
up vote
0
down vote
favorite
I need delivery cost excluded tax in email confirmation. I made changes:
in email translation order_conf I put {total_shipping_tax_excl}
I made override in /override/classes/order/OrderHistory.php
class OrderHistory extends OrderHistoryCore
{
public function sendEmail($order, $template_vars = false)
{
$data = array(
'{total_shipping_tax_excl}' => Tools::displayPrice($order->total_shipping_tax_excl, $this->context->currency, false)
);
//die (print_r($data,true));
if ($template_vars) {
$data = array_merge($data, $template_vars);
}
return parent::sendEmail($order, $data);
}
}
Override works - if I make die (print_r($data,true)); I can see that proper value is in total_shipping_tax_excl key. Email translation works - I see new string. But when email is sent then I have just {total_shipping_tax_excl} string.
What am I missing?
email override prestashop-1.7
add a comment |
up vote
0
down vote
favorite
I need delivery cost excluded tax in email confirmation. I made changes:
in email translation order_conf I put {total_shipping_tax_excl}
I made override in /override/classes/order/OrderHistory.php
class OrderHistory extends OrderHistoryCore
{
public function sendEmail($order, $template_vars = false)
{
$data = array(
'{total_shipping_tax_excl}' => Tools::displayPrice($order->total_shipping_tax_excl, $this->context->currency, false)
);
//die (print_r($data,true));
if ($template_vars) {
$data = array_merge($data, $template_vars);
}
return parent::sendEmail($order, $data);
}
}
Override works - if I make die (print_r($data,true)); I can see that proper value is in total_shipping_tax_excl key. Email translation works - I see new string. But when email is sent then I have just {total_shipping_tax_excl} string.
What am I missing?
email override prestashop-1.7
I made change directly in /classes/order/OrderHistory.php but no results. It seems that something remembers what string can be modified.
– Barto
Nov 13 at 18:10
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I need delivery cost excluded tax in email confirmation. I made changes:
in email translation order_conf I put {total_shipping_tax_excl}
I made override in /override/classes/order/OrderHistory.php
class OrderHistory extends OrderHistoryCore
{
public function sendEmail($order, $template_vars = false)
{
$data = array(
'{total_shipping_tax_excl}' => Tools::displayPrice($order->total_shipping_tax_excl, $this->context->currency, false)
);
//die (print_r($data,true));
if ($template_vars) {
$data = array_merge($data, $template_vars);
}
return parent::sendEmail($order, $data);
}
}
Override works - if I make die (print_r($data,true)); I can see that proper value is in total_shipping_tax_excl key. Email translation works - I see new string. But when email is sent then I have just {total_shipping_tax_excl} string.
What am I missing?
email override prestashop-1.7
I need delivery cost excluded tax in email confirmation. I made changes:
in email translation order_conf I put {total_shipping_tax_excl}
I made override in /override/classes/order/OrderHistory.php
class OrderHistory extends OrderHistoryCore
{
public function sendEmail($order, $template_vars = false)
{
$data = array(
'{total_shipping_tax_excl}' => Tools::displayPrice($order->total_shipping_tax_excl, $this->context->currency, false)
);
//die (print_r($data,true));
if ($template_vars) {
$data = array_merge($data, $template_vars);
}
return parent::sendEmail($order, $data);
}
}
Override works - if I make die (print_r($data,true)); I can see that proper value is in total_shipping_tax_excl key. Email translation works - I see new string. But when email is sent then I have just {total_shipping_tax_excl} string.
What am I missing?
email override prestashop-1.7
email override prestashop-1.7
asked Nov 13 at 17:56
Barto
32829
32829
I made change directly in /classes/order/OrderHistory.php but no results. It seems that something remembers what string can be modified.
– Barto
Nov 13 at 18:10
add a comment |
I made change directly in /classes/order/OrderHistory.php but no results. It seems that something remembers what string can be modified.
– Barto
Nov 13 at 18:10
I made change directly in /classes/order/OrderHistory.php but no results. It seems that something remembers what string can be modified.
– Barto
Nov 13 at 18:10
I made change directly in /classes/order/OrderHistory.php but no results. It seems that something remembers what string can be modified.
– Barto
Nov 13 at 18:10
add a comment |
2 Answers
2
active
oldest
votes
up vote
1
down vote
I was also editing the email template for Order Confirmation. You need to edit PaymentModule.php for it to work. You can also set the email subject directly from this file.
Around line 756
// Send an e-mail to customer (one order = one email)
if ($id_order_state != Configuration::get('PS_OS_ERROR') && $id_order_state != Configuration::get('PS_OS_CANCELED') && $this->context->customer->id) {
$invoice = new Address((int)$order->id_address_invoice);
$delivery = new Address((int)$order->id_address_delivery);
add a comment |
up vote
0
down vote
accepted
Enthu was right. First problem was that confirmation email is generated in classes/PaymentModule.php not in /classes/order/OrderHistory.php .
Solution is to override original file or wait. I made pull request: https://github.com/PrestaShop/PrestaShop/issues/11396 and chage was accepted so {total_shipping_tax_excl} and {total_shipping_tax_incl} will be in 1.7.6
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
I was also editing the email template for Order Confirmation. You need to edit PaymentModule.php for it to work. You can also set the email subject directly from this file.
Around line 756
// Send an e-mail to customer (one order = one email)
if ($id_order_state != Configuration::get('PS_OS_ERROR') && $id_order_state != Configuration::get('PS_OS_CANCELED') && $this->context->customer->id) {
$invoice = new Address((int)$order->id_address_invoice);
$delivery = new Address((int)$order->id_address_delivery);
add a comment |
up vote
1
down vote
I was also editing the email template for Order Confirmation. You need to edit PaymentModule.php for it to work. You can also set the email subject directly from this file.
Around line 756
// Send an e-mail to customer (one order = one email)
if ($id_order_state != Configuration::get('PS_OS_ERROR') && $id_order_state != Configuration::get('PS_OS_CANCELED') && $this->context->customer->id) {
$invoice = new Address((int)$order->id_address_invoice);
$delivery = new Address((int)$order->id_address_delivery);
add a comment |
up vote
1
down vote
up vote
1
down vote
I was also editing the email template for Order Confirmation. You need to edit PaymentModule.php for it to work. You can also set the email subject directly from this file.
Around line 756
// Send an e-mail to customer (one order = one email)
if ($id_order_state != Configuration::get('PS_OS_ERROR') && $id_order_state != Configuration::get('PS_OS_CANCELED') && $this->context->customer->id) {
$invoice = new Address((int)$order->id_address_invoice);
$delivery = new Address((int)$order->id_address_delivery);
I was also editing the email template for Order Confirmation. You need to edit PaymentModule.php for it to work. You can also set the email subject directly from this file.
Around line 756
// Send an e-mail to customer (one order = one email)
if ($id_order_state != Configuration::get('PS_OS_ERROR') && $id_order_state != Configuration::get('PS_OS_CANCELED') && $this->context->customer->id) {
$invoice = new Address((int)$order->id_address_invoice);
$delivery = new Address((int)$order->id_address_delivery);
answered 2 days ago
Enthu
13010
13010
add a comment |
add a comment |
up vote
0
down vote
accepted
Enthu was right. First problem was that confirmation email is generated in classes/PaymentModule.php not in /classes/order/OrderHistory.php .
Solution is to override original file or wait. I made pull request: https://github.com/PrestaShop/PrestaShop/issues/11396 and chage was accepted so {total_shipping_tax_excl} and {total_shipping_tax_incl} will be in 1.7.6
add a comment |
up vote
0
down vote
accepted
Enthu was right. First problem was that confirmation email is generated in classes/PaymentModule.php not in /classes/order/OrderHistory.php .
Solution is to override original file or wait. I made pull request: https://github.com/PrestaShop/PrestaShop/issues/11396 and chage was accepted so {total_shipping_tax_excl} and {total_shipping_tax_incl} will be in 1.7.6
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
Enthu was right. First problem was that confirmation email is generated in classes/PaymentModule.php not in /classes/order/OrderHistory.php .
Solution is to override original file or wait. I made pull request: https://github.com/PrestaShop/PrestaShop/issues/11396 and chage was accepted so {total_shipping_tax_excl} and {total_shipping_tax_incl} will be in 1.7.6
Enthu was right. First problem was that confirmation email is generated in classes/PaymentModule.php not in /classes/order/OrderHistory.php .
Solution is to override original file or wait. I made pull request: https://github.com/PrestaShop/PrestaShop/issues/11396 and chage was accepted so {total_shipping_tax_excl} and {total_shipping_tax_incl} will be in 1.7.6
answered yesterday
Barto
32829
32829
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53286923%2fprestashop-1-7-add-new-variables-into-email-total-shipping-tax-excl%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
I made change directly in /classes/order/OrderHistory.php but no results. It seems that something remembers what string can be modified.
– Barto
Nov 13 at 18:10