Priceminister SDK - French Marketplace
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
tests
.coveralls.yml
.gitignore
.travis.yml
LICENSE
README.md
composer.json
phpunit.xml

README.md

PriceMinister SDK

Build Status Packagist Coverage Status

Usage

composer require pgrimaud/priceminister-sdk

$client = new Priceminister\PriceministerClient('yourLogin', 'yourToken');

$productListing = new Priceminister\ProductListing($client);
$productListing->setParameter('kw', 'iron man tome 1 croire');
$result = $productListing->request();

print_r($result->getProducts());
/*
Array
(
    [0] => Array
        (
            [id] => 283617873
            [values] => Array
                (
                    [name] => Iron Man Tome 1 - Croire
                    [image] => http://pmcdn.priceminister.com/photo/984727643_ML.jpg
                    [breadcrumb] => Livres > BD et livres d'humour > Comics
                    [caption] => 
                    [topic] => Livre
                    [offers] => 13
                    [bestprice] => 7
                )

        )

)
*/

$productListing2 = new ProductListing($client);
$productListing2->setParameter('productids', '283617873');
$result = $productListing->request();

//Get price with shipping cost
echo $result->getBestPrice();
//11.5

//Get price without shipping cost
echo $result->getBestPrice(false);
//7.5