bluevisiontec / GoogleShoppingApi

Magento Module GoogleShoppingApi v2
Open Software License 3.0
69 stars 45 forks source link

Google API Issue #23

Closed pasujemito closed 9 years ago

pasujemito commented 9 years ago

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 commented 9 years ago

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

pasujemito commented 9 years ago

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 commented 9 years ago

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

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 commented 9 years ago

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

schnere commented 9 years ago

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

pasujemito commented 9 years ago

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 commented 9 years ago

Okay,

pasujemito commented 9 years ago

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 commented 9 years ago
pasujemito commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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 commented 9 years ago

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...

KissSzilard commented 8 years ago

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