Skip to content

Zencart Google Checkout and free options shipping module issue and solution

Nov 27, 2007 | Shopping Carts

Symptom:
My client is using the new Google Checkout Module with Carrier Calculated Shipping, et al. (v1.4.5)

You can see the Google Checkout module for ZenCart here.

His free options shipping module allows free shipping for orders greater than $50.00.
This is what his free options shipping method options are:
Shipping Cost: 0.00
Handling Fee: 0
Total >= 50.00
Total < = Weight >=
Weight < = Item Count >=
Item Count < =

When you navigate to google checkout as a customer, it would not follow the pricing rules– it would allow free shipping for any order regardless of price.

Here’s the Zen Cart Google Checkout Solution:

In the googlecheckout/gcheckout.php file, find these two lines: (line numbers 533 & 534)

$price = $quote[‘methods’][0][‘cost’];
$shipping_price = $currencies->get_value(DEFAULT_CURRENCY) * ($price>=0?$price:0);

replace them with:

if ($quote) {
$price = $quote[‘methods’][0][‘cost’];
$shipping_price = $currencies->get_value(DEFAULT_CURRENCY) * ($price>=0?$price:0);
}else{
unset($googlepayment->mc_shipping_methods[$key]) ;
continue ;
}

This should fix the other options in freeshipper as well – items, and weight, since it performs the same way (though I haven’t fully tested it in every possible combination or configuration). It should also fix any other shipping methods that just don’t show up based on some sort of option configuration.

Hope this helps someone else!

Kevin

Contact Us Today!

"*" indicates required fields

This field is for validation purposes and should be left unchanged.
I would like to be contacted by:*
Select all that apply.

Join Our Newsletter List!

* indicates required