2017 © Pedro Peláez
 

library bazaarvoice-productfeed

A PHP library for generating Bazaarvoice XML Product and Interaction Feeds.

image

leroy-merlin-br/bazaarvoice-productfeed

A PHP library for generating Bazaarvoice XML Product and Interaction Feeds.

  • Thursday, July 19, 2018
  • by diegofelix
  • Repository
  • 18 Watchers
  • 0 Stars
  • 14 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 21 Versions
  • 0 % Grown

The README.md

Bazaarvoice Product and Interaction feed Library

Latest Version on Packagist Software License Total Downloads Build Status Coverage Status, (*1)

A PHP library for generating and sFTPing XML Bazaarvoice Feeds., (*2)

Install

Via Composer, (*3)

``` bash $ composer require leroy-merlin-br/bazaarvoice-feed, (*4)


## Usage ### Creating a Feed. ``` php $productFeed = new \BazaarVoice\Product\Feed();

Creating a feedElement

``` php $productFeed = new \BazaarVoice\Product\Feed(); $feedElement = $productFeed->newFeed('my_feed');, (*5)


### Creating an Incremental feed. ``` php $productFeed = new \BazaarVoice\Product\Feed(); $feedElement = $productFeed->newFeed('my_feed', true);

``` php $productFeed = new \BazaarVoice\Product\Feed(); $feedElement = $productFeed->newFeed('my_feed') ->setIncremental(true);, (*6)



### Creating products and adding them to a feed. ``` php $productFeed = new \BazaarVoice\Product\Feed(); $feedElement = $productFeed->newFeed('my_feed'); $productElement = $productFeed->newProduct('my_product', 'My Product', 'product_category_123', 'http://www.example.com/my-product', 'http://www.example.com/images/my-product.jpg'); $feedElement->addProduct($product_element); $moreProducts = []; $secondProduct = $productFeed->newProduct('second_product', 'Second Product', 'product_category_456', 'http://www.example.com/second-product', 'http://www.example.com/images/second-product.jpg'); ->setDescription('This is my second product') ->addPageUrl('http://www.example.es/second-product', 'es_SP') ->setBrandId('my_brand_123') ->addUPC('012345'); $moreProducts[] = $secondProduct; $moreProducts[] = $productFeed->newProduct('third_product', 'Third Product', 'product_category_789', 'http://www.example.com/third-product', 'http://www.example.com/images/third-product.jpg') ->addISBN('123-456-7890') ->addPageUrl('http://www.example.co.uk/third-product', 'en_UK') ->addCustomAttribute('PRODUCT_FAMILY', 'example_products'); $feedElement->addProducts($moreProducts);

Creating categories and adding them to a feed.

``` php $productFeed = new \BazaarVoice\Product\Feed(); $feedElement = $productFeed->newFeed('my_feed');, (*7)

// ..., (*8)

$categoryElement = $productFeed->newCategory('my_category', 'My Category', 'http://www.example.com/my-product'); $feedElement->addCategory($categoryElement);, (*9)

$moreCategories = [];, (*10)

$secondCategory = $productFeed->newCategory('second_category', 'Second Category', 'http://www.example.com/second-category') ->setImageUrl('http://www.example.com/images/second-category.jpg') ->addImageUrl('http://www.example.co.uk/images/uk-second-category.jpg', 'en_UK') ->setParentId('parent_category_id');, (*11)

$moreCategories[] = $secondCategory;, (*12)

$feedElement->addCategories($moreCategories);, (*13)


### Creating brands and adding them to a feed. ``` php $productFeed = new \BazaarVoice\Product\Feed(); $feedElement = $productFeed->newFeed('my_feed'); // ... $brandElement = $productFeed->newBrand('my_brand', 'My Brand'); $feedElement->addBrand($brandElement); $moreBrands = []; $secondBrand = $productFeed->newBrand('second_brand', 'Second Brand') ->addName('Duo Brand', 'es_SP') ->addName('Brand the Second', 'en_UK'); $moreBrands[] = $secondBrand; $moreBrands[] = $productFeed->newBrand('third_brand', 'Third Brand'); $feedElement->addBrands($moreBrands);

Creating interactions (orders) and adding them to a feed.

