• How To, Magento, eCommerce

    Google Checkout Shipping and Magento

    Posted on January 15th, 2010

    Written by CJ

    Tags

    Using Google Checkout Shipping Settings in Magento

    I was integrating this feature for a customer and was stomped as to why the Google Checkout Shipping Settings (not Magento’s) weren’t populating in Google Checkout. After, posting a question in the Google Checkout Help Forum, I was informed that Google Checkout settings were being overidden if Magneto sends this shipping information everytime a customer checks out. Even if you disable all Google API shipping methods from the Magento Admin, Magento will still send an empty shipping method via xml tag. Thus you have to comment out the shipping method tag from the A.K.A xml generator in magento /app /code /core /Mage /GoogleCheckout /Model /Api /Xml /Checkout.php

    Using Google’s Checkout Shipping Settings instead of Magento’s, is the best way. Here is why. You don’t use your server resources to populate shipping price and methods. Google will less likely time out if it depends on UPS, USPS, or UPS carrier’s servers; where they have many backups in place. Google will also less likely time out because there is not another layer of code it needs to process. And there are many more pros.

    The only con I see by using Google’s Checkout Shipping Settings, is that if you have advanced shipping settings, Magento extensions, or plugins for your shipping needs in Magento, it won’t carry over to google using the following method in this tutorial. But, the good news is Google’s Checkout Shipping Settings are very flexible to most shipping needs.

    The Settings

    The following Google Checkout Shipping tutorial is based on the following:

    • Use Google’s Checkout Shipping Settings instead of Magento’s
    • Google Integration Settings are set to the following:
      -My company will only post digitally signed carts.
      -API callback URL (Level 2 integrations only) using HTTPS
      -API callback URL:
      https://yourmagentostore.com/index.php/googlecheckout/api
      -Callback contents: Notification as XML
      -Advanced settings:
      • ~Provide the first name, last name and full name of the buyer and order recipient in separate fields in the new order notification.
        ~Return the buyer’s ship-to phone number in the new order notification.
        ~Return the buyer’s billing phone number in the new order notification.
    • Magento’s Google API Google Checkout Settings are as follows:
      Located here, Magento Admin > Sysytem > Google API > Google Checkout
      -Enabled - Yes
      -Sandbox - No
      -Secure Callback URL - Yes
      -Debug - No
      -Existing Merchant ID
      -Existing Merchant Key
      -Checkout Image Style - Small 160×43 Transaparent
      -Location - United States
      -New Order Status - Pending
      -Continue Shopping URL - Blank
      -Hide Cart Contents During Checkout - Yes
      -Disable Default Tax Tables - No
    • Magento’s Google API Merchant Calculated Settings are as follows:
      Located here, Magento Admin > Sysytem > Google API > Google Checkout Shipping - Merchant Calculated
      -Enable Merchant Calculated - No
    • Magento’s Google API Carrier Calculated Settings are as follows:
      Located here, Magento Admin > Sysytem > Google API > Google Checkout Shipping - Carrier Calculated
      -Enable Carrier Calculated - No
    • Magento’s Google API Flat Rate Settings are as follows:
      Located here, Magento Admin > Sysytem > Google API > Google Checkout Shipping - Flat Rate
      -Enable Flat Rate - No

    The Magento Core Edit Solution

    Make a back up copy of the Magento Core file and make a note of the edit for future Magento upgrades.

    prompt>cd /var/www/yourmagentostore/app/code/core/Mage/GoogleCheckout/Model/Api/Xml
    prompt>cp Checkout.php Checkout.php.bak

    Edit Checkout.php

    prompt>nano Checkout.php

    At around line 232 replace:

    <shipping-methods>

    With:

    <!--shipping-methods>

    At around line 237 replace:

    <shipping-methods>

    With:

    </shipping-methods -->

    Troubleshooting

    Your Ad Here
    • Enable Debug in Magento:
      1. Go to Magento Admin > Google API > Google Checkout Tab > Select Debug
      2. Do a checkout test run
      3. Go to PHPMyAdmin > Select appropriate Magento DB > Select googlecheckout_api_debug > Click Browse tab

      Here you can view the XML sent to Google in request_body and the Google Response in response_body. Viewing this debug table will help you better understand how Google Checkout and Magento work together.

    • View Google Checkout’s API Integration console
      GC Admin>Tools>Integration console

      Here you will see a log of most errors. This will give you a better understanding on API errors.

      Please note that some errors won’t be logged in Google Checkout’s API Integration console.

    Let me know if you run into any snags. Thanks for reading.

    This entry was posted on Friday, January 15th, 2010 at 9:34 pm and is filed under How To, Magento, eCommerce. You can follow any responses to this entry through the RSS 2.0 feed. You can skip to the end and leave a response. Pinging is currently not allowed.
  • 8 Comments

    Take a look at some of the responses we've had to this article.

    1. " Google Checkout Shipping and Magento "

      optical
      Posted on March 9th

      I get the following messing using your procedure on the commenting out the code:

      Google Checkout: Error parsing XML; message from parser is: The string “–” is not permitted within comments.

      any ideas?

    2. " Google Checkout Shipping and Magento "

      optical
      Posted on March 9th

      that was on line 232 using your procedure.

    3. " Google Checkout Shipping and Magento "

      optical
      Posted on March 9th

      ok, i resolved the above error, it was due to the not commenting out line 237 correctly.

      but I still don’t see Magento passing the tax and shipping info.

    4. " Google Checkout Shipping and Magento "

      Posted on August 31st

      Hey,
      i did what u suggested and i get the following error.
      *
      o Google Checkout: Error parsing XML; message from parser is: The element type “alternate-tax-rules” must be terminated by the matching end-tag “”.

      Im on magento 1.4.1.0 , any idea how to fix this?

    5. " Google Checkout Shipping and Magento "

      Posted on February 10th

      Google Checkout show zero shipping in magento i m using fedex method but it show everything fine in GC please help

    6. " Google Checkout Shipping and Magento "

      SELLONLINE
      Posted on March 30th

      It worked for me, thanks a lot, ot make it work I had to changed the and twice
      in lines 243, 248
      and in Lines 259, 265

      Thanks a lot again

    7. " Google Checkout Shipping and Magento "

      Posted on April 13th

      Thanks for this post - I got the same error that Sanjay received:
      Google Checkout: Error parsing XML; message from parser is: The element type “alternate-tax-rules” must be terminated by the matching end-tag “”.

    8. " Google Checkout Shipping and Magento "

      Posted on April 13th

      PS: from another post I read, you also have to change the merchant-calculated tax tables info in Checkout.php to “false”:
      tax-tables merchant-calculated=”false”

      But in that post, it said it occurred 3x, and I only found it 2x.

  • Post a Comment

    Let us know what you thought.

  • Name:

    Email:

    Website:

    Message: