1. Go to this page and download the library: Download marshmallow/cart 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/ */
/**
* These are helper functions to get cart totals.
*/
$cart->getTotalAmountWithoutShipping();
$cart->getTotalAmountWithoutShippingAndWithoutVat();
$cart->getShippingAmount();
$cart->getShippingAmountWithoutVat();
$cart->getTotalAmount();
$cart->getTotalAmountWithoutVat();
$cart->getTotalVatAmount();
$cart->getTotalAmountWithoutShippingAndDiscount();
$cart->getTotalAmountWithoutShippingAndDiscountAndWithoutVat();
$cart->getDiscountAmount();
$cart->getDiscountAmountWithoutVat();
/**
* You can format all the methods above to get a string with currency.
*/
$cart->getFormatted('getTotalAmount');
/**
* Extra helpers
*/
$cart->productCount();
$cart->getItemsWithoutShipping();
$cart->getItemsWithoutDiscount();
$cart->getDiscountItems();
$cart->getItemsWithoutDiscountAndShipping();
$cart->getOnlyProductItems();