Zen Cart Logo
Forums / Addon Payment Modules / Instructions: How to make shipping options work with google

Instructions: How to make shipping options work with google

Locked

Views: 3,928

Results 1 to 8 of 8
This thread is locked. New replies are disabled.
6 Nov 2008, 5:16 AM
#1
marcrthco avatar

marcrthco

New Zenner

Join Date:
Nov 2008
Posts:
4
Plugin Contributions:
0

Instructions: How to make shipping options work with google

WOW HERE IT IS! :clap: I found this digging through crap elsewhere

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

MOD PLEASE STICKY THIS

15 Dec 2008, 5:58 AM
#2
greenhat avatar

greenhat

Zen Follower

Join Date:
May 2007
Posts:
108
Plugin Contributions:
0

Re: Instructions: How to make shipping options work with google

wow.. i really wish i would have found it sooner. I just spend the whole night hacking this thing and came up with something similar..posted it here:

http://www.zen-cart.com/forum/showthread.php?p=656187

did a quick search to see if anyone else is looking for it and found your thread which seems to be cleaner code and it solves other potential problems.

thanks!

30 Dec 2008, 6:01 PM
#3
gobrinton avatar

gobrinton

New Zenner

Join Date:
Dec 2008
Posts:
77
Plugin Contributions:
0

Re: Instructions: How to make shipping options work with google

MarcRTHCO,

I installed your fix and it seems to work but I think I may have found a bug.

(My home state requires sales tax on shipping if the buyer is in the same state.) When I set the free shipping option - Tax Class to "Taxable Goods" then this fix stops working. If I set Tax Class back to "none" then it works again.

I am doing this in the Admin > Modules > Shipping Modules > Free Shipping Options > Tax Class.

Thanks for your help.

18 Jan 2009, 9:07 PM
#4
phil99 avatar

phil99

Zen Follower

Join Date:
Aug 2007
Posts:
113
Plugin Contributions:
0

Re: Instructions: How to make shipping options work with google

Im using the order total module to do my free shipping on order totals over £15 and this mod just makes my shipping free with all google checkout orders irrelevant of the price. AHHHHH!! still can fix this!

8 Feb 2009, 1:08 PM
#5
totalsam avatar

totalsam

Zen Follower

Join Date:
Jan 2009
Posts:
126
Plugin Contributions:
0

Re: Instructions: How to make shipping options work with google

This still won't work from me. I have the shipping insurance mod and this automatically adds the shipping insurance on but with a value of £0.00 which to a customer would look like they have free insurance!!!

23 May 2009, 9:04 PM
#6
ladyink avatar

ladyink

Zen Follower

Join Date:
Oct 2007
Posts:
105
Plugin Contributions:
0

Re: Instructions: How to make shipping options work with google

gobrinton:

MarcRTHCO,

I installed your fix and it seems to work but I think I may have found a bug.

(My home state requires sales tax on shipping if the buyer is in the same state.) When I set the free shipping option - Tax Class to "Taxable Goods" then this fix stops working. If I set Tax Class back to "none" then it works again.

I am doing this in the Admin > Modules > Shipping Modules > Free Shipping Options > Tax Class.

Thanks for your help.

I have this same exact problem. Has anyone found a fix for this?

Nancy

27 Jul 2009, 3:37 AM
#7
gibbywmu avatar

gibbywmu

New Zenner

Join Date:
May 2008
Posts:
21
Plugin Contributions:
0

Re: Instructions: How to make shipping options work with google

I tried this, and I am STILL getting the "FreeOptions = $0" choice, along with USPS Media, Parcel and Express all at $1. How can I resolve this?

30 Jul 2009, 1:30 AM
#8
seahor5e avatar

seahor5e

New Zenner

Join Date:
Jul 2009
Posts:
11
Plugin Contributions:
0

Re: Instructions: How to make shipping options work with google

MarcRTHCO:

WOW HERE IT IS! :clap: I found this digging through crap elsewhere

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

MOD PLEASE STICKY THIS

i did this and still no shipping being added to google checkout , i have uk google checkout and i have shipping methods_uk.php
:cry: