PHP code example of andrey-helldar / yandex-goods-prices

1. Go to this page and download the library: Download andrey-helldar/yandex-goods-prices 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/ */

    

andrey-helldar / yandex-goods-prices example snippets


Helldar\Yandex\GoodsPrices\ServiceProvider::class,

$currency = app('yandex_goods_prices')->currency()->id('RUB')->rate(2);
$category = app('yandex_goods_prices')->category()->id(1)->name('foo');

$offer = app('yandex_goods_prices')->offer()->other()
    ->id(1234)
    ->available()
    ->categoryId(2)
    ->countryOfOrigin('Россия')
    ->currencyId('USD')
    ->delivery(true)
    ->deliveryOptions(200)
    ->description('foo')
    ->downloadable(true)
    ->manufacturerWarranty('foo')
    ->model('bar')
    ->price(200)
    ->salesNotes('foo')
    ->typePrefix('foo')
    ->url('http://example.com')
    ->vendor('FOO')
    ->vendorCode('foo');

app('yandex_goods_prices')->service()
    ->categories($category, $category)
    ->currencies($currency)
    ->offers($offer)
    ->name('foo')
    ->company('bar')
    ->url('http://example.com')
    ->save();

$currencies = [];

for ($i = 0; $i < 10; $i++) {
    $currency = app('yandex_goods_prices')->currency()->id('USD')->rate($i);
    
    array_push($currencies, $currency);
}

app('yandex_goods_prices')->service()
    ->categories($category_1, $category_2, $categories)
    ->currencies($currency_rur, $currencies)
    ->offers($offers, $offer_1, $offer_2)
    // ...

app('yandex_goods_prices')->offer()->audioBook()
    
app('yandex_goods_prices')->offer()->book()
    
app('yandex_goods_prices')->offer()->eventTicket()
    
app('yandex_goods_prices')->offer()->music()
    
app('yandex_goods_prices')->offer()->tour()
    
app('yandex_goods_prices')->offer()->video()
    
app('yandex_goods_prices')->offer()->other()

php artisan vendor:publish --provider="Helldar\Yandex\GoodsPrices\ServiceProvider"