Try the Demo

Magento Forum

   
Google Checkout - Free Shipping
 
Dunc
Member
 
Avatar
Total Posts:  56
Joined:  2008-08-05
 

I only use Google Checkout on my site and I would like to introduce free shipping for orders over a set amount but although this is possible through admin configuration, there doesn’t seem to be a way to pass that on to Google Checkout, is that the case and does this feature not work with Google Checkout?

Thanks
Duncan

 Signature 

http://www.electricshowersdirect.com

 
Magento Community Magento Community
Magento Community
Magento Community
 
Emily
Jr. Member
 
Avatar
Total Posts:  22
Joined:  2008-03-31
Atlanta
 

I created a workaround to get free shipping in Google checkout for orders over a certain amount.  This is for Magento 1.1.4

Open GoogleCheckout/Model/Api/XML/Checkout.php:
~ line 24

protected $_shippingCalculated false;
protected 
$_total 0/* add this */

~ line 78:

$taxClass = ($item->getTaxClassId() == 'none' $item->getTaxClassId());
$weight = (float) $item->getWeight();
$digital $item->getIsVirtual() ? 'true' 'false';
$this->_total += $item->getBaseCalculationPrice()*$item->getQty(); /* add this */

~ line 209 [ function _getShippingMethodsXml() ]:
change $this->_total > 60 to be whatever amount for which you want to enable free shipping

if ($this->_isOrderVirtual() || $this->_total 60{
       
return $this->_getVirtualOrderShippingXml();
}

In this example, orders whose totals are under $60 get regular shipping options in Google Checkout.  For orders over $60, the only option is ‘free shipping’.

 Signature 

NeboWeb.com

 
Magento Community Magento Community
Magento Community
Magento Community
 
robriggen
Jr. Member
 
Total Posts:  2
Joined:  2008-03-10
 

@Duncan

Can you tell me what URL you use for the callback api?
offline rob @ bigyellowtech dot com
Thanks!

Rob

 
Magento Community Magento Community
Magento Community
Magento Community
 
Dunc
Member
 
Avatar
Total Posts:  56
Joined:  2008-08-05
 

@Emily - Thanks for posting a fix. I tried this but there are a couple of things I’m not sure about. Firstly, the line numbers are different when I edit my text file so though the first two insertions are clear, could you just clarify the last one and where that should go exactly. Also, what should the delivery options in the admin section of Magento be set to? I currently have just the one flat rate, should I also add a free shipping option to that? If I do now it shows both no matter what the price of the order.

Many thanks
Duncan

 Signature 

http://www.electricshowersdirect.com

 
Magento Community Magento Community
Magento Community
Magento Community
 
Emily
Jr. Member
 
Avatar
Total Posts:  22
Joined:  2008-03-31
Atlanta
 

Look for this original code:

protected function _getShippingMethodsXml()
    
{
        
if ($this->_isOrderVirtual()) {
            
return $this->_getVirtualOrderShippingXml();
     
}

and replace with:

protected function _getShippingMethodsXml()
    
{
        
if ($this->_isOrderVirtual() || $this->_total 60{
            
return $this->_getVirtualOrderShippingXml();
    
}

 Signature 

NeboWeb.com

 
Magento Community Magento Community
Magento Community
Magento Community
 
Dunc
Member
 
Avatar
Total Posts:  56
Joined:  2008-08-05
 

Thank you very much Emily, that’s fixed it and is doing exactly as required.

 Signature 

http://www.electricshowersdirect.com

 
Magento Community Magento Community
Magento Community
Magento Community
 
wsj3
Guru
 
Avatar
Total Posts:  519
Joined:  2008-07-13
Portland, OR
 

What were the settings in the admin for this? Anyone have this working in Magento 1.3?

 Signature 

Will Johnston
http://www.growandmake.com
The Store for Sustainable Living

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top