Prestashop 1.7 add new variables into email total_shipping_tax_excl










0















I need delivery cost excluded tax in email confirmation. I made changes:



  1. in email translation order_conf I put total_shipping_tax_excl



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










share|improve this question






















  • 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 '18 at 18:10
















0















I need delivery cost excluded tax in email confirmation. I made changes:



  1. in email translation order_conf I put total_shipping_tax_excl



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










share|improve this question






















  • 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 '18 at 18:10














0












0








0








I need delivery cost excluded tax in email confirmation. I made changes:



  1. in email translation order_conf I put total_shipping_tax_excl



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










share|improve this question














I need delivery cost excluded tax in email confirmation. I made changes:



  1. in email translation order_conf I put total_shipping_tax_excl



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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 13 '18 at 17:56









BartoBarto

33829




33829












  • 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 '18 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 '18 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 '18 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 '18 at 18:10













2 Answers
2






active

oldest

votes


















1














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);





share|improve this answer






























    0














    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






    share|improve this answer






















      Your Answer






      StackExchange.ifUsing("editor", function ()
      StackExchange.using("externalEditor", function ()
      StackExchange.using("snippets", function ()
      StackExchange.snippets.init();
      );
      );
      , "code-snippets");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "1"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: true,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: 10,
      bindNavPrevention: true,
      postfix: "",
      imageUploader:
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      ,
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













      draft saved

      draft discarded


















      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

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      1














      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);





      share|improve this answer



























        1














        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);





        share|improve this answer

























          1












          1








          1







          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);





          share|improve this answer













          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);






          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 29 '18 at 6:03









          EnthuEnthu

          13010




          13010























              0














              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






              share|improve this answer



























                0














                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






                share|improve this answer

























                  0












                  0








                  0







                  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






                  share|improve this answer













                  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







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Nov 30 '18 at 10:21









                  BartoBarto

                  33829




                  33829



























                      draft saved

                      draft discarded
















































                      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.




                      draft saved


                      draft discarded














                      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





















































                      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







                      Popular posts from this blog

                      Use pre created SQLite database for Android project in kotlin

                      Darth Vader #20

                      Ondo