[Skip to main content](#vessel-content)

#   Adding sub total to Order Created email

##

- **[DenisLeemkuil](/forum/user/12312-denisleemkuil "View DenisLeemkuil's Profile")**
- [![DenisLeemkuil's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/12312-denisleemkuil "View DenisLeemkuil's Profile") Topic Author
- [ Offline](/forum/user/12312-denisleemkuil)

Less More

- Posts: 6
- Thank you received: 0
-
-

13 years 10 months ago [\#82971](#82971) by [DenisLeemkuil](/forum/user/12312-denisleemkuil "View DenisLeemkuil's Profile")  *[Adding sub total to Order Created email](/forum/4-how-to/76947-adding-sub-total-to-order-created-email#82971 "Hi Guys,  For our shop I'm trying to add the sub total to one of the email messages. I've attached a screenshot which is in Dutch, but I'm sure you get the idea. I've seen many examples where $data-&gt;cart-&gt;order&#95;subtotal and $data-&gt;cart-&gt;order&#95;subtotal&#95;no&#95;vat are used. But for me it just keeps returning 0. I must be missing something.  I've tried different approaches but this was my starting point:  Complete message:  I could do some calculations from within the product loop. But I was wondering if there isn't a cleaner way to go about this.  Cheers, Willem")* was created by *[DenisLeemkuil](/forum/user/12312-denisleemkuil "View DenisLeemkuil's Profile")*

Hi Guys,

For our shop I'm trying to add the sub total to one of the email messages. I've attached a screenshot which is in Dutch, but I'm sure you get the idea. I've seen many examples where $data-&gt;cart-&gt;order_subtotal and $data-&gt;cart-&gt;order_subtotal_no_vat are used. But for me it just keeps returning 0. I must be missing something.

I've tried different approaches but this was my starting point: Code:

echo '&lt;tr&gt;&lt;td colspan="'.$colspan.'" style="text-align:right"&gt;'.JText::_('SUBTOTAL').': '; if($config-&gt;get('price_with_tax')){ echo $currencyHelper-&gt;format($data-&gt;cart-&gt;order_subtotal,$data-&gt;order_currency_id); }else{ echo $currencyHelper-&gt;format($data-&gt;cart-&gt;order_subtotal_no_vat,$data-&gt;order_currency_id); } echo '&lt;/td&gt;&lt;/tr&gt;';

Complete message: Code:

&lt;?php /** * @package HikaShop for Joomla! * @version 2.0.0 * @author hikashop.com * @copyright (C) 2010-2012 HIKARI SOFTWARE. All rights reserved. * @license GNU/GPLv3 http://www.gnu.org/licenses/gpl-3.0.html */ defined('_JEXEC') or die('Restricted access'); ?&gt;&lt;div style="background-color: #ffffff; font-family: Verdana, Arial, Helvetica, sans-serif;font-size:12px; color: #000000; width: 100%;"&gt; &lt;table style="margin: auto;font-family: Verdana, Arial, Helvetica, sans-serif;font-size:12px;" border="0" cellspacing="0" cellpadding="0"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td height="10"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;?php echo JText::sprintf('HI_CUSTOMER',@$data-&gt;customer-&gt;name);?&gt; &lt;br/&gt; &lt;br/&gt; &lt;?php $colspan = 4; $url = $data-&gt;order_number; $config =&amp; hikashop_config(); if($config-&gt;get('simplified_registration',0)!=2){ $url = '&lt;a href="'.$data-&gt;order_url.'"&gt;'. $url.'&lt;/a&gt;'; } echo JText::sprintf('ORDER_CREATION_SUCCESS_ON_WEBSITE_AT_DATE',$url,HIKASHOP_LIVE, hikashop_getDate(time(),'%d %B %Y'), hikashop_getDate(time(),'%H:%M'));?&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td height="10"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;h1 style="background-color:#DDDDDD;font-size:14px;width:100%;padding:5px;"&gt;&lt;?php echo JText::_('SUMMARY_OF_YOUR_ORDER');?&gt;&lt;/h1&gt; &lt;br/&gt; &lt;table width="100%" style="font-family: Verdana, Arial, Helvetica, sans-serif;font-size:12px;"&gt; &lt;tr&gt; &lt;td style="font-weight:bold;"&gt;&lt;?php echo JText::_('CART_PRODUCT_NAME'); ?&gt;&lt;/td&gt; &lt;?php if ($config-&gt;get('show_code')) { $colspan++; ?&gt; &lt;td style="font-weight:bold;"&gt;&lt;?php echo JText::_('CART_PRODUCT_CODE'); ?&gt;&lt;/td&gt; &lt;?php } ?&gt; &lt;td style="font-weight: bold;"&gt;&lt;?php echo JText::_('CART_PRODUCT_UNIT_PRICE'); ?&gt;&lt;/td&gt; &lt;td style="font-weight: bold;"&gt;&lt;?php echo JText::_('CART_PRODUCT_QUANTITY'); ?&gt;&lt;/td&gt; &lt;td style="font-weight: bold; text-align: right;"&gt;&lt;?php echo JText::_('HIKASHOP_TOTAL'); ?&gt; &lt;/td&gt; &lt;/tr&gt; &lt;?php if(hikashop_level(2)){ $fieldsClass = hikashop_get('class.field'); $null = null; $itemFields = $fieldsClass-&gt;getFields('frontcomp',$null,'item'); } $group = $config-&gt;get('group_options',0); foreach($data-&gt;cart-&gt;products as $item){ if($group &amp;&amp; $item-&gt;cart_product_option_parent_id) continue; ?&gt; &lt;tr&gt; &lt;td&gt; &lt;p&gt; &lt;?php echo $item-&gt;order_product_name; if($group){ $display_item_price=false; foreach($data-&gt;cart-&gt;products as $j =&gt; $optionElement){ if($optionElement-&gt;cart_product_option_parent_id != $item-&gt;cart_product_id) continue; if($optionElement-&gt;order_product_price&gt;0){ $display_item_price = true; } } if($display_item_price){ if($config-&gt;get('price_with_tax')){ echo ' '.$currencyHelper-&gt;format($item-&gt;order_product_price+$item-&gt;order_product_tax,$data-&gt;order_currency_id); }else{ echo ' '.$currencyHelper-&gt;format($item-&gt;order_product_price,$data-&gt;order_currency_id); } } } ?&gt; &lt;/p&gt;&lt;?php if(!empty($itemFields)){ foreach($itemFields as $field){ $namekey = $field-&gt;field_namekey; if(empty($item-&gt;$namekey)) continue; echo '&lt;p&gt;'.$fieldsClass-&gt;getFieldName($field).': '.$fieldsClass-&gt;show($field,$item-&gt;$namekey).'&lt;/p&gt;'; } } $optionsPrices = new stdClass(); $optionsPrices-&gt;order_product_price=0; $optionsPrices-&gt;order_product_tax=0; $optionsPrices-&gt;order_product_total_price=0; $optionsPrices-&gt;order_product_total_price_no_vat=0; if($group){ foreach($data-&gt;cart-&gt;products as $j =&gt; $optionElement){ if($optionElement-&gt;cart_product_option_parent_id == 0 &#124;&#124; $optionElement-&gt;cart_product_option_parent_id != $item-&gt;cart_product_id) continue; $optionsPrices-&gt;order_product_price +=$optionElement-&gt;order_product_price; $optionsPrices-&gt;order_product_tax +=$optionElement-&gt;order_product_tax; $optionsPrices-&gt;order_product_total_price+=$optionElement-&gt;order_product_total_price; $optionsPrices-&gt;order_product_total_price_no_vat+=$optionElement-&gt;order_product_total_price_no_vat; ?&gt; &lt;p class="hikashop_order_option_name"&gt; &lt;?php echo $optionElement-&gt;order_product_name; if($optionElement-&gt;order_product_price&gt;0){ if($config-&gt;get('price_with_tax')){ echo ' ( + '.$currencyHelper-&gt;format($optionElement-&gt;order_product_price+$optionElement-&gt;order_product_tax,$data-&gt;order_currency_id).' )'; }else{ echo ' ( + '.$currencyHelper-&gt;format($optionElement-&gt;order_product_price,$data-&gt;order_currency_id).' )'; } } ?&gt; &lt;/p&gt; &lt;?php } } $statusDownload = explode(',',$config-&gt;get('order_status_for_download','confirmed,shipped')); if(in_array($data-&gt;order_status,$statusDownload)){ if(!empty($item-&gt;files)){ global $Itemid; $url_itemid = ''; if(!empty($Itemid)){ $url_itemid='&amp;Itemid='.$Itemid; } echo '&lt;p&gt;'; foreach($item-&gt;files as $file){ $fileName = empty($file-&gt;file_name) ? $file-&gt;file_path : $file-&gt;file_name; echo '&lt;a href="'.hikashop_frontendLink('index.php?option=com_hikashop&amp;ctrl=order&amp;task=download&amp;file_id='.$file-&gt;file_id.'&amp;order_id='.$data-&gt;order_id.$url_itemid).'"&gt;'.$fileName.'&lt;/a&gt;&lt;br/&gt;'; } echo '&lt;/p&gt;'; } } ?&gt; &lt;/td&gt; &lt;?php if ($config-&gt;get('show_code')) { ?&gt; &lt;td&gt;&lt;p class="hikashop_product_code_mail"&gt;&lt;?php echo $item-&gt;order_product_code; ?&gt;&lt;/p&gt;&lt;/td&gt; &lt;?php } ?&gt; &lt;td&gt; &lt;?php if($config-&gt;get('price_with_tax')){ echo $currencyHelper-&gt;format($item-&gt;order_product_price+$optionsPrices-&gt;order_product_price+$item-&gt;order_product_tax+$optionsPrices-&gt;order_product_tax,$data-&gt;order_currency_id); }else{ echo $currencyHelper-&gt;format($item-&gt;order_product_price+$optionsPrices-&gt;order_product_price,$data-&gt;order_currency_id); } ?&gt; &lt;/td&gt; &lt;td&gt;&lt;?php echo $item-&gt;order_product_quantity; ?&gt;&lt;/td&gt; &lt;td style="text-align: right"&gt; &lt;?php if($config-&gt;get('price_with_tax')){ echo $currencyHelper-&gt;format($item-&gt;order_product_total_price+$optionsPrices-&gt;order_product_total_price,$data-&gt;order_currency_id); }else{ echo $currencyHelper-&gt;format($item-&gt;order_product_total_price_no_vat+$optionsPrices-&gt;order_product_total_price_no_vat,$data-&gt;order_currency_id); } ?&gt; &lt;/td&gt; &lt;/tr&gt; &lt;?php } // Start custom sub total echo '&lt;tr&gt;&lt;td colspan="'.$colspan.'" style="text-align:right"&gt;'.JText::_('SUBTOTAL').': '; if($config-&gt;get('price_with_tax')){ echo $currencyHelper-&gt;format($data-&gt;cart-&gt;order_subtotal,$data-&gt;order_currency_id); }else{ echo $currencyHelper-&gt;format($data-&gt;cart-&gt;order_subtotal_no_vat,$data-&gt;order_currency_id); } echo '&lt;/td&gt;&lt;/tr&gt;'; // End sub total if(bccomp($data-&gt;order_discount_price,0,5)){ echo '&lt;tr&gt;&lt;td colspan="'.$colspan.'" style="text-align:right"&gt;'.JText::_('HIKASHOP_COUPON').': '; if($config-&gt;get('price_with_tax')){ echo $currencyHelper-&gt;format($data-&gt;order_discount_price*-1,$data-&gt;order_currency_id); }else{ echo $currencyHelper-&gt;format(($data-&gt;order_discount_price-@$data-&gt;order_discount_tax)*-1,$data-&gt;order_currency_id); } echo '&lt;/td&gt;&lt;/tr&gt;'; } if(bccomp($data-&gt;order_shipping_price,0,5)){ echo '&lt;tr&gt;&lt;td colspan="'.$colspan.'" style="text-align:right"&gt;'.JText::_('HIKASHOP_SHIPPING_METHOD').': '; if($config-&gt;get('price_with_tax')){ echo $currencyHelper-&gt;format($data-&gt;order_shipping_price,$data-&gt;order_currency_id); }else{ echo $currencyHelper-&gt;format($data-&gt;order_shipping_price-@$data-&gt;order_shipping_tax,$data-&gt;order_currency_id); } echo '&lt;/td&gt;&lt;/tr&gt;'; } if(bccomp($data-&gt;order_payment_price,0,5)){ echo '&lt;tr&gt;&lt;td colspan="'.$colspan.'" style="text-align:right"&gt;'.JText::_('HIKASHOP_PAYMENT_METHOD').': '.$currencyHelper-&gt;format($data-&gt;order_payment_price,$data-&gt;order_currency_id).'&lt;/td&gt;&lt;/tr&gt;'; } if(!empty($data-&gt;cart-&gt;additional)) { $exclude_additionnal = explode(',', $config-&gt;get('order_additional_hide', '')); foreach($data-&gt;cart-&gt;additional as $additional) { if(in_array($additional-&gt;name, $exclude_additionnal)) continue; echo '&lt;tr&gt;&lt;td colspan="'.$colspan.'" style="text-align:right"&gt;'. JText::_($additional-&gt;name).': '; if(!empty($additional-&gt;price_value) &#124;&#124; empty($additional-&gt;value)) { if($config-&gt;get('price_with_tax')){ echo $currencyHelper-&gt;format($additional-&gt;price_value_with_tax, $data-&gt;order_currency_id); }else{ echo $currencyHelper-&gt;format($additional-&gt;price_value, $data-&gt;order_currency_id); } } else { echo $additional-&gt;value; } echo '&lt;/td&gt;&lt;/tr&gt;'; } } if($data-&gt;cart-&gt;full_total-&gt;prices[0]-&gt;price_value!=$data-&gt;cart-&gt;full_total-&gt;prices[0]-&gt;price_value_with_tax){ if($config-&gt;get('detailed_tax_display') &amp;&amp; !empty($data-&gt;order_tax_info)){ foreach($data-&gt;order_tax_info as $tax){ echo '&lt;tr&gt;&lt;td colspan="'.$colspan.'" style="text-align:right"&gt;'.$tax-&gt;tax_namekey. ': '.$currencyHelper-&gt;format($tax-&gt;tax_amount,$data-&gt;order_currency_id).'&lt;/td&gt;&lt;/tr&gt;'; } }else{ echo '&lt;tr&gt;&lt;td colspan="'.$colspan.'" style="text-align:right"&gt;'.JText::sprintf('TOTAL_WITHOUT_VAT',$currencyHelper-&gt;format($data-&gt;cart-&gt;full_total-&gt;prices[0]-&gt;price_value,$data-&gt;order_currency_id)).'&lt;/td&gt;&lt;/tr&gt;'; } $text=JText::sprintf('TOTAL_WITH_VAT',$currencyHelper-&gt;format($data-&gt;cart-&gt;full_total-&gt;prices[0]-&gt;price_value_with_tax,$data-&gt;order_currency_id)); }else{ $text=JText::_('HIKASHOP_FINAL_TOTAL'). ': '.$currencyHelper-&gt;format($data-&gt;cart-&gt;full_total-&gt;prices[0]-&gt;price_value_with_tax,$data-&gt;order_currency_id); } echo '&lt;tr&gt;&lt;td colspan="'.$colspan.'" style="text-align:right;font-weight:bold;"&gt;'.$text.'&lt;/td&gt;&lt;/tr&gt;'; ?&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td height="10"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt; &lt;table width="100%" style="border: 1px solid #DDDDDD;font-family: Verdana, Arial, Helvetica, sans-serif;font-size:12px;"&gt; &lt;?php $params = null; $js = ''; $fieldsClass = hikashop_get('class.field'); $app =&amp; JFactory::getApplication(); if($app-&gt;isAdmin()){ $view = 'order'; }else{ $view = 'address'; } $template = trim(hikashop_getLayout($view,'address_template',$params,$js)); if(!empty($data-&gt;cart-&gt;billing_address)){ $billing = $template; foreach($data-&gt;order_addresses_fields as $field){ $fieldname = $field-&gt;field_namekey; $address =&amp; $data-&gt;order_addresses[$data-&gt;cart-&gt;billing_address-&gt;address_id]; $billing=str_replace('{'.$fieldname.'}',$fieldsClass-&gt;show($field,$address-&gt;$fieldname),$billing); } echo '&lt;tr&gt;&lt;td style="font-weight:bold;background-color:#DDDDDD"&gt;'.JText::_('HIKASHOP_BILLING_ADDRESS').'&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;'; echo str_replace(array("\r\n","\r","\n"),'&lt;br/&gt;',preg_replace('#{(?:(?!}).)*}#i','',$billing)).'&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;'; } if(!empty($data-&gt;order_shipping_method)) { $currentShipping = hikashop_import('hikashopshipping',$data-&gt;order_shipping_method); if(method_exists($currentShipping, 'getShippingAddress')) { $override = $currentShipping-&gt;getShippingAddress($data-&gt;order_shipping_id); if($override !== false) { $data-&gt;override_shipping_address = $override; } } } if(!empty($data-&gt;override_shipping_address) &#124;&#124; (!empty($data-&gt;cart-&gt;has_shipping) &amp;&amp; !empty($data-&gt;cart-&gt;shipping_address))) echo '&lt;tr&gt;&lt;td style="font-weight:bold;background-color:#DDDDDD"&gt;'.JText::_('HIKASHOP_SHIPPING_ADDRESS').'&lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt;'; if(!empty($data-&gt;override_shipping_address)) { echo $data-&gt;override_shipping_address.'&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;'; } else if(!empty($data-&gt;cart-&gt;has_shipping) &amp;&amp; !empty($data-&gt;cart-&gt;shipping_address)){ $shipping = $template; foreach($data-&gt;order_addresses_fields as $field){ $fieldname = $field-&gt;field_namekey; $address =&amp; $data-&gt;order_addresses[$data-&gt;cart-&gt;shipping_address-&gt;address_id]; $shipping=str_replace('{'.$fieldname.'}',$fieldsClass-&gt;show($field,$address-&gt;$fieldname),$shipping); } echo str_replace(array("\r\n","\r","\n"),'&lt;br/&gt;',preg_replace('#{(?:(?!}).)*}#i','',$shipping)).'&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;'; }?&gt; &lt;/table&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;?php $fields = $fieldsClass-&gt;getFields('frontcomp',$data,'order',''); foreach($fields as $fieldName =&gt; $oneExtraField) { if(empty($data-&gt;$fieldName)) continue; echo "&lt;br/&gt;".$fieldsClass-&gt;trans($oneExtraField-&gt;field_realname).': '.$fieldsClass-&gt;show($oneExtraField,$data-&gt;$fieldName); } ?&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td height="10"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;?php // Start payment method $class = hikashop_get('class.payment'); $payment = $class-&gt;get($data-&gt;order_payment_id); echo JText::_('HIKASHOP_CHECKOUT_PAYMENT').': '.$payment-&gt;payment_name; // End payment method ?&gt;.&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td height="10"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;?php JPluginHelper::importPlugin('hikashop'); $dispatcher = JDispatcher::getInstance(); $dispatcher-&gt;trigger('onAfterOrderProductsListingDisplay', array(&amp;$data-&gt;cart, 'email_notification_html')); ?&gt; &lt;tr&gt; &lt;td&gt; &lt;?php if(!$app-&gt;isAdmin()){ if($data-&gt;cart-&gt;full_total-&gt;prices[0]-&gt;price_value_with_tax&gt;0) echo JText::_('ORDER_VALID_AFTER_PAYMENT'); $config =&amp; hikashop_config(); if($data-&gt;cart-&gt;full_total-&gt;prices[0]-&gt;price_value_with_tax&gt;0 &amp;&amp; hikashop_level(1) &amp;&amp; $config-&gt;get('allow_payment_button',1)){ global $Itemid; $url = ''; if(!empty($Itemid)){ $url='&amp;Itemid='.$Itemid; } $pay_url = hikashop_frontendLink('index.php?option=com_hikashop&amp;ctrl=order&amp;task=pay&amp;order_id='.$data-&gt;order_id.$url); if($config-&gt;get('force_ssl',0) &amp;&amp; strpos('https://',$pay_url) === false) { $pay_url = str_replace('http://','https://',$pay_url); } ?&gt; &lt;a href="$pay_url"&gt;&lt;?php JText::_('PAY_NOW'); ?&gt;&lt;/a&gt; &lt;?php } ?&gt; &lt;br/&gt; &lt;br/&gt; &lt;?php echo JText::sprintf('THANK_YOU_FOR_YOUR_ORDER',HIKASHOP_LIVE); }?&gt; &lt;br/&gt; &lt;br/&gt; &lt;?php echo JText::sprintf('BEST_REGARDS_CUSTOMER',$mail-&gt;from_name);?&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td height="10"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td height="10"&gt; &lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt;

I could do some calculations from within the product loop. But I was wondering if there isn't a cleaner way to go about this.

Cheers,
Willem

- [ ![subtotal.png](/forum/attachment/7679) ](/forum/attachment/7679 "subtotal.png") [ ](/forum/attachment/7679?download=1 "subtotal.png")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc2OTQ3LWFkZGluZy1zdWItdG90YWwtdG8tb3JkZXItY3JlYXRlZC1lbWFpbD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

13 years 10 months ago [\#83121](#83121) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Adding sub total to Order Created email](/forum/4-how-to/76947-adding-sub-total-to-order-created-email#83121 "Hi Guys,  For our shop I'm trying to add the sub total to one of the email messages. I've attached a screenshot which is in Dutch, but I'm sure you get the idea. I've seen many examples where $data-&gt;cart-&gt;order&#95;subtotal and $data-&gt;cart-&gt;order&#95;subtotal&#95;no&#95;vat are used. But for me it just keeps returning 0. I must be missing something.  I've tried different approaches but this was my starting point:  Complete message:  I could do some calculations from within the product loop. But I was wondering if there isn't a cleaner way to go about this.  Cheers, Willem")*

Hi,

I don't know where you found "order_subtotal" but this variable never exists in HikaShop.
The cart object have to prices variables : full_total and total.
Both are object with prices array and price_value/price_value_with_tax values.

So you can use the same part of code than the "full_total" but with "total".

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

The following user(s) said Thank You: [DenisLeemkuil](/forum/user/12312-denisleemkuil "View DenisLeemkuil's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc2OTQ3LWFkZGluZy1zdWItdG90YWwtdG8tb3JkZXItY3JlYXRlZC1lbWFpbD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

- **[DenisLeemkuil](/forum/user/12312-denisleemkuil "View DenisLeemkuil's Profile")**
- [![DenisLeemkuil's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/12312-denisleemkuil "View DenisLeemkuil's Profile") Topic Author
- [ Offline](/forum/user/12312-denisleemkuil)

Less More

- Posts: 6
- Thank you received: 0
-
-

13 years 10 months ago [\#83138](#83138) by [DenisLeemkuil](/forum/user/12312-denisleemkuil "View DenisLeemkuil's Profile")  Replied by *[DenisLeemkuil](/forum/user/12312-denisleemkuil "View DenisLeemkuil's Profile")* on topic *[Adding sub total to Order Created email](/forum/4-how-to/76947-adding-sub-total-to-order-created-email#83138 "Hi Guys,  For our shop I'm trying to add the sub total to one of the email messages. I've attached a screenshot which is in Dutch, but I'm sure you get the idea. I've seen many examples where $data-&gt;cart-&gt;order&#95;subtotal and $data-&gt;cart-&gt;order&#95;subtotal&#95;no&#95;vat are used. But for me it just keeps returning 0. I must be missing something.  I've tried different approaches but this was my starting point:  Complete message:  I could do some calculations from within the product loop. But I was wondering if there isn't a cleaner way to go about this.  Cheers, Willem")*

That did it, thanks for the help!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQtaG93LXRvLzc2OTQ3LWFkZGluZy1zdWItdG90YWwtdG8tb3JkZXItY3JlYXRlZC1lbWFpbD90bXBsPW1hcmtkb3du) or [Create an account](/register) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.063 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
