PHPackages                             leroy-merlin-br/bazaarvoice-feed - 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. [API Development](/categories/api)
4. /
5. leroy-merlin-br/bazaarvoice-feed

ActiveLibrary[API Development](/categories/api)

leroy-merlin-br/bazaarvoice-feed
================================

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

2.3.1(1y ago)17.7kMITPHPPHP ^8.0

Since May 24Pushed 1y ago15 watchersCompare

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

READMEChangelog (10)Dependencies (3)Versions (24)Used By (0)

Bazaarvoice Product and Interaction feed Library
================================================

[](#bazaarvoice-product-and-interaction-feed-library)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9759eeb11bee6c88365b72b76096b2d4804d268fb03d90aeaaf293112c26adcf/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c65726f792d6d65726c696e2d62722f62617a616172766f6963652d666565642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/leroy-merlin-br/bazaarvoice-feed)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)[![Total Downloads](https://camo.githubusercontent.com/bfdea63f5dfd220ddebe220aedb4c48425502f5077ec6a9f6cbef54be8466021/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c65726f792d6d65726c696e2d62722f62617a616172766f6963652d666565642e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/leroy-merlin-br/bazaarvoice-feed)[![Build Status](https://camo.githubusercontent.com/2d4ac7fedf94b71c4e2f754f526b17494446a195d655d2be22bdf5ff7fad423a/68747470733a2f2f7472617669732d63692e6f72672f6c65726f792d6d65726c696e2d62722f62617a616172766f6963652d666565642e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/leroy-merlin-br/bazaarvoice-feed)[![Coverage Status](https://camo.githubusercontent.com/10433825dfb384b3ed6faaa083f1bb066126ba34dec41a9899b8185e0b84c26c/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6c65726f792d6d65726c696e2d62722f62617a616172766f6963652d666565642f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/leroy-merlin-br/bazaarvoice-feed?branch=master)

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

Install
-------

[](#install)

Via Composer

```
$ composer require leroy-merlin-br/bazaarvoice-feed
```

Usage
-----

[](#usage)

### Creating a Feed.

[](#creating-a-feed)

```
$productFeed = new \BazaarVoice\Product\Feed();
```

### Creating a feedElement

[](#creating-a-feedelement)

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

### Creating an Incremental feed.

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

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

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

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

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

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

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

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

// ...

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

$moreCategories = [];

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

$moreCategories[] = $secondCategory;

$feedElement->addCategories($moreCategories);
```

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

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

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

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

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

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

$feedElement->addInteraction($orderFeed);

// $orderFeed->printFeed();
```

### Print ProductFeed XML string

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

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

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

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

### Saving Productfeed as an XML file.

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

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

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

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

### SFTP ProductFeed to BazaarVoice Production.

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

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

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

```
$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->useStage()->sendFeed($feedFile, $sftpUsername, $sftpPassword);
  } 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

41

—

FairBetter than 89% of packages

Maintenance32

Infrequent updates — may be unmaintained

Popularity23

Limited adoption so far

Community20

Small or concentrated contributor base

Maturity78

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~129 days

Recently: every ~541 days

Total

21

Last Release

692d ago

Major Versions

1.3.0 → 2.0.02018-07-13

PHP version history (4 changes)1.0.0PHP &gt;=5.5

1.1.0PHP &gt;=7.2

1.2.0PHP &gt;=7.1

2.3.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/e194ba7e161aff1c3c59ce5127984ff8a0ea7a5ceb35efe6b0f5a78bd66d0e91?d=identicon)[diegofelix](/maintainers/diegofelix)

![](https://www.gravatar.com/avatar/f848446124bcd080151222405e6b1146f1c580fbbd70a9ec29fa2574a9da7cab?d=identicon)[svc-lmbr-boitata](/maintainers/svc-lmbr-boitata)

---

Top Contributors

[![diegofelix](https://avatars.githubusercontent.com/u/238054?v=4)](https://github.com/diegofelix "diegofelix (36 commits)")[![brnbp](https://avatars.githubusercontent.com/u/8925112?v=4)](https://github.com/brnbp "brnbp (31 commits)")[![carusogabriel](https://avatars.githubusercontent.com/u/16328050?v=4)](https://github.com/carusogabriel "carusogabriel (9 commits)")[![djonasm](https://avatars.githubusercontent.com/u/1079090?v=4)](https://github.com/djonasm "djonasm (4 commits)")[![ezandonai](https://avatars.githubusercontent.com/u/14354251?v=4)](https://github.com/ezandonai "ezandonai (3 commits)")[![orlandocavassani](https://avatars.githubusercontent.com/u/17056201?v=4)](https://github.com/orlandocavassani "orlandocavassani (2 commits)")[![williancs](https://avatars.githubusercontent.com/u/5855678?v=4)](https://github.com/williancs "williancs (2 commits)")[![mikemiles86](https://avatars.githubusercontent.com/u/196745?v=4)](https://github.com/mikemiles86 "mikemiles86 (1 commits)")[![ravanscafi](https://avatars.githubusercontent.com/u/6104262?v=4)](https://github.com/ravanscafi "ravanscafi (1 commits)")

---

Tags

bazaarvoice

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/leroy-merlin-br-bazaarvoice-feed/health.svg)

```
[![Health](https://phpackages.com/badges/leroy-merlin-br-bazaarvoice-feed/health.svg)](https://phpackages.com/packages/leroy-merlin-br-bazaarvoice-feed)
```

###  Alternatives

[google/apiclient

Client library for Google APIs

9.8k191.4M997](/packages/google-apiclient)[wheelpros/fitment-platform-api

Magento 2 (Open Source)

12.1k1.2k](/packages/wheelpros-fitment-platform-api)[web3p/web3.php

Ethereum web3 interface.

1.3k325.5k41](/packages/web3p-web3php)[packbackbooks/lti-1p3-tool

A library used for building IMS-certified LTI 1.3 tool providers in PHP.

51438.3k2](/packages/packbackbooks-lti-1p3-tool)[yoti/yoti-php-sdk

Yoti SDK for quickly integrating your PHP backend with Yoti

27539.9k1](/packages/yoti-yoti-php-sdk)[hoels/app-store-server-library-php

The PHP server library for the App Store Server API and App Store Server Notifications.

44162.2k](/packages/hoels-app-store-server-library-php)

PHPackages © 2026

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