PHP code example of levelfivehub / simplecart

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

    

levelfivehub / simplecart example snippets


$simpleCart = new SimpleCart('test');

$item = [
    'name' => 'Red Balloon',
    'uniqueId' => 'RED001',
    'amount' => 10.99,
    'quantity' => '1',
    'currency' => 'GBP' // optional
];

$simpleCart->addItem($item);

$simpleCart->updateItem('RED001', 3);

$simpleCart->removeItem('RED001');