Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Offical Google Checkout module for osCommerce Support Thread


Silverado05

Recommended Posts

I am trying to install Google Checkout on a heavily modified OSCommerce v1.1 and am having a devil of a time. I think I have everything set up correctly, but it just don't show up as an option, even after I have installed it as a payment module.

 

I am trying to get away from Paypal as a credit card processor. Is there anyone out there who can help me? I will gladly pay a fair hourly rate. It is just beyond me at this point.

 

Thanks!

Joe

Link to comment
Share on other sites

  • Replies 1.2k
  • Created
  • Last Reply

Top Posters In This Topic

Make that OsCommerce 2.2, sorry, slip of the fingers

 

I am trying to install Google Checkout on a heavily modified OSCommerce v1.1 and am having a devil of a time. I think I have everything set up correctly, but it just don't show up as an option, even after I have installed it as a payment module.

 

I am trying to get away from Paypal as a credit card processor. Is there anyone out there who can help me? I will gladly pay a fair hourly rate. It is just beyond me at this point.

 

Thanks!

Joe

Link to comment
Share on other sites

I've lost almost all of my hair with this GCO thing.

 

I have set up tax zones as follows: 2 folders - one called US which contains US, VI and PR - the other called Intl which contains 76 other countries.

 

I'm using Zone shipping. I have set up three zones in zone shipping. The first contains US, VI and PR and I charge a flat fee. The other two contain the other 76 countries where I charge a different flat fee. I have all of them set to taxable goods with $0 being charged (my state is tax free).

 

I run the Shipping generator with the default addresses and I get:

 

<?php
/*
**GOOGLE CHECKOUT ** v1.4
* @version $Id: shipping_methods.php 5342 2007-06-04 14:58:57Z ropu $
* 
*/
 // this are all the available methods for each shipping provider, 
 // see that you must set flat methods too!
 // CONSTRAINT: Method's names MUST be UNIQUE
 // Script to create new shipping methods
 // [url="http://demo.globant.com/~brovagnati/tools"]http://demo.globant.com/~brovagnati/tools[/url] -> Shipping Method Generator



/**
 * File: googlecheckout/shipping_methods.php file
 */ 
$mc_shipping_methods = array(
                       'zones' => array(
                                   'domestic_types' =>
                                     array(
                                         'zones' => 'Shipping to US : 0.25 lb(s)',

                                          ),

                                   'international_types' =>
                                     array(
                                         'zones' => 'Shipping to GB : 0.25 lb(s)',

                                          ),
                                       ),
                                 );

$mc_shipping_methods_names = array(
                                        'zones' => 'Zone Rates',
                                       );
?>

 

 

I'm finally getting somewhere with this, but the problem is I ship to more than just the US and GB. How do I get it to include the other countries?

 

Also, the shipping generator crashes my site every time I try a slight change and hit 'Get Shipping Methods' again - and I have to wait for like an hour or more before I can access my site again.

Link to comment
Share on other sites

I finally have a working shipping generator by switching to Firefox from IE. My problem is that no matter what the shipping generator gives me as code, the GCO module tells me : No merchant calculation shipping selected. I've tried all kinds of flat rate and zone shipping combo's. I even renamed the 'zone' shipping (and everything within) so that it wouldn't conflict with anything else named zone... I've checked, re-checked and checked again my tax zones - and because there's no info on how to set them up for international, I can only assume that they are set up correctly.

 

