PHP code example of mohammad-alavi / laravel-shoppingcart
1. Go to this page and download the library: Download mohammad-alavi/laravel-shoppingcart 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/ */
mohammad-alavi / laravel-shoppingcart example snippets
ShoppingCart::addItem(
'1234',
'Basic T-Shirt',
'products',
10,
new Money(999, new Currency('EUR')), // note the value is added in cents!
'/products/1234',
['size' => 'large', 'color' => 'black']
);