lukesnowden / google-shopping-feed
Google Shopping Feed API
Installs: 236 247
Dependents: 1
Suggesters: 0
Security: 0
Stars: 68
Watchers: 5
Forks: 60
Open Issues: 10
Requires
- php: >=5.3.0
- gregwar/cache: 1.0.*
README
Composer
How to install with composer.
{ "require": { "lukesnowden/google-shopping-feed": "^2.2" } }
Usage
Example of Google feed generation.
use LukeSnowden\GoogleShoppingFeed\Containers\GoogleShopping; GoogleShopping::title('Test Feed'); GoogleShopping::link('http://example.com/'); GoogleShopping::description('Our Google Shopping Feed'); foreach( $products as $product ) { $item = GoogleShopping::createItem(); $item->id($id); $item->title($title); $item->price($price); $item->mpn($SKU); $item->sale_price($salePrice); $item->link($link); $item->image_link($imageLink); ... ... /** create a variant */ $variant = $item->variant(); $variant->size($variant::LARGE); $variant->color('Red'); /** * One thing to note, if creating variants, delete the initial object after you've done, * Google no longer needs it! * * $item->delete(); * */ } // boolean value indicates output to browser GoogleShopping::asRss(true);
Category Taxonomies
Returns a list of the categories. The list is updated daily from Googles Documentation
$lang = 'gb'; $googleCategories = GoogleShopping::categories($lang);
$lang
can be one of these Google supported languages: au, br, cn, cz, de, dk, es, fr, gb, it, jp, nl, no, pl, ru, sw, tr, us.