Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 2
Google Checkout Carrier Calculated Shipping is always displaying default shipping amount
 
jbeall
Member
 
Total Posts:  33
Joined:  2008-02-18
West Virginia
 

Hello everyone,

Google Checkout is always displaying the default shipping amount for all shipping methods, both FedEx, USPS, and UPS.

Has anyone else experienced this, and do you know how I can correct this?  This is likely more of a Google Checkout than a Magento issue--but perhaps I’ve not configured something right on the Magento side?

-Josh

 
Magento Community Magento Community
Magento Community
Magento Community
 
jbeall
Member
 
Total Posts:  33
Joined:  2008-02-18
West Virginia
 

Ok, here’s what I’ve discovered so far:

1) Google Checkout’s Carrier Calculated Shipping can only be used exclusively (you can’t also use Merchant Calculated Shipping).  Fair enough.
2) Google Checkout’s Carrier Calculated Shipping will only work if the customer has entered their shipping information into Magento *before* they click on the Google Checkout button. This is a Big Problem.

This is a big problem because in many (most?) cases users are going to add things to their shopping cart and then hit the “Google Checkout” button to checkout.  And then the shipping won’t work.

This may be related to tax tables/rates somehow, as I see in my Google Checkout Integration Console the following error logged.  Note that this only happens if I have *not* entered my shipping information into the Magento cart before hitting the Google Checkout button.

Note: I scrubbed out some of the details for privacy reasons, but this should be plenty of data to replicate the occurrence.

Time of occurrence:  Apr 29, 2008 4:11:43 PM EDT
Error:  Merchant Calculations: We were looking for data in your merchant-calculation-results, but were not able to find it: total-tax
Warnings: 
XML We Received: 

<?xml version="1.0" encoding="utf-8"?>
<merchant-calculation-results xmlns="http://checkout.google.com/schema/2">
<results>
<result address-id="264919788912616">
</result>
</results>
</merchant-calculation-results>

XML We Sent: 

<?xml version="1.0" encoding="UTF-8"?>
<merchant-calculation-callback xmlns="http://checkout.google.com/schema/2" serial-number="{suppressed}">
<shopping-cart>
<items>
<item>
<item-weight value="2.0" unit="LB" />
<tax-table-selector>2</tax-table-selector>
<item-name>{suppressed}</item-name>
<item-description></item-description>
<quantity>1</quantity>
<unit-price currency="USD">11.0</unit-price>
<merchant-item-id>2020-10</merchant-item-id>
<merchant-private-item-data>
<quote-item-id>9</quote-item-id>
</merchant-private-item-data>
</item>
</items>
<merchant-private-data>
<quote-id>9</quote-id>
</merchant-private-data>
</shopping-cart>
<buyer-id>{suppressed}</buyer-id>
<calculate>
<addresses>
<anonymous-address id="264919788912616">
<country-code>US</country-code>
<city>{suppressed}</city>
<region>{suppressed}</region>
<postal-code>{suppressed}</postal-code>
</anonymous-address>
</addresses>
<shipping />
<tax>true</tax>
<merchant-code-strings />
</calculate>
<buyer-language>en_US</buyer-language>
</merchant-calculation-callback>

 
Magento Community Magento Community
Magento Community
Magento Community
 
KnightAR
Jr. Member
 
Total Posts:  1
Joined:  2008-04-29
 

I have this same exact problem, I noticed it this morning when I was testing out my Cart. I don’t want someone to have to register to checkout, but if this is going to be a problem I can’t use google checkout.

Someone please fix this issue!

 
Magento Community Magento Community
Magento Community
Magento Community
 
jbeall
Member
 
Total Posts:  33
Joined:  2008-02-18
West Virginia
 

I have logged a bug:
http://www.magentocommerce.com/bug-tracking/issue?issue=1861

If you can replicate this bug in 1.0.19700, please post a comment saying “bug still present in 1.0.19700”.  Unfortunately I haven’t upgraded from v1.0 just yet so I can’t be certain—but there wasn’t anything about fixing this in the release notes.

-Josh

 
Magento Community Magento Community
Magento Community
Magento Community
 
jbeall
Member
 
Total Posts:  33
Joined:  2008-02-18
West Virginia
 

Actually, it looks like this is corrected in the latest release (v1.0.19700).  I assumed it was not because I did not see it in the list of bug fixes or improvements.

 
Magento Community Magento Community
Magento Community
Magento Community
 
jbeall
Member
 
Total Posts:  33
Joined:  2008-02-18
West Virginia
 

I’m still pretty stumped on how to disable the “checkout” buttons, so that the only way to checkout is with Google Checkout.

http://www.magentocommerce.com/boards/viewthread/7144/

 
Magento Community Magento Community
Magento Community
Magento Community
 
prd
Jr. Member
 
Avatar
Total Posts:  12
Joined:  2008-03-31
Plymouth, UK
 

Jbeall - I don’t think this is fixed in 1.0.19700
I’m still unable to get Google Checkout to pick up my table rates at all - it just carries over the default value. The Magento Grandtotal which includes my shipping table rate is different to the Google Checkout total. 
Its infuriating eh?

 
Magento Community Magento Community
Magento Community
Magento Community
 
jbeall
Member
 
Total Posts:  33
Joined:  2008-02-18
West Virginia
 

You’re right, it is not fixed.

I thought it was fixed, but it seems that it’s only fixed when I login with a Google Checkout account that has an address which matches the address of an account in Magento.

