Hi there
FIRST off all, a HAPPY NEW YEAR to you all ...
I have made (still busy) a nice shopping system for my tattoo company.
Altough I managed to get all the nice effects and results with the calculation of totals and discount, it shows up nice and correct on my photo_shop_cart.php and photo_shop_checkout.php (first stages) pages. (checkout01.jpg).
Problem is when I click on "Confirm Order" on the photo_shop_checkout.php page, the amount being showed and emailed is totally wrong. I tried both the "$item_price" and "$order_price" to get the amounts, but it show it totally wrong. (checkout02.jpg).
I am attaching my checkout page as well.
The calculation code in the functions.inc.php page is like: (with some added ones I included):
$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]-$discount_calc+$shipping_calc),2);
$cd_price = number_format(($temp_price[1]),2);
$photo_price = number_format($temp_price[0],2);
$sub_total = number_format(($temp_price[0]-$discount_calc+$shipping_calc),2);
The calclation code in my photo_shop_checkout.php page is like:
//calculate the discount
$discount = number_format(calculate_discount($cd_price, $cd_counter),2);
$shipping_price = number_format(calculate_shipping(),2);
and
//here we do the integration... we just add the buttons, text etc to the msg_box
$item_price = number_format(($cd_price[0]+$cd_price[1]-$discount),2); // - discount (used for
paypal, google checkout)
$order_price = number_format(($cd_price[0]+$cd_price[1]+$shipping_price-$discount),2);
$msg_box_txt = $lang_photoshop['email_sent'];
$msg_box_txt .= '<br><br>'.$lang_photoshop['order_id'].' '.$order_id.', '.$lang_photoshop
['total'].' '.$order_price.' '.$lang_photoshop['USD'];
The problem is the $order_price that does not correspond to the $total_price (like in the 'functions.ini.php' page).
Can anyone assist in this matter ?
I have created a TEST user ( username: "test" and password "test") at
http://www.temp-tattoos.co.za/agents/ for those who would like to see.
Thanx in advance