Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google API Issue #23

Closed
pasujemito opened this issue Mar 20, 2015 · 16 comments
Closed

Google API Issue #23

pasujemito opened this issue Mar 20, 2015 · 16 comments

Comments

@pasujemito
Copy link

Hi there, is the an issue with the Google API at the moment? The build doesn't seem to be stable. any copies that temporary we could use? For more info see:

https://github.com/google/google-api-php-client

@schnere
Copy link
Contributor

schnere commented Mar 20, 2015

Hi, you can use the 1.1.2 release, this is working just fine for me. I did not try the head revision...

@pasujemito
Copy link
Author

Fantastic - works like a charm! I believe if others experience similar issue with client error, etc. get the stable version downloaded. Also could you provide me a small guidance how to upload the products and what exactly google attributes do?

@schnere
Copy link
Contributor

schnere commented Mar 20, 2015

To upload the products you will first have to create the attribute mapping:

  • Magento Admin -> Catalog -> Google Content API V2 -> Manage attributes
  • Create a mapping for the attribute set you want to upload
    • See https://support.google.com/merchants/answer/1344057 for requirements
    • For default attribute set I have entered the following:
      • SKU => Manufacturer's Part Number (MPN)
      • Condition => Condition
        • You might have to add the attribute condition as DropDown with the Options new, refurbished, used
      • Name => Title
      • Description => Description
      • Price => Price
        • Sales price is taken if set
      • EAN13 => GTIN
        • You need 2 out of 3 (MPN, GTIN, Brand), so you might add a similar attribute
      • Manufacturer => Brand

Furthermore it is necessary to set the Google Shopping Category. You will have to set this for each product. Therefore you will find a new tab in product edit view called "GoogleShopping".
All categories are prefixed with line numbers. So you can open the taxonomy file in a text editor showing the line numbers and search for the category you need: http://www.google.com/basepages/producttype/taxonomy.en-US.txt
Knowing the line number it should be quite easy to select the correct category in the dropdown.
This will be improved in a later version.

When you have set the API access data under System -> Configuration for your store view, created the product mapping and set the Google Shopping Category, you are ready to upload the product.
To do so, go to Magento Admin -> Catalog -> Google Content API V2 -> Manage items, select the store view. Then you should be redirected to Google OAuth where you are able to give the module access to your Merchant account. After successful authentication you will be able to upload products to GoogleShopping.

Hope this helps :)

@pasujemito
Copy link
Author

I believe I have set everything up as needed, anything I did forget about?
attributes
config_page

@schnere
Copy link
Contributor

schnere commented Mar 23, 2015

Seems fine. Just try to upload. If something is missing you will get an error description.

@pasujemito
Copy link
Author

Just checked my API Diagnostics, I get the following error on all my instances.

{
  "error" : {
    "errors" : [ {
      "domain" : "content.ContentErrorDomain",
      "reason" : "validation",
      "message" : "[shipping] validation/missing_recommended for Shopping,ShoppingApi: Missing shipping information"
    }, {
      "domain" : "content.ContentErrorDomain",
      "reason" : "validation",
      "message" : "[google_product_category] validation/invalid_value for Shopping,ShoppingApi: Unknown 'google product category' value"
    } ],
    "code" : 400,
    "message" : "[shipping] validation/missing_recommended for Shopping,ShoppingApi: Missing shipping information"
  }
}

{
  "error" : {
    "errors" : [ {
      "domain" : "content.ContentErrorDomain",
      "reason" : "validation",
      "message" : "[product_type] validation/invalid_value: Invalid string value in attribute: product type"
    } ],
    "code" : 400,
    "message" : "[product_type] validation/invalid_value: Invalid string value in attribute: product type"
  }
}

@schnere
Copy link
Contributor

schnere commented Mar 23, 2015

Okay,

  • Shipping: Set the shipping rate directly in Google Merchant Settings
  • Google Product Category: Did you set the category in GoogleShopping tab in the product edit view?
  • Product Type: Did you assign the product to a category in your Magento store?

@pasujemito
Copy link
Author

Right the first bulletpoint has been done. Could you outline more on other two questions, am not sure which GoogleShopping Tab. Indeed all products are assigned the categories.

@schnere
Copy link
Contributor

schnere commented Mar 23, 2015

  • Google Product Category: Go to Magento Admin -> Catalog -> Manage Products , select a product.
    Here you will find a Tab called "GoogleShopping" on the left. There you have to select a Category for your product. These categories are provided by Google and have to match.
  • Product Type: Here the category of your store is used. May be there are not excepted characters in your category names?

@pasujemito
Copy link
Author

Right, I did set those categories - I did shrink this list to what is relevant to our products, hopefully that will not have any effect as long as the breadcrumbs are the same. With regards to the category names they are all text based, no special characters there.

@pasujemito
Copy link
Author

Right I managed to clear this up, after all the properties are set, I am able to only upload configurable products. I am still checking if there could be SKU problem - if not I will update soon.

@pasujemito
Copy link
Author

The products are adding fine - now I am wondering if all the products can be added to Google. At the moment I have added all of the configurable products, does the same principal applies to simple products? Can they also be added? As configurable products are the main ones and simple products are just sizes and attributes.

@schnere
Copy link
Contributor

schnere commented Mar 26, 2015

You can list all types of products. But my suggestion would be to list only the parent (configurable) product when the child products are only size variations. If the customer visits your shop by a click on the GoogleShopping configurable product link, he will be able to choose the size...

@pasujemito
Copy link
Author

Hi again,

Google Shopping works great - I have new a question regarding the product ID that appears on Products Tab within Google Merchants Center. What is this ID based on and how do I echo this ID in magento? I have found the following code, but not sure how to create echo output to display the ID

$collection = Mage::getModel('catalog/product')->getCollection()
        ->setStore($this->_getStore())
        ->addAttributeToSelect('name')
        ->addAttributeToSelect('sku')
        ->addAttributeToSelect('price')
        ->addAttributeToSelect('status')
        ->addAttributeToSelect('attribute_set_id');

    $store = $this->_getStore();
    if ($store->getId()) {
        $collection->addStoreFilter($store);
    }

    $excludeIds = $this->_getGoogleShoppingProductIds();
    if ($excludeIds) {
        $collection->addIdFilter($excludeIds, true);
    }

    Mage::getSingleton('catalog/product_status')->addSaleableFilterToCollection($collection);
    $this->setCollection($collection);
    return parent::_prepareCollection();
}


public function render(Varien_Object $row)
{
    $baseUrl = 'http://www.google.com/merchants/view?docId=';

    $itemUrl = $row->getData($this->getColumn()->getIndex());
    $urlParts = parse_url($itemUrl);
    if (isset($urlParts['path'])) {
        $pathParts = explode('/', $urlParts['path']);
        $itemId = $pathParts[count($pathParts) - 1];
    } else {
        $itemId = $itemUrl;
    }
    $title = $this->__('View Item in Google Content');

    return sprintf('<a href="%s" alt="%s" title="%s" target="_blank">%s</a>', $baseUrl . $itemId, $title, $title, $itemId);
}
}

@schnere
Copy link
Contributor

schnere commented Apr 7, 2015

Take a look at buildContentProductId

The ID is generated by the Magento product id followed by a suffix of underline and the Magento store id.
So the first product has ID 1. It will have 1_1 as ID in GoogleShopping for fist store and 1_2 for second store...

@schnere schnere closed this as completed Apr 20, 2015
@KissSzilard
Copy link

I installed and configured everything as described, set the shipping as a single flat rate in Merchant Center, still get the shipping error 400. Any idea? Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants