PHP code example of johannesschobel / laravel-shoppingcart
1. Go to this page and download the library: Download johannesschobel/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/ */
johannesschobel / 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']
);