PHP code example of leroy-merlin-br / bazaarvoice-productfeed

1. Go to this page and download the library: Download leroy-merlin-br/bazaarvoice-productfeed library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

leroy-merlin-br / bazaarvoice-productfeed example snippets

 php
$productFeed = new \BazaarVoice\Product\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);
 php
$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', '[email protected]', 'John Doe', 'userId123', 'pt_BR', $orderProducts);

$feedElement->addInteraction($orderFeed);

// $orderFeed->printFeed();