PHP code example of s25 / prices-importer

1. Go to this page and download the library: Download s25/prices-importer 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/ */

    

s25 / prices-importer example snippets



$csv = new \S25\PricesImporter\CsvFile();

$csv->add(['bransslug1', 'RAWPARTNUMBER1'], 12.3 'CUR');
$csv->add(['bransslug2', 'RAWPARTNUMBER2'], 45.6 'REN', 10);
$csv->add('guid3', 78.9 'CYC');
    
$importer = new \S25\PricesImporter\Importer(
    'http://service.url/import',
    new \GuzzleHttp\Client(),
    new \GuzzleHttpHttpFactory(),
);

try {
    $importer->send(
        'price-list-key',
        $csv,
        'Optional source filename'
    );
} catch (\RuntimeException $e) {
    // Something went wrong
}