free shipping with minimum amount of purchase

32 views
Skip to first unread message

zpupster

unread,
May 20, 2011, 10:47:35 AM5/20/11
to Google Checkout Module for osCommerce Support
hello,

i am trying and trying to get google checkout to offer free shipping
to customers purchasing over 500 dollars of merchandise.

is this even possible??

i tried modifying googlecheckout/ responsehandler.php line 420.



//if there is a problem with the method, i mark it as non-
shippable
if (isset($quotes[$quote_provider]['error'])
|| !isset($quotes[$quote_provider]['methods']
[$quote_method]['cost'])) {
$price = "9999.09";
$shippable = "false";
}
elseif ($total_price > "50.00"){
$price = "0.00";
$shippable = "true";}


else {
$price = $quotes[$quote_provider]['methods'][$quote_method]
['cost'];
$shippable = "true";


this does give shipping 0.00 but only for a second and then it fills
in with what i have set ups with.


i tried to install the add on: freeamount w/ minimum using google
checkout but i am using gc 1.5 and the instructions are for 1.45.

it says to modify
googlecheckout/shipping_methods.php but there is none but the same
code is in shipping_method_generator.php

i received errors on missing semi colons and parenthesis here is the
code i tried correcting but could not get it to work.



//**************googlecheckout/shipping_methods.php******************

Find:

$mc_shipping_methods = array(


Add directly below:

'freeamount' => array(
'domestic_types' =>
array(
'freeamount' => 'Free
shipping'
),
),

Find:

$mc_shipping_methods_names = array(

Add directly below:

'freeamount' => 'Free shipping' ,



anyway been working for on this for a while --any help appreciated.


thanks,

craig


zpupster

unread,
May 20, 2011, 11:27:52 AM5/20/11
to Google Checkout Module for osCommerce Support
sorry that is 50.00dollars not 500.

JohnAtYM

unread,
May 21, 2011, 4:39:54 AM5/21/11
to Google Checkout Module for osCommerce Support
This is documented somewhere but I can't quite remember where (I
usually google it tbh)... anyway, in this version for any kind of
shipping method you:
- set up the module in osc to do what you want in terms of charging
- then add the code you were looking for to the file googlecheckout/
library/shipping/merchant_calculated_methods.php

Your method gets picked up in gcheckout.php and passed to gc with the
basket, along with any other valid osc shipping modules. You shouldn't
need to modify any of the googlecheckout files that actually do stuff.

This works fine for shipping rates that only depend on what people
buy, not where they are, so should suit your needs ok.

Modifications to the responsehandler won't even get processed until
after your customer has been to googlecheckout and back again. Unless
you have SSL they'll never come back on the live site (only when
you're testing in the sandbox).

JohnAtYM

unread,
May 21, 2011, 4:43:50 AM5/21/11
to Google Checkout Module for osCommerce Support
Forgot to say: you need to put your new method in two places in the
file, full details in the nested arrays part of the file
($mc_shipping_methods) and also add it to the list at the bottom
($mc_shipping_methods_names)

On May 21, 9:39 am, JohnAtYM <sandboxmerch...@yourmontage.co.uk>
wrote:

Craig A Nelson

unread,
May 25, 2011, 9:47:41 AM5/25/11
to google-checkout-f...@googlegroups.com
hello JohnAtYM,

just had to say thank you for your help and your time. I have been working
on this for about a week, searching Google and
looking thru what I had on the google checkout.

your answer was the winning key!!!

Thanks Again,

Craig

--------------------------------------------------
From: "JohnAtYM" <sandbox...@yourmontage.co.uk>
Sent: Saturday, May 21, 2011 3:39 AM
To: "Google Checkout Module for osCommerce Support"
<google-checkout-f...@googlegroups.com>
Subject: [GCO4OSC] Re: free shipping with minimum amount of purchase

> --
> Google Checkout Module for osCommerce Support
>
> Documentation and latest releases:
> http://code.google.com/p/google-checkout-oscommerce/
>
> Group archives:
> http://groups.google.com/group/google-checkout-for-osc-mod-support
>
> To post to this forum, email
> google-checkout-f...@googlegroups.com.

JohnAtYM

unread,
May 30, 2011, 10:28:55 AM5/30/11
to Google Checkout Module for osCommerce Support
Thanks, nice to feel useful!

Just realised, the changes I told you about before will only pick up
the default value for the new shipping method. (NB there's a bug in
the settings page that prevents you saving any changes to the default
unless you fix it).

If you want to calculate a shipping price in your module and feed it
to googlecheckout, you need to amend the file:
catalog/includes/modules/payment/googlecheckout.php

adding your new method to the array $this->shipping_support =
array("flat", "item", "itemint", "table");
(the values in your array may not be identical to this, mine has been
changed and I guessed at the original version)

JohnAtYM

unread,
May 30, 2011, 10:57:36 AM5/30/11
to Google Checkout Module for osCommerce Support
Sorry, as you were; don't think that was right. That's a list of
things that are calculated in gc and not merchant-calculated... it's
the exact opposite of what you want!!

On May 30, 3:28 pm, JohnAtYM <sandboxmerch...@yourmontage.co.uk>
wrote:

JohnAtYM

unread,
May 30, 2011, 11:23:51 AM5/30/11
to Google Checkout Module for osCommerce Support
OK - here we go round again. I've now tested this out by implementing
a new shipping method. It DOES need to be added to the array in the
googlecheckout module if you want to pick up a value other than the
default.

On May 30, 3:57 pm, JohnAtYM <sandboxmerch...@yourmontage.co.uk>
wrote:

David Wade

unread,
Jun 1, 2011, 11:18:55 AM6/1/11
to google-checkout-f...@googlegroups.com
Hello,
I had too many issues with Google Checkout and dropped it.  I hope to implement it with my web upgrade in the near future.  Let me know if you are successful with you implementation as I may do something similar.

Cheers!



Reply all
Reply to author
Forward
0 new messages