Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Recommended Posts

Posted (edited)

I found out that even with the most update CCGV module installed, there is still problem when order total = 0 after using the coupon.

I finally made up my mine and try to found out the problem.

I spent a whole day ( Canada Day) to try to fix the problem.

 

Here is what I did and it seems that the problem is solved.

I hope it can help some people who is also struggling.

 

Let me know if there is any better way to do this. :)

 

checkout_process.php

find
if ($credit_covers) $payment='credit covers';   
 $payment_modules = new payment($payment);

change to
if ($credit_covers) $payment='credit_covers';   //mod
 $payment_modules = new payment($payment);


checkout_payment.php

find
// Start - CREDIT CLASS Gift Voucher Contribution
 require(DIR_WS_CLASSES . 'order_total.php');
 $order_total_modules = new order_total;

 $order_total_modules->clear_posts();

change to
// Start - CREDIT CLASS Gift Voucher Contribution
 require(DIR_WS_CLASSES . 'order_total.php');
 $order_total_modules = new order_total;
 $order_total_modules->pre_confirmation_check();
 $order_total_modules->clear_posts();


find
// load all enabled payment modules
 require(DIR_WS_CLASSES . 'payment.php');
 $payment_modules = new payment;

change to
require(DIR_WS_CLASSES . 'payment.php');
 if ($credit_covers) $payment='credit_covers';   //mod
 $payment_modules = new payment($payment);



order_total.php

find
$gv_query=tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
       $gv_result=tep_db_fetch_array($gv_query);
       $gv_payment_amount = $gv_result['amount'];

       if ($order->info['total'] - $gv_payment_amount <= 0 ) {
         if (tep_session_is_registered('cot_gv')) {
         	if(!tep_session_is_registered('credit_covers')) tep_session_register('credit_covers');
           $credit_covers = true;
         }
       } else {   // belts and suspenders to get rid of credit_covers variable if it gets set once and they put something else in the cart
   	    if(tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers');
     	}


change to
$gv_query=tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
       $gv_result=tep_db_fetch_array($gv_query);
       $gv_payment_amount = $gv_result['amount'];

       if ($order->info['total'] - $total_deductions <= 0.005 ) {
//         if (tep_session_is_registered('cot_gv')) {
         	if(!tep_session_is_registered('credit_covers')) tep_session_register('credit_covers');
           $credit_covers = true;
//         }
       } else {   // belts and suspenders to get rid of credit_covers variable if it gets set once and they put something else in the cart
   	    if(tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers');
     	}

 

 

Albert Wong

discountcorner.ca

Edited by discountcorner
  • 4 months later...
Posted

I found out that even with the most update CCGV module installed, there is still problem when order total = 0 after using the coupon.

I finally made up my mine and try to found out the problem.

I spent a whole day ( Canada Day) to try to fix the problem.

 

Here is what I did and it seems that the problem is solved.

I hope it can help some people who is also struggling.

 

Let me know if there is any better way to do this. :)

 

checkout_process.php

find
if ($credit_covers) $payment='credit covers';   
 $payment_modules = new payment($payment);

change to
if ($credit_covers) $payment='credit_covers';   //mod
 $payment_modules = new payment($payment);


checkout_payment.php

find
// Start - CREDIT CLASS Gift Voucher Contribution
 require(DIR_WS_CLASSES . 'order_total.php');
 $order_total_modules = new order_total;

 $order_total_modules->clear_posts();

change to
// Start - CREDIT CLASS Gift Voucher Contribution
 require(DIR_WS_CLASSES . 'order_total.php');
 $order_total_modules = new order_total;
 $order_total_modules->pre_confirmation_check();
 $order_total_modules->clear_posts();


find
// load all enabled payment modules
 require(DIR_WS_CLASSES . 'payment.php');
 $payment_modules = new payment;

change to
require(DIR_WS_CLASSES . 'payment.php');
 if ($credit_covers) $payment='credit_covers';   //mod
 $payment_modules = new payment($payment);



order_total.php

find
$gv_query=tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
       $gv_result=tep_db_fetch_array($gv_query);
       $gv_payment_amount = $gv_result['amount'];

       if ($order->info['total'] - $gv_payment_amount <= 0 ) {
         if (tep_session_is_registered('cot_gv')) {
         	if(!tep_session_is_registered('credit_covers')) tep_session_register('credit_covers');
           $credit_covers = true;
         }
       } else {   // belts and suspenders to get rid of credit_covers variable if it gets set once and they put something else in the cart
   	    if(tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers');
     	}


change to
$gv_query=tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");
       $gv_result=tep_db_fetch_array($gv_query);
       $gv_payment_amount = $gv_result['amount'];

       if ($order->info['total'] - $total_deductions <= 0.005 ) {
//         if (tep_session_is_registered('cot_gv')) {
         	if(!tep_session_is_registered('credit_covers')) tep_session_register('credit_covers');
           $credit_covers = true;
//         }
       } else {   // belts and suspenders to get rid of credit_covers variable if it gets set once and they put something else in the cart
   	    if(tep_session_is_registered('credit_covers')) tep_session_unregister('credit_covers');
     	}

 

 

Albert Wong

discountcorner.ca

 

You are a star man. Works perfect.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...