I’m not positive about those details, the only thing I am positive about is that often Google Checkout’s shipping calculations are still wrong (showing the default) and I’m getting error messages in the integration console which say “Merchant Calculations: We were looking for data in your merchant-calculation-results, but were not able to find it: total-tax”

-Josh

 
Magento Community Magento Community
Magento Community
Magento Community
 
jbeall
Member
 
Total Posts:  33
Joined:  2008-02-18
West Virginia
 

Ok, I think I’ve narrowed it down a bit more—Google Checkout Carrier Calculated Shipping fails for a shipping destination which does not have a non-zero tax rate.

This is annoying for me as I was not planning on collecting taxes in all 50 states.  That’s up to the customer to be in compliance with local laws.

My speculation is that if there is not at least $0.01 in tax, the entire “total-tax” node is omitted, which is causing Google Checkout to croak.

-Josh

 
Magento Community Magento Community
Magento Community
Magento Community
 
jbeall
Member
 
Total Posts:  33
Joined:  2008-02-18
West Virginia
 

Ok, hack to fix this: comment out line 80 of lib/googlecheckout/googlemerchantcalculations.php.  What used to be this:

if($result->tax_amount != “")
$xml_data->Element(’total-tax’, $result->tax_amount,
array(’currency’ => $this->currency));

Is now this:

//if($result->tax_amount != “")
$xml_data->Element(’total-tax’, $result->tax_amount,
array(’currency’ => $this->currency));

The deal is that the total-tax node should always be there—at least, it appears so based on that Google Checkout Integration Console error message.  I haven’t read the specs myself.

Obviously you could remove the entire “if” line, and un-indent the two subsequent lines.  But I’ll leave it up to the Magento Core to decide how they really want to fix this bug.

Is there a way for me to submit a patch?

-Josh

 
Magento Community Magento Community
Magento Community
Magento Community
 
prd
Jr. Member
 
Avatar
Total Posts:  12
Joined:  2008-03-31
Plymouth, UK
 

I’ve tried your hack but nothing has changed for me except the following in my google checkout sandbox integration console:

Your server returned no data in its replyCheckout requires data of type merchant-calculation-results in reply to merchant-calculation-callback
 
Magento Community Magento Community
Magento Community
Magento Community
 
jbeall
Member
 
Total Posts:  33
Joined:  2008-02-18
West Virginia
 

That sounds as if there’s something wrong with your googlemerchantcalculations.php file, and the Google is now getting no data of any kind (as opposed to an XML document that’s missing the total-tax node).

I don’t mind taking a look at your googlemerchantcalculations.php file.  Perhaps an error was inadvertently introduced when you tried my hack, and it’s now preventing all Google Checkout callbacks from working.  PM me with the content of of googlemerchantcalculations.php.

I’m confident that the hack worked for me, as commenting/uncommenting line 80 consistently causes Google Checkout’s shipping to work and not work, respectively.

-Josh

 
Magento Community Magento Community
Magento Community
Magento Community
 
jbeall
Member
 
Total Posts:  33
Joined:  2008-02-18
West Virginia
 

For reference I am attaching my complete googlemerchantcalculations.php file—I did make one other change (which does not seem to have affected things in any way), which was casting the $result->tax_amount to a float.  Here’s lines 80 to 82 now:

if($result->tax_amount != "")
    
$xml_data->Element('total-tax', (float)$result->tax_amount,
        array(
'currency' => $this->currency));
File Attachments
googlemerchantcalculations.php  (File Size: 5KB - Downloads: 51)
 
Magento Community Magento Community
Magento Community
Magento Community
 
jbeall
Member
 
Total Posts:  33
Joined:  2008-02-18
West Virginia
 

My hack may fix Google Checkout Carrier Calculated Shipping, but it might introduce other problems.

I noted that other types of merchant calculated shipping don’t work because Magento is sending back incomplete XML fragments.  For instance, when Google Checkout requests merchant calculated shipping, Magento might send back a response like this:

<?xml version="1.0" encoding="utf-8"?>
<merchant-calculation-results xmlns="http://checkout.google.com/schema/2">
  <
results>
    <
result shipping-name="United States Postal Service - Express Mail" address-id="703266603358376">
      <
shipping-rate currency="USD">45.25</shipping-rate>
      <
shippable>true</shippable>
    </
result>
    <
result shipping-name="United States Postal Service - Priority Mail" address-id="703266603358376">
      <
shipping-rate currency="USD">8.5</shipping-rate>
      <
shippable>true</shippable>
    </
result>
    <
result address-id="703266603358376">
    </
result>
  </
results>
</
merchant-calculation-results>

Note the final <result> element has no children. This appears to cause Google Checkout to complain about missing nodes.  The solution is to omit the trailing, empty <result> node.  I’m not sure why it is even there.

The bottom line, however, that Google Checkout appears to be very picky about what type of XML it will accept, and that Magento is not always sending back the right thing.  My little hack to comment out line 80 fixes one problem, but might introduce others, as it means that every <result> node will *always* have a total-tax node, and that might cause Google Checkout to reject the XML document in some cases where it would have otherwise accepted it.  We need input from the Magento core team on how to properly correct this bug.

-Josh

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

@jbeall: from your posts looks like stock googlecheckout library has some issues, which we did not reproduce during QA.

Is it possible to get your configuration so we can reproduce these issues?

 
Magento Community Magento Community
Magento Community
Magento Community
 
jbeall
Member
 
Total Posts:  33
Joined:  2008-02-18
West Virginia
 

Hi Moshe,

Sure, I’d be happy to help out.  I’ll PM you with more details.

-Josh

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 2