Jump to content
NimaP

One Page Checkout Support

Recommended Posts

Hi there is a guide here in these froum use search and bottom and search for STS

 

version should be in includes/application_top.php look for

// Define the project version

 

Steve

 

Thanks Steve. It worked. I am facing another problem about the coupon. This is the query string I get checkout.php?payment_error=ot_coupon. The coupon gets validated by validate button but still it redirects with the same error. Any ideas?

Thanks

Share this post


Link to post
Share on other sites

Thansk for a greate contribution, the One Page Checkout looks very good :D

 

Is there any one that can point me in the right direction?

 

I have installed the contribution that makes it possible for customers to choose between displaying all prices "Inc. VAT" or "Ex. VAT": http://addons.oscommerce.com/info/3408/v,22

 

Now when the customer chooses Ex VAT the price will be calculated as a 25% discount.

 

What file and line number calculates the (tax, total sum) in the shopping chart for One Page Checkout?

 

If you all ready have both contributions installed I would be very happy for some code samples also :thumbsup:

Share this post


Link to post
Share on other sites

Thanks Steve. It worked. I am facing another problem about the coupon. This is the query string I get checkout.php?payment_error=ot_coupon. The coupon gets validated by validate button but still it redirects with the same error. Any ideas?

Thanks

 

Hi see if you had to add any code in the normal checkout files if so add the code in checkout.php

 

Steve

Share this post


Link to post
Share on other sites

Hi You might need to change code for the KGT in catalog/checkout.php

 

  //BOF KGT
 if (MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true'){
   if(isset($_POST['code']))
   {
     if(!tep_session_is_registered('coupon'))
       tep_session_register('coupon');
     $coupon = $_POST['code'];
   }
 }
 //EOF KGT

 

  //BOF KGT
 onePage.kgtInstalled = <?php echo (MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true' ? 'true' : 'false');?>;
 //EOF KGT

 

Steve

Share this post


Link to post
Share on other sites

Thansk for a greate contribution, the One Page Checkout looks very good :D

 

Is there any one that can point me in the right direction?

 

I have installed the contribution that makes it possible for customers to choose between displaying all prices "Inc. VAT" or "Ex. VAT": http://addons.oscommerce.com/info/3408/v,22

 

Now when the customer chooses Ex VAT the price will be calculated as a 25% discount.

 

What file and line number calculates the (tax, total sum) in the shopping chart for One Page Checkout?

 

If you all ready have both contributions installed I would be very happy for some code samples also :thumbsup:

 

I found the file

Linje 208 and 232 in includes/classes/onepage_checkout.php

 

find the code:

if (DISPLAY_PRICE_WITH_TAX == 'true'){

 

replays with the code

global $vat_disp;

if ($vat_disp == '1') {

 

Torgrim

Share this post


Link to post
Share on other sites

Hi Guys and girls

 

Just checking to see if anyone has managed to get OPC working with STS?

 

I am getting a number of faults,

 

With STS turned on

 

1- I get a blank page if you are logged on or not.

 

With STS turned off

 

1- The pages look fine but I get the following error

1146 - Table 'xxxxx.table_coupon_gv_customer' doesn't exist

 

select amount from TABLE_COUPON_GV_CUSTOMER where customer_id='2'

 

2- The order total I get a zero amount

 

3 - If I am already logged in and go to the checkout I only get the information down to the payment method, and none of the buttons work.

 

If anyone has come across these issue before, how did you fix them.

 

cheers

Simon

Share this post


Link to post
Share on other sites

is there any way of this god damn addon working without the coupons module

 

after trying to make sense of all the pages in this thread and failing misserably, this still doesnt work

 

 

a) i dont have or want the damn coupons addon

B) after installing all you get is error with database,

 

1146 - Table '??????.TABLE_COUPON_GV_CUSTOMER' doesn't exist

 

select amount from TABLE_COUPON_GV_CUSTOMER where customer_id = '55'

 

and after trying numberous suggestions in here to fix it, i just get more errors

 

c) why cant we just have this addon contribution without the god damn coupons - why is life so hard


