1. Go to this page and download the library: Download drewdan/royal-mail-pricing 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/ */
use Drewdan\RoyalMailPricing\Consignment;
$consignment = Consignment::make()
->addItem($item)
->assignToParcels()
->getConsignment();
$consignment->getPostageCost('firstClassPostage'); // Returns the price of the consignment for first class postage
$consignment->getPostageCost('secondClassPostage'); // Returns the price of the consignment for second class postage
$consignment->getParcels(); // Returns an array of parcels which make up the consignment
$consignment->getConsignmentWeight(); // Returns the total weight of the consignment
$consignment->getParcelCount(); // Returns the number of parcels in the consignment
$consignment->getItemCount(); // Returns the number of items in the consignment