free shipping with minimum amount of purchase

已查看 33 次
跳至第一个未读帖子

zpupster

未读,
2011年5月20日 10:47:352011/5/20
收件人 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

未读,
2011年5月20日 11:27:522011/5/20
收件人 Google Checkout Module for osCommerce Support
sorry that is 50.00dollars not 500.

JohnAtYM

未读,
2011年5月21日 04:39:542011/5/21
收件人 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

未读,
2011年5月21日 04:43:502011/5/21
收件人 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

未读,
2011年5月25日 09:47:412011/5/25
收件人 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

未读,
2011年5月30日 10:28:552011/5/30
收件人 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

未读,
2011年5月30日 10:57:362011/5/30
收件人 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

未读,
2011年5月30日 11:23:512011/5/30
收件人 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

未读,
2011年6月1日 11:18:552011/6/1
收件人 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!



回复全部
回复作者
转发
0 个新帖子