PHP code example of pugofka / dpd
1. Go to this page and download the library: Download pugofka/dpd 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/ */
pugofka / dpd example snippets
use Pugofka\Dpd\Dpd;
$dpd = new Dpd();
// get all available cities
$dpd->getCities();
// calculate delivery cost
$dpd->getCostCommon (
string $from, // ID city from
string $to, // ID city to
bool $selfPickup = true,
bool $selfDelivery=false,
float $weight = 0, // weight in kg
float $declaredValue = 0,
$pickupDate = null, // format 2014-05-21
float $volume = null
);
// get all available pickpoints
$dpd->getPickPoints();
// get all available terminals
$dpd->getTerminals();