Jump to content
Sign in to follow this  
amal2004

DISCOUNTED TOTAL DOESN'T PASS TO PAYPAL - Please Help

Recommended Posts

Hii All

 

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.blink.png 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 doesnt show discounted total.

 

I tried installing different paypal IPNs and discount module versions. But still my problem same.

If you guys have any idea how to fix this error please help me. i really appriciate 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));

}

Share this post


Link to post
Share on other sites

The KGT Discount coupon code is different to Credit Class & Gift Voucher module, this is a reason it doesn't work and the $order_total['ot_gv'] and $order_total['ot_coupon'] is irrelevant.


Please read this line: Do you want to find all the answers to your questions? click here. As for contribution database it's located here!

8 people out of 10 don't bother to read installation manuals. I can recommend: if you can't read the installation manual, don't bother to install any contribution yourself.

Before installing contribution or editing/updating/deleting any files, do the full backup, it will save to you & everyone here on the forum time to fix your issues.

Any issues with oscommerce, I am here to help you.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×