1. Go to this page and download the library: Download treestoneit/shopping-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/ */
treestoneit / shopping-cart example snippets
use Illuminate\Database\Eloquent\Model;
use Treestoneit\ShoppingCart\Buyable;
use Treestoneit\ShoppingCart\BuyableTrait;
class Product extends Model implements Buyable
{
use BuyableTrait;
}
use Treestoneit\ShoppingCart\Taxable;
class Product extends Model implements Buyable, Taxable
{
/**
* Calculate the tax here based on a database column, or whatever you will.
*
* @return int|float
*/
public function getTaxRate()
{
if ($this->tax_rate) {
return $this->tax_rate;
}
if (! $this->taxable) {
return 0;
}
return 8;
}