If it don't fit - Get a bigger hammer

Share this post


Link to post
Share on other sites

I have an Idea how about taking out the KGT and other mods out of the main code and put in instructions on how to put them back in if the person has or wants those mods. I think it might be better for all.

Share this post


Link to post
Share on other sites

is there any way of this god damn addon working without the coupons module

 

after trying to make sense of all the pages in this thread and failing misserably, this still doesnt work

 

 

a) i dont have or want the damn coupons addon

B) after installing all you get is error with database,

 

1146 - Table '??????.TABLE_COUPON_GV_CUSTOMER' doesn't exist

 

select amount from TABLE_COUPON_GV_CUSTOMER where customer_id = '55'

 

and after trying numberous suggestions in here to fix it, i just get more errors

 

c) why cant we just have this addon contribution without the god damn coupons - why is life so hard

Hi

 

simply add defines in includes/database_tables.php before the ?>

ie

define(.TABLE_COUPON_GV_CUSTOMER,'');

 

error gone

Share this post


Link to post
Share on other sites

Hi Guys and girls

 

Just checking to see if anyone has managed to get OPC working with STS?

 

I am getting a number of faults,

 

With STS turned on

 

1- I get a blank page if you are logged on or not.

 

With STS turned off

 

1- The pages look fine but I get the following error

1146 - Table 'xxxxx.table_coupon_gv_customer' doesn't exist

 

select amount from TABLE_COUPON_GV_CUSTOMER where customer_id='2'

 

2- The order total I get a zero amount

 

3 - If I am already logged in and go to the checkout I only get the information down to the payment method, and none of the buttons work.

 

If anyone has come across these issue before, how did you fix them.

 

cheers

Simon

 

Hi Simon,

 

use the search box at the bottom of this thread and search for STS you will find out how to get it to work

 

Steve

Share this post


Link to post
Share on other sites