``` php $orderFeed = new \BazaarVoice\Interaction\Feed(); $feedElement = $orderFeed->newFeed('Order feed');, (*14)

$orderProducts = [ [ 'id' => 'productId123', 'name' => 'Product name', 'category' => 'Product Category', 'url' => 'http://product-url', 'imageUrl' => 'http://image-url', 'price' => 29, ], ]; $order = $feed->newInteraction('22/03/1987', 'john@doe.com', 'John Doe', 'userId123', 'pt_BR', $orderProducts);, (*15)

$feedElement->addInteraction($orderFeed);, (*16)

// $orderFeed->printFeed();, (*17)


### Print ProductFeed XML string ``` php $productFeed = new \BazaarVoice\Product\Feed(); $feedElement = $productFeed->newFeed('my_feed'); // ... add products, brands & categories ... print $productFeed->printFeed($feedElement);

Saving Productfeed as an XML file.

``` php, (*18)

$productFeed = new \BazaarVoice\Product\Feed(); $feedElement = $productFeed->newFeed('my_feed');, (*19)

// ... add products, brands & categories ..., (*20)

$productFeed->saveFeed($feedElement, 'path/to/dir', 'my_feed_XYZ');, (*21)


### SFTP ProductFeed to BazaarVoice Production. ``` php $productFeed = new \BazaarVoice\Product\Feed(); $feedElement = $productFeed->newFeed('my_feed'); // ... add products, brands & categories ... if ($feedFile = $productFeed->saveFeed($feedElement, 'path/to/dir', 'my_feed_XYZ') { try { $productFeed->sendFeed($feedFile, $sftpUsername, $sftpPassword); } catch (\Exception $e) { // Failed to FTP feed file. } }

SFTP ProductFeed to Bazaarvoice Staging.

``` php, (*22)

$productFeed = new \BazaarVoice\Product\Feed(); $feedElement = $productFeed->newFeed('my_feed');, (*23)

// ... add products, brands & categories ..., (*24)

if ($feedFile = $productFeed->saveFeed($feedElement, 'path/to/dir', 'my_feed_XYZ') {
try { $productFeed->useStage()->sendFeed($feedFile, $sftpUsername, $sftpPassword); } catch (\Exception $e) { // Failed to FTP feed file. } }, (*25)



## Testing ``` bash $ composer test

Credits

License

The MIT License (MIT). Please see License File for more information., (*26)

The Versions

19/07 2018

dev-master

9999999-dev https://github.com/leroy-merlin-br/bazaarvoice-productfeed

A PHP library for generating Bazaarvoice XML Product and Interaction Feeds.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Miles
by Boitatá Team

bazaarvoice

19/07 2018

2.1.0

2.1.0.0 https://github.com/leroy-merlin-br/bazaarvoice-productfeed

A PHP library for generating Bazaarvoice XML Product and Interaction Feeds.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Miles
by Boitatá Team

bazaarvoice

19/07 2018

dev-compression-option

dev-compression-option https://github.com/leroy-merlin-br/bazaarvoice-productfeed

A PHP library for generating Bazaarvoice XML Product and Interaction Feeds.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Miles
by Boitatá Team

bazaarvoice

17/07 2018

2.0.2

2.0.2.0 https://github.com/leroy-merlin-br/bazaarvoice-productfeed

A PHP library for generating Bazaarvoice XML Product and Interaction Feeds.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Miles
by Boitatá Team

bazaarvoice

16/07 2018

2.0.1

2.0.1.0 https://github.com/leroy-merlin-br/bazaarvoice-productfeed

A PHP library for generating Bazaarvoice XML Product and Interaction Feeds.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Miles
by Boitatá Team

bazaarvoice

13/07 2018

2.0.0

2.0.0.0 https://github.com/leroy-merlin-br/bazaarvoice-productfeed

A PHP library for generating Bazaarvoice XML Product and Interaction Feeds.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Miles
by Boitatá Team

bazaarvoice

13/07 2018

1.3.0

1.3.0.0 https://github.com/leroy-merlin-br/bazaarvoice-productfeed

A PHP library for generating Bazaarvoice XML ProductFeeds.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Miles

bazaarvoice

10/07 2018

1.2.0

1.2.0.0 https://github.com/leroy-merlin-br/bazaarvoice-productfeed

A PHP library for generating Bazaarvoice XML ProductFeeds.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Miles

bazaarvoice

06/07 2018

1.1.0

1.1.0.0 https://github.com/leroy-merlin-br/bazaarvoice-productfeed

