techquity / aero-google-shopping
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.
Installs: 8 768
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 1
Requires
- php: ^7.2
- ext-simplexml: *
- aerocommerce/core: ^0
- illuminate/database: ^5.8|^6
- illuminate/filesystem: ^5.8|^6
- illuminate/support: ^5.8|^6
This package is auto-updated.
Last update: 2021-06-20 10:28:44 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