Has anyone actually figured out how to get OPC to work with KGT yet? Was it not tested with a version of KGT when adding the code into the contribution to see if it worked? :(

Share this post


Link to post
Share on other sites

Has anyone actually figured out how to get OPC to work with KGT yet? Was it not tested with a version of KGT when adding the code into the contribution to see if it worked? :(

Hi

 

It would have been tested, but we dont know what version, they person had on their site when itwebexperts customised it for them

 

Steve

Share this post


Link to post
Share on other sites

Hi

 

It would have been tested, but we dont know what version, they person had on their site when itwebexperts customised it for them

 

Steve

 

Ah I see. Dammit. There seems to be a lot of people that are having the same problem, so it would be fantastic if someone had the knowledge to make it work correctly.

Share this post


Link to post
Share on other sites

Hi

 

It would have been tested, but we dont know what version, they person had on their site when itwebexperts customised it for them

 

Steve

 

or add this to includes/application_top.php

find

 

require('includes/configure.php');

 

 

add after it

 

define('MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS','false');

define('MODULE_ORDER_TOTAL_COUPON_STATUS','false');

 

 

 

now no code needs to be removed

 

Steve

 

This post has been edited by steve_s: 05 January 2010 - 05:44 PM

 

 

 

Hi everyone,

 

Well it's very disappointing that one page checkout 1.11 doesn't seem to work with KGT coupons. I would think that this would be important for just about everyone with a shopping cart using OSC so it would've been fixed a long time ago. In the meanwhile, is the best way to disable coupons for now to add these defines to application_top.php or does that lead to any other unforeseen problems?

 

Thanks,

 

Nick

Share this post


Link to post
Share on other sites

Oh I didn't remove any code, I just went into admin->modules->order total then uninstalled the Discount Coupons bit.

Share this post


Link to post
Share on other sites

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where customer_id = '3'' at line 1

 

select amount from where customer_id = '3'

 

 

Wow, now I'm seeing this new problem that happens even though I uninstalled 'discount coupon' in admin>modules>order total and cut out all the KGT code in checkout.php and includes/classes/onepage_checkout.php.

 

It happens when a returning customer tries to login. I've had 'purchase without account' installed and working for a while and I set 'require login' to true in admin>configuration>one page checkout. Any ideas?

 

Thanks,

 

Nick

Share this post


Link to post
Share on other sites

One Page Checkout. I could sure use some help here! I have been fooling around with this mod for days and can't seem to rid the errors or get the ajax_loading.gif to show. As a matter of fact the whole page seems strange to me. If someone can donate some of their valuable time, I would appreciate a look see at my page so you could see what I'm talking about. The store is my test store so please feel free to make an order or 2. You will see that the page is not the way it should look and other errors. progroom dot com/teststore. Oh, by the way, you will not see the shipping, nor tax and the total will read pending total, which is all okay.

 

Also too, the credit card input fields do not show. When the page refreshes you can see the cc input fields but for just a few seconds then it's gone again. And too, I can checkout without logging in or inputing a password. It sends me an email which includes a password. Ummmmmm!

 

MaryMae

Share this post


Link to post
Share on other sites

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where customer_id = '3'' at line 1

 

select amount from where customer_id = '3'

 

 

Wow, now I'm seeing this new problem that happens even though I uninstalled 'discount coupon' in admin>modules>order total and cut out all the KGT code in checkout.php and includes/classes/onepage_checkout.php.

 

It happens when a returning customer tries to login. I've had 'purchase without account' installed and working for a while and I set 'require login' to true in admin>configuration>one page checkout. Any ideas?

 

Thanks,

 

Nick

 

Maybe you're getting the error as you have cut the code out. I just uninstalled it and it is working fine without discount coupons.

Share this post


Link to post
Share on other sites

or add this to includes/application_top.php

find

 

require('includes/configure.php');

 

 

add after it

 

define('MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS','false');

define('MODULE_ORDER_TOTAL_COUPON_STATUS','false');

 

 

 

now no code needs to be removed

 

Steve

 

This post has been edited by steve_s: 05 January 2010 - 05:44 PM

 

 

 

Hi everyone,

 

Well it's very disappointing that one page checkout 1.11 doesn't seem to work with KGT coupons. I would think that this would be important for just about everyone with a shopping cart using OSC so it would've been fixed a long time ago. In the meanwhile, is the best way to disable coupons for now to add these defines to application_top.php or does that lead to any other unforeseen problems?

 

Thanks,

 

Nick

No it will not lead to any issues just using defines

 

Steve

Share this post


Link to post
Share on other sites

Thanks Steve. It worked. I am facing another problem about the coupon. This is the query string I get checkout.php?payment_error=ot_coupon. The coupon gets validated by validate button but still it redirects with the same error. Any ideas?

Thanks

Hi

 

i have not been able to find where that is set

 

Steve

Share this post


Link to post
Share on other sites

Maybe you're getting the error as you have cut the code out. I just uninstalled it and it is working fine without discount coupons.

 

 

Actually I spent today having my hosting service restore my backup to right before I ever messed with discount coupons and one page checkout. Then I installed one page checkout again and of course when a returning customer logs in and tries to check out:

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where customer_id = '3'' at line 1

 

select amount from where customer_id = '3'

 

Maybe it's some conflict with purchase without account but nothing I change in the admin will set things right. I'd uninstall purchase without account but that was 12 add-ons ago and I foolishly used the package with an autoinstaller, making it even harder to take out. Any ideas before I finally have to throw in the towel? Maybe some simple database modification I'm missing?

 

Thanks,

 

Nick

Share this post


Link to post
Share on other sites

Actually I spent today having my hosting service restore my backup to right before I ever messed with discount coupons and one page checkout. Then I installed one page checkout again and of course when a returning customer logs in and tries to check out:

 

1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where customer_id = '3'' at line 1

 

select amount from where customer_id = '3'

 

Maybe it's some conflict with purchase without account but nothing I change in the admin will set things right. I'd uninstall purchase without account but that was 12 add-ons ago and I foolishly used the package with an autoinstaller, making it even harder to take out. Any ideas before I finally have to throw in the towel? Maybe some simple database modification I'm missing?

 

Thanks,

 

Nick

 

Hi Nick

 

find following in checkout.php and remove it

  //BOF KGT
 if (MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true'){
   if(isset($_POST['code']))
   {
     if(!tep_session_is_registered('coupon'))
       tep_session_register('coupon');
     $coupon = $_POST['code'];
   }
 }
 //EOF KGT

 

and

 //BOF KGT
 onePage.kgtInstalled = <?php echo (MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true' ? 'true' : 'false');?>;
 //EOF KGT

 

and

 

		//BOF KGT
	if (MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true'){
		echo '<table cellpadding="2" cellspacing="0" border="0">
		 <tr>
		  <td class="main"><b>Have A Coupon?</b></td>
		 </tr>
		 <tr>
		  <td class="main">' . tep_draw_input_field('coupon', 'coupon code') . '</td>
		  <td class="main">' . tep_image_submit('button_redeem.gif', IMAGE_REDEEM_VOUCHER, 'id="voucherRedeemCoupon"') . '</td>
		 </tr>
		</table>';
	}
	//EOF KGT

 

includes/classes/onepage_checkout.php

find and remove it

    //BOF KGT
   if(MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS=='true')
   {
     //kgt - discount coupons
     if (tep_not_null($onepage['info']['coupon'])) {
     //this needs to be set before the order object is created, but we must process it after
       if (!tep_session_is_registered('coupon')) tep_session_register('coupon');
       $order->info['coupon'] = $onepage['info']['coupon'];
       //$order->info['applied_discount'] = $onepage['info']['applied_discount'];
       //$order->info['subtotal'] = $onepage['info']['subtotal'];
     }
     //end kgt - discount coupons
   }
   //EOF KGT

 

and

      //BOF KGT
       if (MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true'){
         $valid_products_count = 0;
         $order->coupon->applied_discount = array();
       }
     //EOF KGT

 

and

       //BOF KGT
       if (MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true' && is_object( $order->coupon )){
         //kgt - discount coupons

           $applied_discount = 0;
           $discount = $order->coupon->calculate_discount( $order->products[$i], $valid_products_count );
           if( $discount['applied_discount'] > 0 ) $valid_products_count++;
           $shown_price = $order->coupon->calculate_shown_price( $discount, $order->products[$i] );
           //var_dump($shown_price);
           $shown_price = $shown_price['actual_shown_price'];
       } else {
           $shown_price = tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'];

       }
       $order->info['subtotal'] += $shown_price;
         /**************
         $shown_price = tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'];
       $order->info['subtotal'] += $shown_price;
         **************/
         //end kgt - discount coupons
       //EOF KGT

 

and

     //kgt - discount coupon
     if( MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true' && is_object( $order->coupon ) )
     {
       //$order->coupon->applied_discount = $applied_discount;
       $order->info['total'] = $order->coupon->finalize_discount( $order->info );
       $onepage['coupon'] = $order->coupon;
     }
     //end kgt - discount coupon

 

and

   //BOF KGT
   if(MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS=='true')
   {
     $onepage['info']['coupon'] = $order->info['coupon'];
     //$onepage['info']['applied_discount'] = $order->info['applied_discount'];
     //$onepage['info']['subtotal'] = $order->info['subtotal'];
     //end kgt - discount coupons
   }
   //EOF KGT

 

that should do it

 

Steve

Share this post


Link to post
Share on other sites

Hi Nick

 

find following in checkout.php and remove it

  //BOF KGT
 if (MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true'){
   if(isset($_POST['code']))
   {
     if(!tep_session_is_registered('coupon'))
       tep_session_register('coupon');
     $coupon = $_POST['code'];
   }
 }
 //EOF KGT

 

and

 //BOF KGT
 onePage.kgtInstalled = <?php echo (MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true' ? 'true' : 'false');?>;
 //EOF KGT

 

and

 

		//BOF KGT
	if (MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true'){
		echo '<table cellpadding="2" cellspacing="0" border="0">
		 <tr>
		  <td class="main"><b>Have A Coupon?</b></td>
		 </tr>
		 <tr>
		  <td class="main">' . tep_draw_input_field('coupon', 'coupon code') . '</td>
		  <td class="main">' . tep_image_submit('button_redeem.gif', IMAGE_REDEEM_VOUCHER, 'id="voucherRedeemCoupon"') . '</td>
		 </tr>
		</table>';
	}
	//EOF KGT

 

includes/classes/onepage_checkout.php

find and remove it

    //BOF KGT
   if(MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS=='true')
   {
     //kgt - discount coupons
     if (tep_not_null($onepage['info']['coupon'])) {
     //this needs to be set before the order object is created, but we must process it after
       if (!tep_session_is_registered('coupon')) tep_session_register('coupon');
       $order->info['coupon'] = $onepage['info']['coupon'];
       //$order->info['applied_discount'] = $onepage['info']['applied_discount'];
       //$order->info['subtotal'] = $onepage['info']['subtotal'];
     }
     //end kgt - discount coupons
   }
   //EOF KGT

 

and

      //BOF KGT
       if (MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true'){
         $valid_products_count = 0;
         $order->coupon->applied_discount = array();
       }
     //EOF KGT

 

and

       //BOF KGT
       if (MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true' && is_object( $order->coupon )){
         //kgt - discount coupons

           $applied_discount = 0;
           $discount = $order->coupon->calculate_discount( $order->products[$i], $valid_products_count );
           if( $discount['applied_discount'] > 0 ) $valid_products_count++;
           $shown_price = $order->coupon->calculate_shown_price( $discount, $order->products[$i] );
           //var_dump($shown_price);
           $shown_price = $shown_price['actual_shown_price'];
       } else {
           $shown_price = tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'];

       }
       $order->info['subtotal'] += $shown_price;
         /**************
         $shown_price = tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'];
       $order->info['subtotal'] += $shown_price;
         **************/
         //end kgt - discount coupons
       //EOF KGT

 

and

     //kgt - discount coupon
     if( MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true' && is_object( $order->coupon ) )
     {
       //$order->coupon->applied_discount = $applied_discount;
       $order->info['total'] = $order->coupon->finalize_discount( $order->info );
       $onepage['coupon'] = $order->coupon;
     }
     //end kgt - discount coupon

 

and

   //BOF KGT
   if(MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS=='true')
   {
     $onepage['info']['coupon'] = $order->info['coupon'];
     //$onepage['info']['applied_discount'] = $order->info['applied_discount'];
     //$onepage['info']['subtotal'] = $order->info['subtotal'];
     //end kgt - discount coupons
   }
   //EOF KGT

 

that should do it

 

Steve

 

Hi Steve,

 

Thanks for you help. Unfortunately that still didn't do it. I don't know if my database is messed up or maybe I missed a space or some single character somewhere in the coding, though I've checked several times now.

 

Maybe some error in line 425 of onepage_checkout.php or line 538 or checkout.php? Both of them read:

 

$gv_query=tep_db_query("select amount from " . TABLE_COUPON_GV_CUSTOMER . " where customer_id = '" . $customer_id . "'");

 

 

I'd also had to add a define TABLE_COUPON_GV_CUSTOMER to database_tables.php to get rid of a previous error.

Edited by longhorn1999

Share this post


Link to post
Share on other sites

Hi Longhorn1999

 

I had the same problem as you, I think I found the solution

 

if you go to the end of includes/checkout/payment_method.php

 

delete the CREDIT CLASS GIFT VOUCHER CONTRIBUTION

 

That should fix you problem

 

Well it did for me anyway :-)

 

Simon

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

×