PHP code example of lichi / iiko-sdk

1. Go to this page and download the library: Download lichi/iiko-sdk 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/ */

    

lichi / iiko-sdk example snippets


$nomenclature = $iikoCloud->nomenclature->getNomenclature();
$products = $nomenclature->getProducts(
    [
        'id',
        'name',
        'tags',
        'groupId',
        'parentGroup',
        'imageLinks',
        'tags',
        'sizePrices',
        'type',
        'weight',
        'isDeleted',
        'orderItemType'
    ],
    [
        'imageLinks' => function ($placeData, $fieldValue){
            if(count($fieldValue) === 0){
                return -1;
            }
            return $fieldValue;
        },
        'sizePrices' => function ($placeData, $fieldValue) {
            return $fieldValue[0]['price']['currentPrice'];
        }
    ]);
$groups = $nomenclature->getGroups();
$productWithGroupName = $nomenclature::linkProductsWithGroups($groups, $products);