-
Notifications
You must be signed in to change notification settings - Fork 2
Creating a Cron Job
The GPSF2 feed-generator can be run via a cron job. For the examples that follows, the site's
-
HTTPS_SERVERishttps://mysite.com. -
DIR_WS_CATALOGis/store/. -
Configuration :: Google Product Search Feeder II :: Security Key is set to
xyzzy.
To create a product-feed in the site's default (or only) language, you'll enter the following command for the associated cron job (don't forget the leading and trailing single-quotes!):
wget 'https://mysite.com/store/gpsf_main_controller.php?key=xyzzy'
For v1.0.1 and later, if your site supports multiple languages and you want to generate a feed in each language, you'll include a language parameter on that command to identify which language should be used. If, for example, your site supports both English (en) and Spanish (es), you'll use this for the English-language feed
wget 'https://mysite.com/store/gpsf_main_controller.php?key=xyzzy&language=en'
and this for the Spanish-language feed
wget 'https://mysite.com/store/gpsf_main_controller.php?key=xyzzy&language=es'
Note: v1.0.0 used a problematic language_id parameter that identified the id of the associated language, e.g. 1 for Spanish and 2 for English:
wget 'https://mysite.com/store/gpsf_main_controller.php?key=xyzzy&language_id=2'
v1.0.1 and later of the feed-generator issues a PHP Warning if it finds a no-longer-supported language_id parameter supplied!
The feed-generation uses the currency specified in Configuration :: Google Product Search Feeder II :: Feed Currency unless overridden by the currency_code parameter. That parameter must contain a 3-character currency identifier, e.g. USD or EUR, associated with a currency defined in your site's Localization :: Currencies or a PHP Warning or Error will occur!
Building on the examples in the previous section, if your multi-language site's English feed should provide pricing in USD while the Spanish feed should use EUR, you'll use these cron-job commands (respectively):
wget 'https://mysite.com/store/gpsf_main_controller.php?key=xyzzy&language=en¤cy_code=USD'
wget 'https://mysite.com/store/gpsf_main_controller.php?key=xyzzy&language=es¤cy_code=EUR'
If your site supports multiple languages, Tools :: Google Product Search Feeder II (v1.0.1 and later) displays a cron job suggestion for each language supported:

Otherwise, the tool's cron job suggestion doesn't supply that unneeded language parameter:
