PHP code example of melihovv / laravel-shopping-cart
1. Go to this page and download the library: Download melihovv/laravel-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/ */
Cart::instance('shopping')->add('192ao12', 'Product 1', 100, 10);
// Store and get the content of the 'shopping' cart
Cart::store->content();
Cart::instance('wishlist')->add('sdjk922', 'Product 2', 50, 1, ['size' => 'medium']);
// Store and get the content of the 'wishlist' cart
Cart::store()->content();
// If you want to get the content of the 'shopping' cart again
Cart::instance('shopping')->restore()->content();
// config/shopping-cart.php
'repository' => \Melihovv\ShoppingCart\Repositories\ShoppingCartDatabaseRepository::class,
// or
'repository' => \Melihovv\ShoppingCart\Repositories\ShoppingCartRedisRepository::class,