Jump to content
By fans, for fans. By fans, for fans. By fans, for fans.

Google Checkout Development


PhilM

Recommended Posts

Hi,

 

I'm really struggling to set up custom delivery charges with Google Checkout using the HTML API. Is there anyone on here who is well versed and might be able to spare me a bit of time to talk me through it? I've read Google's guidlines and help files and I think I'm nearly there. I just need to make sure that I'm going about it the right way and probably point out the glaringly obvious thing that I'm doing wrong.

 

Thanks in advance.

Phil

Edited by philmatthews
Link to comment
Share on other sites

Hi,

 

I'm really struggling to set up custom delivery charges with Google Checkout using the HTML API. Is there anyone on here who is well versed and might be able to spare me a bit of time to talk me through it? I've read Google's guidlines and help files and I think I'm nearly there. I just need to make sure that I'm going about it the right way and probably point out the glaringly obvious thing that I'm doing wrong.

 

Thanks in advance.

Phil

 

What custom charges are you trying to set up?

Link to comment
Share on other sites

What custom charges are you trying to set up?

 

Thanks for the response.

 

Basically there are three different options of delivery:

 

1) All of the mainland UK apart from a few postcodes.

2) The postcodes excluded in 1.

3) The Republic Of Ireland.

 

...so there will only be one option that is ever applicable to a particular delivery of an order.

 

The code I've used is:

 


<input type="hidden" name="ship_method_name_1" value="Parcelforce 48 Hour">
<input type="hidden" name="ship_method_currency_1" value="GBP">
<input type="hidden" name="ship_method_price_1" value="7.50">
<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.flat-rate-shipping-1.shipping-restrictions.allowed-areas.postal-area.country-code" value="GB"/>

<input type="hidden" name="ship_method_name_2" value="Royal Mail Standard Parcels">
<input type="hidden" name="ship_method_currency_2" value="GBP">
<input type="hidden" name="ship_method_price_2" value="8.99">

<input type="hidden" name="ship_method_name_3" value="Parcelforce Euro Priority">
<input type="hidden" name="ship_method_currency_3" value="GBP">
<input type="hidden" name="ship_method_price_3" value="14.99">
<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.flat-rate-shipping-3.shipping-restrictions.allowed-areas.postal-area.country-code" value="IE"/>
<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.flat-rate-shipping-3.shipping-restrictions.excluded-areas.postal-area.country-code" value="GB"/>
<?php
$postcodes = array("BT*","PH19*","PH20*","PH21*","PH22*","PH23*","PH24*","PH25*","PH26*","PH30*","PH31*","PH32*","PH33","*PH34*","PH35*","PH36*","PH37*","PH38*","PH39*","PH40*","PH41*","PH49*","PH50*","KW*","PA34*","PA37*","PA38*","PA39*","PO31*","PO32*","PO33*","PO34*","PO35*","PO36*","PO37*","PO38*","PO39*","PO40*","PO41*","HS2*","ZE*","IM*","JE*","GY*");
foreach ($postcodes as $postcode) {
echo "<input type=\"hidden\" name=\"checkout-flow-support.merchant-checkout-flow-support.shipping-methods.flat-rate-shipping-1.shipping-restrictions.excluded-areas.postal-area.postal-code-pattern\" value=\"" . $postcode ."\"/>";
echo "<input type=\"hidden\" name=\"checkout-flow-support.merchant-checkout-flow-support.shipping-methods.flat-rate-shipping-2.shipping-restrictions.allowed-areas.postal-area.postal-code-pattern\" value=\"" . $postcode ."\"/>";
}

?>

 

When I go into checkout, all three of the postage options are selectable, even the 3rd one which explicitly states that UK addresses are excluded.

 

Is flat rate shipping the correct way to do this?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...