This is now my third (or more - I've lost count) straight week trying to get this module to work. I've read both forums at least 4 times over and I can't figure it out.

 

As a side note I even contemplated switching to the Cube cart - but after visiting their forum I see that people are having the exact same issue I have (even though it is integrated) and no help is coming their way. So a move to that cart would be pointless.

Edited by vicster
Link to comment
Share on other sites

Okay, even in Firefox, the shipping generator still manages to crash my site eventually. Anyone have any ideas on why this happens?

 

I don't think the default zone module which you are using, I assume, has the code to work with Google Checkout. As a test, I tried using the zones module in my shop and nothing showed up from the module, only the UPS and Fedex realtime quotes I am using.

Edited by speed777
Link to comment
Share on other sites

Thanks for looking into this, Speed777. Just so you know, I have two flat rate modules installed, too. One for US and one for Int'l - so in essence I have three modules installed. It's not picking up any of them in the GCO console even after the shipping generator does and I place the code in the shipping methods file.

Link to comment
Share on other sites

Thanks for looking into this, Speed777. Just so you know, I have two flat rate modules installed, too. One for US and one for Int'l - so in essence I have three modules installed. It's not picking up any of them in the GCO console even after the shipping generator does and I place the code in the shipping methods file.

 

Okay, I got the zone module to work by inserting the zone rates in the shipping_methods.php file like this:

'zones' => array(

'domestic_types' =>

array(

'zones' => 'Alabama',

'Florida',

'Georgia',

 

Then I inserted values in the Google Checkout console to go with the states. I'm still not able to get the weight table to work properly though.

Edited by speed777
Link to comment
Share on other sites

One other problem that I noticed is the zone values default back to $1 every time you edit the Googlecheckout console. So you will be entering those values all over again. That needs to be fixed.

Edited by speed777
Link to comment
Share on other sites

Okay, I got the zone module to work by inserting the zone rates in the shipping_methods.php file like this:

'zones' => array(

'domestic_types' =>

array(

'zones' => 'Alabama',

'Florida',

'Georgia',

 

Then I inserted values in the Google Checkout console to go with the states. I'm still not able to get the weight table to work properly though.

 

 

Thank you so much! I was thinking I'd have to do that with the states and the countries (under international) but I wasn't sure how to do it code wise.

 

I really appreciate your time! I'm going to give it a try, but probably not until tomorrow. Football's on and I had already decided to take a break from this today. It's my hubby's only day off. :)

Link to comment
Share on other sites

See the way it's supposed to work is that the GCO module uses realtime shipping quotes but if that's not available, it defaults to the zones module so you will at least get some money for shipping even though its not always the exact shipping cost. If you are not using realtime shipping quotes, you can use it that way but it does have limitations such as I've mentioned before.

Link to comment
Share on other sites

Has anybody found out how to link GC with OSC table rate? This is confusing.

1. Select the shipping methods that you wish to use and install them in your shipping panel.

2. Run the shipping generator.

3. Paste the results in your shipping_methods.php file.

Edited by speed777
Link to comment
Share on other sites

I tried Speed777's suggestion, but it didn't work. When you went to Google to checkout, Speed's suggestion gave you a drop-down box with a choice of all 50 states to choose from for your shipping and they all had a value of $0.00. The shipping still did not show up in the Google Console either.

 

I went back to using the flat rate US and the flat Intl mod's I made and though they still did not show in the Google console, the shipping was calculated correctly when checking out on Google's site.

 

My next problem: on hitting the return URL (I'm using gc_return) I got the following error (I messed up the session ID's on purpose):

 

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 '?osCsid=2e80c**********bf6a2c39) and pd.products_id = p.products_id and' at line 1

 

select count(*) as total from products p, products_description pd where p.products_status = '1' and p.products_id in (30?osCsid=2e80c**********bf6a2c39) and pd.products_id = p.products_id and pd.language_id = '1'

 

I don't even know what this means, so have no clue how to fix it.

 

Anyone know what this is?

Link to comment
Share on other sites

"I went back to using the flat rate US and the flat Intl mod's I made and though they still did not show in the Google console, the shipping was calculated correctly when checking out on Google's site."

 

They won't show up on the Google console, you have to edit them separately from the shipping modules section.

 

"I tried Speed777's suggestion, but it didn't work. When you went to Google to checkout, Speed's suggestion gave you a drop-down box with a choice of all 50 states to choose from for your shipping and they all had a value of $0.00. The shipping still did not show up in the Google Console either"

 

This one shows up in the Google console as:

 

Zone Rates

domestic_types

10.00 AL

9.50 FL

8.90 GA

 

I put in test values but when the GCO is edited, the values revert back to $1. So, its pretty useless. You seem to have the best solution with the flat rate modules.

Link to comment
Share on other sites

Thanks for all of your help Speed...I think something may be messed up somewhere in my Google files, because I used to have stuff showing in the Google console where now I get nothing to show as far as shipping modules. It seems to be working so I'm going to leave well enough alone.

 

I figured out my 1064 error (I had an extra " in my checkout_process file) but now a new issue: when you click the link to come back to my site from GCO, you are taken to the login page. Why is this happening? It doesn't matter whether I use gc_return or checkout_success. I've been having this problem since day 1. Is there something wrong with my sessions or something? And of course the cart is still full and no order is in admin. :(

Link to comment
Share on other sites

Thanks for all of your help Speed...I think something may be messed up somewhere in my Google files, because I used to have stuff showing in the Google console where now I get nothing to show as far as shipping modules. It seems to be working so I'm going to leave well enough alone.

 

I figured out my 1064 error (I had an extra " in my checkout_process file) but now a new issue: when you click the link to come back to my site from GCO, you are taken to the login page. Why is this happening? It doesn't matter whether I use gc_return or checkout_success. I've been having this problem since day 1. Is there something wrong with my sessions or something? And of course the cart is still full and no order is in admin. :(

 

Did you upload gc_return.php to your public_html or catalog folder? I use a bit of code to reset the cart:

<?php

$cart->reset(true);

?>

 

Place at the end of file before this code in gc_return.php:

<!-- body_text_eof //-->

 

The 3rd problem is harder to solve, I am having that problem myself. I got it to function properly once, but I had to rebuild my site because I moved to a different server and the problem returned.

Link to comment
Share on other sites

I seem to have forgotten my username/pw for the shipping generator. How can I reset that or recover that?

 

Thanks.

Your username/pw is in your Google Account, just sign into your Account>Checkout Sandbox>Settings>Integration and you'll see your Google merchant ID & Google merchant key. Use the merchant ID as your username and the merchant key as the password.

Link to comment
Share on other sites

When I installed the Offical Google Checkout module for osCommerce, it accepted orders fine, but the order details only existed in Google and didn't seem to get entered into osCommerce. Is this normal? If not, is it a common problem with a known solution? Or if it is, is there another module for Google Checkout I can try?

 

Thanks.

Link to comment
Share on other sites

Think i found the error in response_handler.php - someone else verify please:

 

Find this:

 

	  for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
// Stock Update - Joao Correia
	if (STOCK_LIMITED == 'true') {
	  if (DOWNLOAD_ENABLED == 'true') {
		$stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename 
							FROM " . TABLE_PRODUCTS . " p
							LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa
							 ON p.products_id=pa.products_id
							LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
							 ON pa.products_attributes_id=pad.products_attributes_id
							WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'";
// Will work with only one option for downloadable products
// otherwise, we have to build the query dynamically with a loop
		$products_attributes = @$order->products[$i]['attributes'];
		if (is_array($products_attributes)) {
		  $stock_query_raw .= " AND pa.options_id = '" . $products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[0]['value_id'] . "'";
		}
		$stock_query = tep_db_query($stock_query_raw);
	  } else {
		$stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
	  }
	  if (tep_db_num_rows($stock_query) > 0) {
		$stock_values = tep_db_fetch_array($stock_query);
// do not decrement quantities if products_attributes_filename exists
		if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) {
		  $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty'];
		} else {
		  $stock_left = $stock_values['products_quantity'];
		}
		tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
		if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) {
		  tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
		}
	  }
	}

 

Replace with this:

 

	  for ($i=0, $n=sizeof($order->products); $i<$n; $i++) {
// Stock Update - Joao Correia
	if (STOCK_LIMITED == 'true') {
	  if (DOWNLOAD_ENABLED == 'true') {
		$stock_query_raw = "SELECT products_quantity, pad.products_attributes_filename 
							FROM " . TABLE_PRODUCTS . " p
							LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES . " pa
							 ON p.products_id=pa.products_id
							LEFT JOIN " . TABLE_PRODUCTS_ATTRIBUTES_DOWNLOAD . " pad
							 ON pa.products_attributes_id=pad.products_attributes_id
							WHERE p.products_id = '" . tep_get_prid($order->products[$i]['id']) . "'";
// Will work with only one option for downloadable products
// otherwise, we have to build the query dynamically with a loop
		$products_attributes = @$order->products[$i]['attributes'];
		if (is_array($products_attributes)) {
		  $stock_query_raw .= " AND pa.options_id = '" . $products_attributes[0]['option_id'] . "' AND pa.options_values_id = '" . $products_attributes[0]['value_id'] . "'";
		}
		$stock_query = tep_db_query($stock_query_raw);
	  } else {
		$stock_query = tep_db_query("select products_quantity from " . TABLE_PRODUCTS . " where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
	  }
	  if (tep_db_num_rows($stock_query) > 0) {
		$stock_values = tep_db_fetch_array($stock_query);
// do not decrement quantities if products_attributes_filename exists
		if ((DOWNLOAD_ENABLED != 'true') || (!$stock_values['products_attributes_filename'])) {
		  $stock_left = $stock_values['products_quantity'] - $order->products[$i]['qty'];
		} else {
		  $stock_left = $stock_values['products_quantity'];
		}
		tep_db_query("update " . TABLE_PRODUCTS . " set products_quantity = '" . $stock_left . "' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
		if ( ($stock_left < 1) && (STOCK_ALLOW_CHECKOUT == 'false') ) {
		  tep_db_query("update " . TABLE_PRODUCTS . " set products_status = '0' where products_id = '" . tep_get_prid($order->products[$i]['id']) . "'");
		}
	  }
	}
 }

 

Scott

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

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...