You have to add this calculation as well into the function sendEmailWithOrderDetails in /core/orders.php beacause the data for the e-mail will be created new, from saved!!! entry in database. and i suppose, you don't save the orderSummary3 into DB. put them after the call: '$aData=$this->throwOrder($iOrder);' and remember: the variables now will be called: $this->aOrders[$iOrder]['xxxxx'] and NOT $aOrder['xxxxx']
Still no hey-hoo's. changed orderSummary3 to Tax and yes, i don't want to save it into DB
in file action_client/p.php after line $sOrderProducts = $oOrder->listProducts( 'orders_print.tpl', $iOrder, 'ORDER_PRINT_' ); added $aOrder['Tax'] = round(($aOrder['sOrderSummary'] - ($aOrder['sOrderSummary'] / 1.2)), 2);
in file core/orders.php after line $aData['sOrderSummary'] = $this->aOrders[$iOrder]['sOrderSummary']; added $aData['Tax'] = $this->aOrders[$iOrder]['Tax'];
in file orders_print.tpl in section <!-- BEGIN ORDER_PRINT --> i can see $aOrder[Tax] value, but in sectoin <!-- BEGIN ORDER_PRINT_HEAD --> and <!-- BEGIN CUSTOMER_ORDER_EMAIL_BODY --> i can't see no $aOrder[Tax], or $aData[Tax] values.
Still no luck... I tryed to add php code to order_print.tpl to do calculation there with $aData[sOrderSummary], cos i see $aData[sOrderSummary] in e-mail, but this also not working.
you can't round $aData[sOrderSummary] because the format of the sSummary (s=string) could be something like: 1,000.30 It would make no sense to the system to 'multiply' that string.
Also, I am not sure if you should use $aData array because $aOrder['fSummary'] or $this->aOrders[$iOrder]['fSummary'] as bobo suggested could hold the content you need.
yes i can round and will get value as i need $tax = round(($aOrder['sOrderSummary'] - ($aOrder['sOrderSummary'] / 1.2)), 2); $aOrder['fOrderSummary3'] = round(($aOrder['sOrderSummary'] - ($aOrder['sOrderSummary'] / 1.2)), 2); (lines from action_client/p.php) but this number will NOT go to e-mail http://raudselt.puustjapunaseks.ee/tax.gif
why, what for??? i just added 1 (one!) line in /core/orders.php in function sendEmailWithOrderDetails and in function sendEmailToCustomerWithOrderDetails over the line: $oTpl->setVariables( 'aData', $aData ); the added line is: $aData['fTax']=normalizePrice(round($aData['sOrderSummary']-($aData['sOrderSummary']/1.2),2)); and one line in /templates/orders_print.tpl under the line: $lang[Summary_cost]: $aData[sOrderSummary] $config[currency_symbol] i added: VAT: $aData[fTax] $config[currency_symbol] that's all and it works. just tested.
the line: VAT: $aData[fTax] $config[currency_symbol] you have to add in BLOCK: <!-- BEGIN CUSTOMER_ORDER_EMAIL_BODY --> and if you want to get the e-mail with tax (as admin), so put the line into BLOCK: <!-- BEGIN ORDER_EMAIL_BODY --> as well.
did you add the line: $aData['fTax']=normalizePrice(round($aData['sOrderSummary']-($aData['sOrderSummary']/1.2),2)); in both functions??? (sendEmailWith... and sendEmailToCustomerWith...)
added sendEmail( $aSend, null, $GLOBALS['config']['orders_email'] ); to function sendEmailToCustomerWithOrderDetails and bloked same line in sendEmailWithOrderDetails
In older versions I used boboo's code to display vat in email to admin/customer (see his post from 2011-04-26 05:45:29). Who can tell me how to integrate it into new quickcart version?
Guido
I added this in old version: File core/orders: $aData['fTax']=normalizePrice(round($aData['sOrderSummary']-($aData['sOrderSummary']/1.2),2)); File templates/orders_print.tpl VAT: $aData[fTax] $config[currency_symbol]