PHP code example of kolirt / frontpad.ru-sdk

1. Go to this page and download the library: Download kolirt/frontpad.ru-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/ */

    

kolirt / frontpad.ru-sdk example snippets


$frontpad = new \Kolirt\Frontpad\Frontpad('secret');

$order = new \Kolirt\Frontpad\Order;
$order->setName('Oleh');
$order->setPhone('phonenumber');
$order->setMail('[email protected]');
$order->setStreet('street name');
$order->setHome('19');
$order->setPod('1');
$order->setEt('9');
$order->setApart('920');
$order->setDescr('Comment');
$order->setSaleAmount(100);
$order->addHookStatus(10);
$order->setAffiliate(20);
$order->setPoint(30);
$order->setPerson(4);
$order->setDateTime('2016-08-15 15:30:00');


$order->adTag(10);
$order->adTag(11);
$order->adTag(12);


$product1 = new \Kolirt\Frontpad\Product();
$product1->setIndex($order->getNewProductIndex());
$product1->setId(100);
$product1->setQuantity(2);
$product1->setPrice(100);
$order->addProduct($product1);

$product2 = new \Kolirt\Frontpad\Product();
$product2->setIndex($order->getNewProductIndex());
$product2->setModIndex($product1->getIndex());
$product2->setId(101);
$product2->setQuantity(2);
$product2->setPrice(30);
$order->addProduct($product2);


$frontpad->newOrder($order);

$frontpad = new \Kolirt\Frontpad\Frontpad('secret');

$frontpad->getClient('client_phone');

$frontpad = new \Kolirt\Frontpad\Frontpad('secret');

$frontpad->getCertificate('certificate');

$frontpad = new \Kolirt\Frontpad\Frontpad('secret');

$frontpad->getProducts();