Stramm, I swear I've tried and tried and tried to do this myself and I just can't get it... Please, would you help me? I've learned alot going about it on my own but not enough to make this one work.
What I'm trying to do is add tax to the TOTAL and have that be the total amount emailed and listed to the user and the administrator.
I've screen shotted and will give you an example, and I also have the tax code setup working the way I need it to. The problem is I can NOT figure out how to add tax to the total amount.
Here is the code I'm using in coppermine/plugins/photo_shop/include/functions.inc.php
//calculate and format total, discount, shipping
function photoshop_format_price($temp_price, $cd_counter, $error='', $template){
global $lang_photoshop, $SHOP_CONFIG;
$out =array();
$discount_calc = calculate_discount($temp_price, $cd_counter);
$shipping_calc = calculate_shipping();
$discount = number_format(($discount_calc),2);
$shipping = number_format(($shipping_calc),2);
$tot_price = number_format(($temp_price[1]+$temp_price[0]+$shipping_calc-$discount_calc),2);
$tax = number_format(($tot_price*.0825),2);
$cd_price = number_format($temp_price[1],2);
$photo_price = number_format($temp_price[0],2);
if ($cd_price > 0) {
$cd_price2 = "{$lang_photoshop['on_cd']}: {$cd_counter['cd']} {$lang_photoshop['pics']} :: $cd_price{$lang_photoshop['USD']} <br />";
} else $cd_price2 = '';
if ($photo_price > 0) {
$photo_price2 = "{$lang_photoshop['for_print']}: {$cd_counter['photo']} {$lang_photoshop['pics']} :: $photo_price{$lang_photoshop['USD']} <br />";
} else $photo_price2 = '';
if ($tot_price > 0) {
if ($shipping > 0) {
$total_price = "{$lang_photoshop['shipping']} :: ".$shipping."{$lang_photoshop['USD']} <br>";
} else $total_price = "";
if ($discount > 0) {
$total_price .= "{$lang_photoshop['discount']} :: % {$discount}{$lang_photoshop['USD']} ";
}
$total_price .= "<hr size=\"1\" width=\"200\" align=\"right\" /> ";
$total_price .= "{$lang_photoshop['total']}: {$tot_price}{$lang_photoshop['USD']} ";
} else $tot_price = '';
$out['html'] = <<<EOT
<tr>
<td colspan="6" align="center">
<hr size="1" />
</td>
</tr>
<tr>
<td colspan="6" align="right">
{$photo_price2}
{$cd_price2}{$error}
Tax.: {$tax}{$lang_photoshop['USD']} <br>
{$total_price}
</td>
</tr>
EOT;
$out['text'] = sprintf("%+63s\n\n", '');
if ($photo_price > 0) { $out['text'] .= sprintf("%+63s\n", $lang_photoshop['for_print'].': '. $cd_counter['photo'].' '.$lang_photoshop['pics'].' :: '.$photo_price.$lang_photoshop['USD']); }
if ($cd_price > 0) { $out['text'] .= sprintf("%+63s\n", $lang_photoshop['on_cd'].': '. $cd_counter['cd'].' '.$lang_photoshop['pics'].' :: '.$cd_price.$lang_photoshop['USD']); }
if ($shipping > 0) { $out['text'] .= sprintf("%+63s\n", $lang_photoshop['shipping'].' :: '.$shipping.$lang_photoshop['USD']); }
if ($discount > 0) { $out['text'] .= sprintf("%+63s\n", $lang_photoshop['discount'].' :: %'.$discount.$lang_photoshop['USD']); }
$out['text'] .= sprintf("%+63s\n", 'Incl. MWSt: '.$tax.$lang_photoshop['USD']);
$out['text'] .= sprintf("%+63s\n", '--------------------------');
$out['text'] .= sprintf("%+63s\n", $lang_photoshop['total'].': '.$tot_price.$lang_photoshop['USD']);
return $out[$template];
}
Thank you in advance, I swear if i could have figured this out I would have done it myself!