bluevisiontec / GoogleShoppingApi

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

GoogleShoppingAPI v2

Update to 0.2.4

IMPORTANT!

If you are updating to 0.2.4 from an earlier version, please be aware that the category ids have changed. There is a shell script which might help you to map the old category ids to the new ones.

Fortunately Google has added static category ids which makes it easier for future updates.

Magento Module GoogleShoppingAPI

This module is based on the official Magento GoogleShopping module and enhances the original module features with APIv2 support (APIv1 support removed), OAuth2 support and several additional features from the original EnhancedGoogleShopping module.

If the original Magento GoogleShopping module is installed, data will be migrated.

~~The observer (auto sync after saving product changes) is disabled in the current version, but will be re-enabled soon.~~

The observer was re-enabled with version 0.1.0 . To prevent problems when users are editing products which have no access to GoogleShopping through OAuth2, products are only updated on GoogleShopping if a valid access token for the store exists.

To authenticate and get an access token go to Magento Admin -> Catalog -> Google Content APIv2 and select the store view in which you want to authenticate. After selecting a store view without valid access token you will be automatically redirected to OAuth2 authentication.

Features

Installation

Install using composer

As the Google ApiClient must be installed in addition, it is recommended to install using composer.

Create or adapt the composer.json file in your Magento root directory with the following content:

{
    "require": {
        "bluevisiontec/googleshoppingapi": "*",
        "magento-hackathon/magento-composer-installer": "*",
        "google/apiclient": "*"
    },
    "repositories": [
        {
            "type": "composer",
            "url": "http://packages.firegento.com"
        },
        {
                "type": "vcs",
                "url": "https://github.com/bluevisiontec/GoogleShoppingApi"
        }
    ],
    "extra": {
        "magento-root-dir": "./",
        "magento-deploystrategy": "copy"
    }
}

Install composer

mkdir bin
curl -s https://getcomposer.org/installer | php -- --install-dir=bin
php bin/composer.phar install

Install manually

After installation

Configuration

As the module has to use Google OAuth2, credentials for Google Content API are required. Those can be generated in the http://console.developers.google.com/

You can choose between using a Client ID for web application or using a service account. If the Client ID for web application is used a manual user interaction is needed to provide access to Google Content API. In this case automated processes like cron jobs are not available.

Using a service account is recommended and needed if you want to use automated processes.

Using Service account

Create a project in Google developers console

Allow the service account to access your merchant center account

Using Client ID for web application

Create a project in Google developers console

Magento Module Configuration

GoogleShoppingAPI attribute mapping

Shell script

NOT YET READY FOR PRODUCTION

Examples

Sync all items in storeid 1

php -f shell/googleshopping.php -- --action syncitems --storeid 1