Google Checkout disabled – Not available with these items

I was recently asked for help on a Google Checkout problem where the Google Checkout Button on the Magento cart page was disabled with a message saying: “Not available with these items“.

I had a look at the Magento store in question and found a few clues to go on but a
Google search on the subject proved to be of little help unfortunately. The button looks like the one shown in the screenshot below:

The disabled Google Checkout button on the Magento cart/checkout screen. It looks like the normal one only greyed out.

The disabled Google Checkout button on the Magento cart/checkout screen. It looks like the normal one only greyed out.

The underlying URL for the button is:

 <img src="https://checkout.google.com/buttons/checkout.gif?merchant_id=5677186919&amp;w=180&amp;h=46&amp;style=white&amp;variant=disabled&amp;loc=en_US" alt="Fast checkout through Google" />

The big clue was the parameter on the Google Checkout button image URL on the problem store. It had variant=disabled which is generated server side, and so had to be coming from somewhere within Magento. A big fat grep over the code uncovered a variant=' string fragment in Link.php.

Here is the code in context you can see that the variant is set to disabled if the getIsDisabled() returns true:

 public function getImageUrl()
    {
        $url = 'https://checkout.google.com/buttons/checkout.gif';
        $url .= '?merchant_id='.Mage::getStoreConfig('google/checkout/merchant_id');
        $v = $this->getImageStyle();
        $url .= '&w='.$v[0].'&h='.$v[1].'&style='.$v[2];
        $url .= '&variant='.($this->getIsDisabled() ? 'disabled' : 'text');
        $url .= '&loc='.Mage::getStoreConfig('google/checkout/locale');
        return $url;
    }

Further along in the same class we find:

      public function getIsDisabled()
    {
        $quote = Mage::getSingleton('checkout/session')->getQuote();
        /* @var $quote Mage_Sales_Model_Quote */
        foreach ($quote->getAllVisibleItems() as $item) {
            /* @var $item Mage_Sales_Model_Quote_Item */
            if ($item->getProduct()->getDisableGooglecheckout()) {
                return true;
            }
        }
        return false;
    }

So there it is, there is some sort of switch in Magento here which tells a product to either be enabled or disabled for Google Checkout. This is one of my pet peeves with the EAV architecture Magento employs. It’s quite tricky to then find the actual place where this data is stored/defined. Liberal use of grep did uncover what I was looking for in an sql upgrade script:

$installer->addAttribute('catalog_product', 'disable_googlecheckout', array(
        'type'              => 'int',
        'backend'           => '',
        'frontend'          => '',
        'label'             => 'Not available for purchase with Google Checkout',
        'input'             => 'select',
        'class'             => '',
        'source'            => 'eav/entity_attribute_source_boolean',
        'global'            => Mage_Catalog_Model_Resource_Eav_Attribute::SCOPE_GLOBAL,
        'visible'           => true,
        'required'          => false,
        'user_defined'      => false,
        'default'           => '0',
        'searchable'        => false,
        'filterable'        => false,
        'comparable'        => false,
        'visible_on_front'  => false,
        'unique'            => false,
        'apply_to'          => '',
        'is_configurable'   => false
    ));

So now a quick survey of the Product Admin tabs uncovered this on the Price Tab – don’t ask me why this is a price option, but nevertheless that is where it resides:

Even if it's not immediately obvious why the enabling/disabling of a product for Google checkout is a price related option, this is where it is located.

Even if it's not immediately obvious why the enabling/disabling of a product for Google checkout is a price related option, this is where it is located.

Here you will find the option drop down, as shown below:

This drop down let's you select whether a product can be sold via Google Checkout.

This drop down let's you select whether a product can be sold via Google Checkout.

This was a feature introduced in Magento 1.2 to help stores that want to use Google Checkout but have some products which may breach the Google Checkout policies. Great idea.

The question remains, and hopefully we will find out, if somehow the setting has been turned on for the user who posted a comment having difficulty with this disabled Google Checkout button during Magento checkout.

You might also be interested in:

  1. Magento 1.1.7 Google Checkout and Free Shipping
  2. Magento 1.1.7 Google Checkout and Free Shipping (part 2)
  3. Magento 1.2.0.1 Fails when using Google Checkout Merchant Calculated Shipping Callbacks: An HTTPS URL is required.
  4. How to Bulk Enable Products when Google Checkout is Disabled in Magento
  5. 3 Quick Methods To Diagnose Communication Problems between Magento and Google Checkout


Tagged as , , , , , + Categorized as Google Checkout, Magento, Magento Installation, Web Development

9 Comments

  1. I upgraded and had this issue and had no clue it was a new magento “feature.” I assumed my upgrade was broken. :(

    Thank you for this detailed post! Saved me hours of debugging. :)

  2. Thank you! Exactly what I needed to know.

  3. I just ran into this after upgrading to 1.3.0.

    Does this mean that I will have to manually update HUNDREDS of products to “Yes” or is there a global setting somewhere? I’ve searched around and don’t see a global setting but thought perhaps someone else has found it.

    Thanks!

  4. You can bulk update magento products by doing this:
    1) Go to Catalog -> Manage products
    2) Click the ’select all’ link and it should show ‘X items selected’
    3) Under the Actions drop down choose ‘update attributes’ then submit.
    4) This takes you to a bulk update page, where you can choose to change the Google Checkout status for all of your products.

    If you have 1000’s of products this might time out or crash. In which case let me know because I will write some SQL to do it and post it here. But only if there is a need for it.

    Cheers,
    Ashley

  5. Much needed SQL update script for this problem. I want to fix the database once and for all, as at present I simply disable this check.
    1000’s of products, so yes, Magento WILL crash..

  6. I have written about about how to bulk update your Magento products to enable them for Google Checkout. Let me know how you go.

  7. I have google checkout enabled, but i get the grayed out logo. If you click the logo it takes you to checkout. Am I missing something in your fix. Do I have to manually override it somehow?

  8. That’s really odd, because normally if it is grey you can’t click it. Can you check the URL of the image?

  9. Great post! Just wanted to let you know you have a new subscriber- me!

Leave a Comment

Name:

Email:

Website:

Sporadic Tweeting...

  • My Top 3 Weekly #lastfm artists: The Black Keys (86), Mos Def (9) and Foo Fighters (8) http://bit.ly/c6eW5I 4 days ago
  • Finally beaten the 'Invalid package.xml format' fluff when trying to upload to Magento Connect - latest SMTP finally available there - yah! 4 days ago
  • My latest post includes a guide to making a basic extension too, so if you're just starting out with Magento extensions, check it out. 5 days ago
  • More updates...

What I'm listening to

  • The Black Keys - Brothers
  • Mos Def - Black On Both Sides
  • Foo Fighters - Skin and Bones
  • The Black Keys - Chulahoma
  • The White Stripes - Icky Thump
  • The Naked and Famous - This Machine
  • The Black Keys - The Moan
  • Red Hot Chili Peppers - Blood Sugar Sex Magik
  • Fat Freddys Drop - Based on a True Story