Magento Expert Forum - Improve your Magento experience

Results 1 to 4 of 4

Order totals not showing in new order email

  1. #1
    New member
    Join Date
    May 2016
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Order totals not showing in new order email

    Hi!

    I am new to these forums, however hopefully somebody will be able to point me in the right direction..

    I currently have Magento 1.9.2.4 installed using RWD and a child theme.

    For some unknown reason, when a new order is placed, the New Order Email which gets sent does not include the totals such as;

    Sub Total
    Shipping & Handling
    Tax
    Grand Total

    I have searched and searched to see why this may be happening, I have copied files over from another Magento RWD which I know works, checked sales.xml etc... and it all seems to match!


    Below is an example of it working on a development website, you will see the section working;

    Name:  ss_321.jpg
Views: 325
Size:  25.0 KB


    Below is an example working on our website, as you can see there is no 'Totals Block';

    Name:  ss_321ddfd.jpg
Views: 322
Size:  19.3 KB


    I have now run out of ideas... any help would be greatly appreciated!!

    Thanks

    View more threads in the same category:


  2. #2
    Junior Member
    Join Date
    Jun 2016
    Location
    Bhavnagar, Gujarat, India
    Posts
    1,125
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Default

    Possible reason for the error is conflict with some custom extension. Try to disable custom extension if there. Also verify that template is successfully loaded in admin system -> Transaction Email section.

  3. #3
    Expert
    Join Date
    Mar 2016
    Location
    india
    Posts
    570
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Hi,

    If you look in

    layout/sales.xml:268

    You will see the layout handle sales_email_order_items. Inside there is a block "order_totals", which has that template. To add a new total to the email you would just have to add it as a child of that. On line 275 you can see they add a block named 'tax'.

    Inside the totals.phtml file you can see it call $this->getTotals() as part of a foreach. That method is defined at

    Mage/Sales/Block/Order/Totals.php:281

    This just returns the totals that are already defined. This data is populated by config.xml files that have defined:

    <global><sales><quote><totals>...

    Jumping back to totals.phtml, it checks if the total has a block defined for it. This would be a field in the config.xml file. If you have a totals model you want to customize you would do it that way.

    Otherwise, before the page is rendered (call to _beforeToHtml() on line 44) it interates over the child blocks and, if they respond to the method 'initTotals', calls that method. That method should create an object that represents your total and add it to the parent. For example, here is the code for a totals block I recently wrote (which is based on code I can't post publicly):

    public function initTotals()
    {
    if ((float)$this->getParentBlock()->getSource()->getMytotalAmount() == 0) {
    return $this;
    }
    $total = new Varien_Object(array(
    'code' => $this->getNameInLayout(),
    'block_name'=> $this->getNameInLayout(),
    'area' => $this->getArea()
    ));
    $after = $this->getAfterTotal();
    if (!$after) {
    $after = 'subtotal';
    }
    $this->getParentBlock()->addTotal($total, $after);
    return $this;
    }

  4. #4
    Junior Member
    Join Date
    Sep 2018
    Location
    Oman, Muscat
    Posts
    2,084
    Thanks
    0
    Thanked 4 Times in 4 Posts

    Default

    ooCommerce – remove Total and Subtotal from order emails being shown on my email templates, amongst the new order information text . the email to your theme, so you're not altering the core WooCommerce version.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •