Zencart Google Checkout and freeoptions shipping module issue and solution

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 freeoptions shipping module allows free shipping for orders greater than $50.00.
This is what his freeoptions 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 onfiguration). 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

Want to discuss a project?

  • This field is for validation purposes and should be left unchanged.