PHP code example of idofri / doar-calculator

1. Go to this page and download the library: Download idofri/doar-calculator 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/ */

    

idofri / doar-calculator example snippets


$calculator = new Doar\DoarCalculator();

$res = $calculator->setServiceOption($calculator::STANDARD_DELIVERY)
	->setWeight(40)
	->setQuantity(3)
	->setLanguage('HE')
	->Calculate();
  
foreach ($res->getPrices() as $priceOption) {
	echo $priceOption->getPrice();
}


bash
# Install Composer
curl -sS https://getcomposer.org/installer | php
bash
php composer.phar