2017 © Pedro Peláez
 

library bazaarvoice-productfeed

A PHP library for generating Bazaarvoice XML ProductFeeds.

image

mikemiles86/bazaarvoice-productfeed

A PHP library for generating Bazaarvoice XML ProductFeeds.

  • Wednesday, October 4, 2017
  • by mikemiles86
  • Repository
  • 1 Watchers
  • 0 Stars
  • 807 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 13 Versions
  • 13 % Grown

The README.md

Bazaarvoice Productfeed Library

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

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

Install

Via Composer, (*3)

``` bash $ composer require mikemiles86/bazaarvoice-productfeed, (*4)


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

Creating a feedElement

``` php $productFeed = new \BazaarvoiceProductFeed\ProductFeed(); $feed_element = $productFeed->newFeed('my_feed');, (*5)


### Creating an Incremental feed. ``` php $productFeed = new \BazaarvoiceProductFeed\ProductFeed(); $feed_element = $productFeed->newFeed('my_feed', TRUE);

``` php $productFeed = new \BazaarvoiceProductFeed\ProductFeed(); $feed_element = $productFeed->newFeed('my_feed') ->setIncremental(TRUE);, (*6)



### Creating products and adding them to a feed. ``` php $productFeed = new \BazaarvoiceProductFeed\ProductFeed(); $feed_element = $productFeed->newFeed('my_feed'); $product_element = $productFeed->newProduct('my_product', 'My Product', 'product_category_123', 'htttp://www.example.com/my-product', 'http://www.example.com/images/my-product.jpg'); $feed_element->addProduct($product_element); $more_products = []; $second_product = $productFeed->newProduct('second_product', 'Second Product', 'product_category_456', 'htttp://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'); $more_products[] = $second_product; $more_products[] = $productFeed->newProduct('third_product', 'Third Product', 'product_category_789', 'htttp://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'); $feed_element->addProducts($more_products);

Creating categories and adding them to a feed.

``` php $productFeed = new \BazaarvoiceProductFeed\ProductFeed(); $feed_element = $productFeed->newFeed('my_feed');, (*7)

// ..., (*8)

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

$more_categories = [];, (*10)

$second_category = $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)

$more_categories[] = $second_category;, (*12)

$feed_element->addCategories($more_categories);, (*13)


### Creating brands and adding them to a feed. ``` php $productFeed = new \BazaarvoiceProductFeed\ProductFeed(); $feed_element = $productFeed->newFeed('my_feed'); // ... $brand_element = $productFeed->newBrand('my_brand', 'My Brand'); $feed_element->addBrand($brand_element); $more_brands = []; $second_brand = $productFeed->newBrand('second_brand', 'Second Brand') ->addName('Duo Brand', 'es_SP') ->addName('Brand the Second', 'en_UK'); $more_brands[] = $second_brand; $more_brands[] = $productFeed->newBrand('third_brand', 'Third Brand'); $feed_element->addBrands($more_brands);

``` php $productFeed = new \BazaarvoiceProductFeed\ProductFeed(); $feed_element = $productFeed->newFeed('my_feed');, (*14)

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

print $productFeed->printFeed($feed_element);, (*16)


### Saving Productfeed as an XML file. ``` php $productFeed = new \BazaarvoiceProductFeed\ProductFeed(); $feed_element = $productFeed->newFeed('my_feed'); // ... add products, brands & categories ... $productFeed->saveFeed($feed_element, 'path/to/dir', 'my_feed_XYZ');

SFTP ProductFeed to Bazaarvoice Production.

``` php, (*17)

$productFeed = new \BazaarvoiceProductFeed\ProductFeed(); $feed_element = $productFeed->newFeed('my_feed');, (*18)

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

if ($feed_file = $productFeed->saveFeed($feed_element, 'path/to/dir', 'my_feed_XYZ') {
try { $productFeed->sendFeed($feed_file, $sftp_username, $sftp_password); } catch (\Exception $e) { // Failed to FTP feed file. } }, (*20)


#### SFTP ProductFeed to Bazaarvoice Staging. ``` php $productFeed = new \BazaarvoiceProductFeed\ProductFeed(); $feed_element = $productFeed->newFeed('my_feed'); // ... add products, brands & categories ... if ($feed_file = $productFeed->saveFeed($feed_element, 'path/to/dir', 'my_feed_XYZ') { try { $productFeed->useStage()->sendFeed($feed_file, $sftp_username, $sftp_password); } catch (\Exception $e) { // Failed to FTP feed file. } }

Testing

bash $ composer test, (*21)

Credits

License

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

The Versions

04/10 2017

dev-master

9999999-dev 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.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