kgt, on 07 June 2006, 15:27, said:
Hii KGT
First i want to thank you for your grate contribution Discount coupon code module. I already installed that. But im having problem passing discounted total to paypal
Im using osCommerce 2.2-MS2 with osCommerce_PayPal_IPN_v2.3.3 and KGT Discount coupon code module dc_autoinstaller_2.14_2_1
And i did some changes found on forum.
But still my discount amount does not transfer to paypal.Posted Image It shows total amount without applying Discount percentage.
When i try with bank transfer payment method it shows correct amount. If i used paypal payment method after first using
bank transfer payment method, then paypal also shows correct discounted total amount.
But if i try paypal as a payment method at the first place, it doesn't show discounted total.
I tried installing different paypal IPNs and discount module versions. But still my problem same.
If you have any idea how to fix this error please help me. i really appreciate any level of help.
Thank you so much in advance.
-----------------------------------------------------
i did following changes.
-----------------------------------------------------
1) I selected aggregate instead of individual On transaction type.
2)
FIND around line 195:
//+1.4
$sql_data_array = array('orders_id' => $insert_id,
'orders_status_id' => $order->info['order_status'],
'date_added' => 'now()',
'customer_notified' => '0',
'comments' => $order->info['comments']);
tep_db_perform(TABLE_ORDERS_STATUS_HISTORY, $sql_data_array);
//-1.4
ADD this code after:
//kgt - discount coupons
if( tep_session_is_registered( 'coupon' ) && is_object( $order->coupon ) ) {
$sql_data_array = array( 'coupons_id' => $order->coupon->coupon['coupons_id'],
'orders_id' => $insert_id );
tep_db_perform( TABLE_DISCOUNT_COUPONS_TO_ORDERS, $sql_data_array );
}
//end kgt - discount coupons
FIND around line 493:
// unregister session variables used during checkout
tep_session_unregister('sendto');
tep_session_unregister('billto');
tep_session_unregister('shipping');
tep_session_unregister('payment');
tep_session_unregister('comments');
ADD this code after:
//kgt - discount coupons
tep_session_unregister('coupon');
//end kgt - discount coupons
3)
FOLLOWING CODE:
if(MOVE_TAX_TO_TOTAL_AMOUNT == 'True') {
$parameters['amount'] = number_format(($subtotal + $order->info['tax']) * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
} else {
// default
$parameters['amount'] = number_format($subtotal * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
$parameters['tax'] = number_format($order->info['tax'] * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
}
Updated to THIS :
if(MOVE_TAX_TO_TOTAL_AMOUNT == 'True') {
if (isset($order_total['ot_gv']) || isset($order_total['ot_coupon'])) {
//the discount will apply to the order total
$parameters['amount'] = number_format((($subtotal + $order->info['tax'] + $shipping) * $currencies->get_value($my_currency)) - $order_total['ot_gv'] - $order_total['ot_coupon'], $currencies->get_decimal_places($my_currency));
}else{
$parameters['amount'] = number_format(($subtotal + $order->info['tax'] + $shipping) * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
}
} else {
// default
$parameters['amount'] = number_format(($subtotal + $shipping) * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
$parameters['tax'] = number_format($order->info['tax'] * $currencies->get_value($my_currency), $currencies->get_decimal_places($my_currency));
}