oldmine/google-merchant-feed-generator

Simple Google Merchant Feed generator library

1.2.1 2018-07-30 19:15 UTC

This package is auto-updated.

Last update: 2024-10-24 08:22:43 UTC


README

Latest Stable Version Total Downloads License

Library to generate valid Google Merchant Feed.

Library check data integrity and format to fit Google Merchant Center requirements.

Data to feed you will take from database, xml, json or other source and set it using library methods.

Getting Started

Dependencies

PHP >= 5.3
Composer (optional)

Install

Choose acceptable installation method to your website

Composer (.json)

{
    "require": {
        "oldmine/google-merchant-feed-generator": "master"
    }
}

Composer (Command Line)

composer require oldmine/google-merchant-feed-generator

Without Composer:

require_once('src/IFeedGenerator.php');
require_once('src/IGenerated.php');
require_once('src/Constants.php');
require_once('src/Item.php');
require_once('src/Channel.php');
require_once('src/Feed.php');
require_once('src/XMLGenerator.php');

Usage examples

See UsageExample.php.

When you have chosen feed generator you can choose method to get result:

$generator->printFeed() // Print feed in current document
$generator->saveFeed($file) // Save feed to $file
$generator->getFeed() // Get feed as string

Tests

To run tests use command:

phpunit tests

Author

License

This project is licensed under the Apache License Version 2.0 - see the LICENSE.md file for details