techquity/aero-google-shopping

There is no license information available for the latest version (2.2.3) of this package.

An Aero Commerce module for generating and providing access to a Google Shopping feed.

This package's canonical repository appears to be gone and the package has been frozen as a result.

2.2.3 2021-05-20 10:09 UTC

README

A Google Shopping feed generator for Aero Commerce.

Installation

Installation requires Composer and PHP 7.2 or greater.

composer require techquity/aero-google-shopping "^2.0"

Database

The package provides migrations for a new database table that will store Google's Shopping Taxonomies. To create the table and populate it run the following two commands:

php artisan migrate
php artisan tqt:google:taxonomies

These taxonomies are automatically updated at 6am everyday providing that the Laravel scheduler is configured correctly.

Configuration

The base configuration will not work with every project and it is required that the following command be ran to create a project specific configuration file.

php artisan vendor:publish --provider="Techquity\GoogleShopping\Providers\GoogleShopping"

The base configuration file should look like:

<?php

return [
    'run_at' => '01:00',

    'attributes' => [
        'mpn' => null,
        'condition' => 'new',
        'energy_efficiency_class' => null,
        'age_group' => null,
        'color' => 2,
        'gender' => null,
        'material' => 4,
        'size' => [26, 27, 28],
        'size_type' => null,
        'size_system' => 'GB',
        'custom_label_0' => null,
        'custom_label_1' => null,
        'custom_label_2' => null,
        'custom_label_3' => null,
        'custom_label_4' => null,
    ],
];

Run At

run_at determines the time of day that the feed will automatically be regenerated. It accepts a simple string format using the 24 hour clock e.g. '17:30', '11:00' or '01:25'.

Attributes

Each of the required attributes should me mapped to the ID of an Attribute Group in your Aero System. For example, the configuration above assumes that a product's material can be retrived from the 4th attribute group in your application.

Some of the more generic attributes such as size may map to multiple attribute groups, for example in the case of a fashion website you may have multiple attribute groups for sizes specific to a different range of products. One attribute group may be Shoe Size whilst another may be Waist Size each of which are valid for certain products. In the case of the array configuration, the first group to match will be used.

It's not forseen that a product has attributes in more than one group when they are mapped to Google's attributes in this way.

Setting an attribute to null will remove it from the feed entirely. We do not generate XML blocks with empty values.

Generate A Feed

Once your configuration is set you can generate the initial feed with the command below:

php artisan aero:feed:generate google

Scheduling

Providing that you have configured Laravel's Scheduler and defined the cron on your server, the package registers the above command to run once per day at 1am without any further changes. The time can be changed in your configuration file using a simple string such as '01:00' or '17:30'.

For further information regarding Laravel's built in scheduler please refer to the Laravel Documentation

Accessing the feed

The feed can be accessed from the following url: [website.com]/feed/google.xml