PHPackages                             mikemiles86/bazaarvoice-productfeed - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mikemiles86/bazaarvoice-productfeed

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mikemiles86/bazaarvoice-productfeed
===================================

A PHP library for generating Bazaarvoice XML ProductFeeds.

1.1.1(3y ago)036.7k4MITPHPPHP &gt;=5.5

Since May 24Pushed 3y ago2 watchersCompare

[ Source](https://github.com/mikemiles86/bazaarvoice-productfeed)[ Packagist](https://packagist.org/packages/mikemiles86/bazaarvoice-productfeed)[ Docs](https://github.com/mikemiles86/bazaarvoice-productfeed)[ RSS](/packages/mikemiles86-bazaarvoice-productfeed/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (15)Used By (0)

Bazaarvoice Productfeed Library
===============================

[](#bazaarvoice-productfeed-library)

[![Latest Version on Packagist](https://camo.githubusercontent.com/b8acf37a8ebdd08a91d4691ec2ff3b6de4c0daf536e773dd5ca96f9552262ed3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d696b656d696c657338362f62617a616172766f6963652d70726f64756374666565642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mikemiles86/bazaarvoice-productfeed)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/f2845db83e3c7409c42e9cc839fbd833bf7214612a99cfc3711d6de1c825f8fa/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d696b656d696c657338362f62617a616172766f6963652d70726f64756374666565642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/mikemiles86/bazaarvoice-productfeed)

A PHP library for generating and sFTPing XML [Bazaarvoice ProductFeeds](http://labsbp-docsportal.aws.bazaarvoice.com/DataFeeds/Introduction/IntroductionDataFeeds_con.html).

Install
-------

[](#install)

Via Composer

```
$ composer require mikemiles86/bazaarvoice-productfeed
```

Usage
-----

[](#usage)

### Creating a Feed.

[](#creating-a-feed)

```
$productFeed = new \BazaarvoiceProductFeed\ProductFeed();
```

### Creating a feedElement

[](#creating-a-feedelement)

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

### Creating an Incremental feed.

[](#creating-an-incremental-feed)

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

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

### Creating products and adding them to a feed.

[](#creating-products-and-adding-them-to-a-feed)

```
$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.

[](#creating-categories-and-adding-them-to-a-feed)

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

// ...

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

$more_categories = [];

$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');

$more_categories[] = $second_category;

$feed_element->addCategories($more_categories);
```

### Creating brands and adding them to a feed.

[](#creating-brands-and-adding-them-to-a-feed)

```
$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);
```

### Print ProductFeed XML string

[](#print-productfeed-xml-string)

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

// ... add products, brands & categories ...

print $productFeed->printFeed($feed_element);
```

### Saving Productfeed as an XML file.

[](#saving-productfeed-as-an-xml-file)

```
$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.

[](#sftp-productfeed-to-bazaarvoice-production)

```
$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->sendFeed($feed_file, $sftp_username, $sftp_password);
  } catch (\Exception $e) {
    // Failed to FTP feed file.
  }
}
```

#### SFTP ProductFeed to Bazaarvoice Staging.

[](#sftp-productfeed-to-bazaarvoice-staging)

```
$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
-------

[](#testing)

```
$ composer test
```

Credits
-------

[](#credits)

- [Mike Miles](https://github.com/mikemiles86)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

35

—

LowBetter than 79% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 75% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~157 days

Recently: every ~438 days

Total

13

Last Release

1393d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8368b5790fd7adca25e93e06988a6c7fce33aef6fc3f382b3e9c84c80bab41b2?d=identicon)[mikemiles86](/maintainers/mikemiles86)

---

Top Contributors

[![mikemiles86](https://avatars.githubusercontent.com/u/196745?v=4)](https://github.com/mikemiles86 "mikemiles86 (6 commits)")[![mglaman](https://avatars.githubusercontent.com/u/3698644?v=4)](https://github.com/mglaman "mglaman (1 commits)")[![piggito](https://avatars.githubusercontent.com/u/1173779?v=4)](https://github.com/piggito "piggito (1 commits)")

---

Tags

bazaarvoice

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mikemiles86-bazaarvoice-productfeed/health.svg)

```
[![Health](https://phpackages.com/badges/mikemiles86-bazaarvoice-productfeed/health.svg)](https://phpackages.com/packages/mikemiles86-bazaarvoice-productfeed)
```

###  Alternatives

[jenssegers/optimus

Id obfuscation based on Knuth's integer hash method

1.3k4.8M27](/packages/jenssegers-optimus)[phpseclib/mcrypt_compat

PHP 5.x-8.x polyfill for mcrypt extension

28029.7M34](/packages/phpseclib-mcrypt-compat)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k20](/packages/civicrm-civicrm-core)[phpseclib/bcmath_compat

PHP 5.x-8.x polyfill for bcmath extension

16720.7M17](/packages/phpseclib-bcmath-compat)[codercat/jwk-to-pem

Convert JWK to PEM format.

1004.5M20](/packages/codercat-jwk-to-pem)[salla/zatca

A helper to generate the QR code and signed it for ZATCA e-invoicing

159416.7k2](/packages/salla-zatca)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