A PHP library for generating Bazaarvoice XML ProductFeeds.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Miles

bazaarvoice

04/10 2017

1.0.10

1.0.10.0 https://github.com/mikemiles86/bazaarvoice-productfeed

A PHP library for generating Bazaarvoice XML ProductFeeds.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Miles

bazaarvoice

04/10 2017

1.0.9

1.0.9.0 https://github.com/mikemiles86/bazaarvoice-productfeed

A PHP library for generating Bazaarvoice XML ProductFeeds.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Michael Miles

bazaarvoice

02/10 2017

1.0.8

1.0.8.0 https://github.com/mikemiles86/bazaarvoice-productfeed

A PHP library for generating Bazaarvoice XML ProductFeeds.

  Sources   Download

MIT

The Requires

  • php >=5.5
  • ext-simplexml *
  • ext-ssh2 *

 

The Development Requires

by Michael Miles

bazaarvoice

26/09 2017

1.0.7

1.0.7.0 https://github.com/mikemiles86/bazaarvoice-productfeed

A PHP library for generating Bazaarvoice XML ProductFeeds.

  Sources   Download

MIT

The Requires

  • php >=5.5
  • ext-simplexml *
  • ext-ssh2 *

 

The Development Requires

by Michael Miles

bazaarvoice

17/07 2017

1.0.6

1.0.6.0 https://github.com/mikemiles86/bazaarvoice-productfeed

A PHP library for generating Bazaarvoice XML ProductFeeds.

  Sources   Download

MIT

The Requires

  • php >=5.5
  • ext-simplexml *
  • ext-ssh2 *

 

The Development Requires

by Michael Miles

bazaarvoice

13/07 2017

1.0.5

1.0.5.0 https://github.com/mikemiles86/bazaarvoice-productfeed

A PHP library for generating Bazaarvoice XML ProductFeeds.

  Sources   Download

MIT

The Requires

  • php >=5.5
  • ext-simplexml *
  • ext-ssh2 *

 

The Development Requires

by Michael Miles

bazaarvoice

12/07 2017

1.0.4

1.0.4.0 https://github.com/mikemiles86/bazaarvoice-productfeed

A PHP library for generating Bazaarvoice XML ProductFeeds.

  Sources   Download

MIT

The Requires

  • php >=5.5
  • ext-simplexml *
  • ext-ssh2 *

 

The Development Requires

by Michael Miles

bazaarvoice

31/05 2017

dev-1.0.x-dev

dev-1.0.x-dev https://github.com/mikemiles86/bazaarvoice-productfeed

A PHP library for generating Bazaarvoice XML ProductFeeds.

  Sources   Download

MIT

The Requires

  • php >=5.5
  • ext-simplexml *
  • ext-ssh2 *

 

The Development Requires

by Michael Miles

bazaarvoice

31/05 2017

1.0.2

1.0.2.0 https://github.com/mikemiles86/bazaarvoice-productfeed

A PHP library for generating Bazaarvoice XML ProductFeeds.

  Sources   Download

MIT

The Requires

  • php >=5.5
  • ext-simplexml *
  • ext-ssh2 *

 

The Development Requires

by Michael Miles

bazaarvoice

31/05 2017

1.0.3

1.0.3.0 https://github.com/mikemiles86/bazaarvoice-productfeed

A PHP library for generating Bazaarvoice XML ProductFeeds.

  Sources   Download

MIT

The Requires

  • php >=5.5
  • ext-simplexml *
  • ext-ssh2 *

 

The Development Requires

by Michael Miles

bazaarvoice

24/05 2017

1.0.1

1.0.1.0 https://github.com/mikemiles86/bazaarvoice-productfeed

A PHP library for generating Bazaarvoice XML ProductFeeds.

  Sources   Download

MIT

The Requires

  • php >=5.5
  • ext-simplexml *
  • ext-ssh2 *

 

The Development Requires

by Michael Miles

bazaarvoice

24/05 2017

1.0.0

1.0.0.0 https://github.com/mikemiles86/bazaarvoice-productfeed

A PHP library for generating Bazaarvoice XML ProductFeeds.

  Sources   Download

MIT

The Requires

  • php >=5.5
  • ext-simplexml *
  • ext-ssh2 *

 

The Development Requires

by Michael Miles

bazaarvoice