├── README.md ├── composer.json └── src ├── Moltin └── Cart │ ├── CartServiceProvider.php │ ├── Facade.php │ ├── Identifier │ └── RequestCookie.php │ └── Storage │ ├── LaravelCache.php │ ├── LaravelFile.php │ └── LaravelSession.php └── config └── moltincart.php /README.md: -------------------------------------------------------------------------------- 1 | **THIS REPO IS BEING CONSIDERED FOR OWNERSHIP TRANSFER, PLEASE SEE HERE: https://github.com/moltin/laravel-cart/issues/62#issuecomment-328447136** 2 | 3 | Laravel Shopping Cart Package 4 | ============ 5 | 6 | Laravel Facade and Service Provider for Moltin\Cart 7 | 8 | Installation 9 | --- 10 | via Composer: 11 | ``` 12 | $ composer require moltin/laravel-cart 13 | ``` 14 | 15 | Add the following to your app/config/app.php to the service providers array: 16 | ```php 17 | 'Moltin\Cart\CartServiceProvider', 18 | ``` 19 | 20 | Then add to the aliases array the following: 21 | ```php 22 | 'Cart' => 'Moltin\Cart\Facade', 23 | ``` 24 | 25 | You should then be good to go and be able to access the cart using the following static interface: 26 | 27 | ```php 28 | // Format array of required info for item to be added to basket... 29 | $items = array( 30 | 'id' => 1, 31 | 'name' => 'Juicy Picnic Hamper', 32 | 'price' => 120.00, 33 | 'quantity' => 1 34 | ); 35 | 36 | // Make the insert... 37 | Cart::insert($items); 38 | 39 | // Let's see what we have have in there... 40 | dd(Cart::totalItems()); 41 | ``` 42 | 43 | ###Config settings (Optional) 44 | Publish the config file with `php artisan vendor:publish` 45 | ```php 46 | 47 | return array( 48 | 'storage' => 'session', //session, cache, file 49 | 50 | // Cache 51 | // Laravel documentation for more information 52 | 'cache_prefix' => 'moltin_cart_', 53 | 'cache_expire' => '-1', //in minutes, -1 permanent caching 54 | 55 | // Filesystem 56 | // Folder Name inside the Storage Path 57 | 'storage_folder_name' => 'moltin_cart', 58 | 59 | // Identifier 60 | // With a requestcookie (choose for storage: cache, the session will be expired), the cart could be reloaded from a http request, example: the customer could save his cart link (email, hyperlink) and reopen this later. 61 | // If there is no request, the cookie will be loaded. 62 | 'identifier' => 'cookie', //cookie, requestcookie 63 | 64 | //Request Cookie 65 | 'requestid' => 'CartID', //http input request identifier, example: your customer/backoffice could reload the cart in your shop controller, /public/shop?CartID=871f0bc18ca76e68bf7c3adf8f9426ef 66 | ); 67 | ``` 68 | 69 | 70 | ### Setting the tax rate for an item 71 | Another key you can pass to your insert method is 'tax'. This is a percentage which you would like to be added onto 72 | the price of the item. 73 | 74 | In the below example we will use 20% for the tax rate. 75 | 76 | ```php 77 | Cart::insert(array( 78 | 'id' => 'foo', 79 | 'name' => 'bar', 80 | 'price' => 100, 81 | 'quantity' => 1, 82 | 'tax' => 20 83 | )); 84 | ``` 85 | 86 | ### Updating items in the cart 87 | You can update items in your cart by updating any property on a cart item. For example, if you were within a 88 | cart loop then you can update a specific item using the below example. 89 | ```php 90 | foreach (Cart::contents() as $item) { 91 | $item->name = 'Foo'; 92 | $item->quantity = 1; 93 | } 94 | ``` 95 | 96 | ### Removing cart items 97 | You can remove any items in your cart by using the ```remove()``` method on any cart item. 98 | ```php 99 | foreach (Cart::contents() as $item) { 100 | $item->remove(); 101 | } 102 | ``` 103 | 104 | ### Destroying/emptying the cart 105 | You can completely empty/destroy the cart by using the ```destroy()``` method. 106 | ```php 107 | Cart::destroy() 108 | ``` 109 | 110 | ### Retrieve the cart contents 111 | You can loop the cart contents by using the following method 112 | ```php 113 | Cart::contents(); 114 | ``` 115 | 116 | You can also return the cart items as an array by passing true as the first argument 117 | ```php 118 | Cart::contents(true); 119 | ``` 120 | 121 | ### Retrieving the total items in the cart 122 | ```php 123 | Cart::totalItems(); 124 | ``` 125 | 126 | By default this method will return all items in the cart as well as their quantities. You can pass ```true``` 127 | as the first argument to get all unique items. 128 | ```php 129 | Cart::totalItems(true); 130 | ``` 131 | 132 | ### Retrieving the cart total 133 | ```php 134 | $cart->total(); 135 | ``` 136 | 137 | By default the ```total()``` method will return the total value of the cart as a ```float```, this will include 138 | any item taxes. If you want to retrieve the cart total without tax then you can do so by passing false to the 139 | ```total()``` method 140 | ```php 141 | Cart::total(false); 142 | ``` 143 | 144 | ### Check if the cart has an item 145 | ```php 146 | Cart::has($itemIdentifier); 147 | ``` 148 | 149 | ### Retreive an item object by identifier 150 | ```php 151 | Cart::item($itemIdentifier); 152 | ``` 153 | 154 | ## Cart items 155 | There are several features of the cart items that may also help when integrating your cart. 156 | 157 | ### Retrieving the total value of an item 158 | You can retrieve the total value of a specific cart item (including quantities) using the following method. 159 | ```php 160 | $item->total(); 161 | ``` 162 | 163 | By default, this method will return the total value of the item plus tax. So if you had a product which costs 100, 164 | with a quantity of 2 and a tax rate of 20% then the total returned by this method would be 240. 165 | 166 | You can also get the total minus tax by passing false to the ```total()``` method. 167 | ```php 168 | $item->total(false); 169 | ``` 170 | 171 | This would return 200. 172 | 173 | ### Check if an item has options 174 | You can check if a cart item has options by using the ```hasOptions()``` method. 175 | 176 | ```php 177 | if ($item->hasOptions()) { 178 | // We have options 179 | } 180 | ``` 181 | 182 | ### Remove an item from the cart 183 | ```php 184 | $item->remove(); 185 | ``` 186 | 187 | ### Output the item data as an array 188 | ```php 189 | $item->toArray(); 190 | ``` 191 | -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "moltin/laravel-cart", 3 | "description": "Shopping cart package", 4 | "authors": [ 5 | { 6 | "name": "Moltin Ltd", 7 | "email": "support@molt.in" 8 | } 9 | ], 10 | "minimum-stability": "dev", 11 | "require": { 12 | "php": ">=5.3.0", 13 | "laravel/framework": "~5.0", 14 | "moltin/cart": "dev-master" 15 | }, 16 | "require-dev": { 17 | "phpunit/phpunit": "3.7.*" 18 | }, 19 | "autoload": { 20 | "psr-0": { 21 | "Moltin": "src/" 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/Moltin/Cart/CartServiceProvider.php: -------------------------------------------------------------------------------- 1 | 16 | * @copyright 2013 Moltin Ltd. 17 | * @version dev 18 | * @link http://github.com/moltin/laravel-cart 19 | * 20 | */ 21 | 22 | namespace Moltin\Cart; 23 | 24 | use Illuminate\Support\ServiceProvider; 25 | use Illuminate\Support\Facades\Config; 26 | 27 | use Moltin\Cart\Storage\LaravelSession as SessionStore; 28 | use Moltin\Cart\Storage\LaravelCache as CacheStore; 29 | use Moltin\Cart\Storage\LaravelFile as FileStore; 30 | use Moltin\Cart\Identifier\Cookie as CookieIdentifier; 31 | use Moltin\Cart\Identifier\RequestCookie as CookieRequestIdentifier; 32 | 33 | class CartServiceProvider extends ServiceProvider 34 | { 35 | public function getStorageService() 36 | { 37 | $class = $this->app['config']->get('moltincart.storage', 'session'); 38 | switch ($class) { 39 | case 'session': 40 | return new SessionStore; 41 | break; 42 | 43 | case 'cache': 44 | return new CacheStore; 45 | break; 46 | 47 | case 'file': 48 | return new FileStore; 49 | break; 50 | 51 | default: 52 | return $this->app->make($class); 53 | break; 54 | } 55 | } 56 | 57 | public function getIdentifierService() 58 | { 59 | $class = $this->app['config']->get('moltincart.identifier', 'cookie'); 60 | switch ($class) { 61 | case 'requestcookie': 62 | return new CookieRequestIdentifier; 63 | break; 64 | 65 | case 'cookie': 66 | return new CookieIdentifier; 67 | break; 68 | 69 | default: 70 | return $this->app->make($class); 71 | break; 72 | } 73 | } 74 | 75 | public function register() 76 | { 77 | $that = $this; 78 | 79 | $this->app->singleton('cart', function() use ($that) { 80 | return new Cart($that->getStorageService(), $that->getIdentifierService()); 81 | }); 82 | 83 | $this->app->alias('cart', 'Moltin\Cart\Cart'); 84 | } 85 | 86 | /** 87 | * Bootstrap the application events. 88 | * 89 | * @return void 90 | */ 91 | public function boot() { 92 | $this->publishes([ 93 | __DIR__.'/../../config/moltincart.php' => config_path('moltincart.php'), 94 | ]); 95 | } 96 | } 97 | -------------------------------------------------------------------------------- /src/Moltin/Cart/Facade.php: -------------------------------------------------------------------------------- 1 | 16 | * @copyright 2013 Moltin Ltd. 17 | * @version dev 18 | * @link http://github.com/moltin/laravel-cart 19 | * 20 | */ 21 | 22 | namespace Moltin\Cart; 23 | 24 | class Facade extends \Illuminate\Support\Facades\Facade 25 | { 26 | protected static function getFacadeAccessor() 27 | { 28 | return 'cart'; 29 | } 30 | } -------------------------------------------------------------------------------- /src/Moltin/Cart/Identifier/RequestCookie.php: -------------------------------------------------------------------------------- 1 | 6 | */ 7 | use Illuminate\Support\Facades\Cache; 8 | use Illuminate\Support\Facades\Config; 9 | use Illuminate\Support\Facades\Input; 10 | 11 | class RequestCookie extends Cookie 12 | { 13 | private $requestID; 14 | 15 | public function __construct() 16 | { 17 | $this->requestID = Config::get('moltincart.requestid', 'cookie'); 18 | } 19 | 20 | /** 21 | * Get the current or new unique identifier 22 | * The cart http request overwrites the cookie identifier 23 | * @return string The identifier 24 | */ 25 | public function get() 26 | { 27 | $identifierRequest = Input::get($this->requestID); 28 | 29 | if($identifierRequest) 30 | { 31 | setcookie('cart_identifier', $identifierRequest, 0, "/"); 32 | } 33 | else 34 | { 35 | $identifierRequest = parent::get(); 36 | } 37 | 38 | return $identifierRequest; 39 | } 40 | } -------------------------------------------------------------------------------- /src/Moltin/Cart/Storage/LaravelCache.php: -------------------------------------------------------------------------------- 1 | 6 | */ 7 | 8 | use Moltin\Cart\Item; 9 | use Moltin\Cart\Storage; 10 | use Illuminate\Support\Facades\Config; 11 | use Illuminate\Support\Facades\Cache as LaravelCacheStorage; 12 | 13 | class LaravelCache implements \Moltin\Cart\StorageInterface 14 | { 15 | private $cachePrefix; 16 | 17 | protected $identifier; 18 | 19 | protected static $cart = array(); 20 | 21 | 22 | public function __construct() 23 | { 24 | $this->cachePrefix = Config::get('moltincart.cache_prefix', 'session'); 25 | } 26 | 27 | /** 28 | * @param $identifier 29 | */ 30 | public function restore($identifier) 31 | { 32 | $carts = LaravelCacheStorage::get($this->cachePrefix . $identifier); 33 | 34 | if ($carts) static::$cart = $carts; 35 | } 36 | 37 | /** 38 | * Add or update an item in the cart 39 | * 40 | * @param Item $item The item to insert or update 41 | * @return void 42 | */ 43 | public function insertUpdate(Item $item) 44 | { 45 | static::$cart[$this->id][$item->identifier] = $item; 46 | 47 | $this->saveCart(); 48 | } 49 | 50 | /** 51 | * Retrieve the cart data 52 | * 53 | * @param bool $asArray 54 | * @return array 55 | */ 56 | public function &data($asArray = false) 57 | { 58 | $cart =& static::$cart[$this->id]; 59 | 60 | if ( ! $asArray) return $cart; 61 | 62 | $data = $cart; 63 | 64 | foreach ($data as &$item) { 65 | $item = $item->toArray(); 66 | } 67 | 68 | return $data; 69 | } 70 | 71 | /** 72 | * Check if the item exists in the cart 73 | * 74 | * @param $identifier 75 | * @internal param mixed $id 76 | * @return boolean 77 | */ 78 | public function has($identifier) 79 | { 80 | foreach (static::$cart[$this->id] as $item) { 81 | 82 | if ($item->identifier == $identifier) return true; 83 | 84 | } 85 | 86 | return false; 87 | } 88 | 89 | /** 90 | * Get a single cart item by id 91 | * 92 | * @param mixed $id The item id 93 | * @return Item The item class 94 | */ 95 | public function item($identifier) 96 | { 97 | foreach (static::$cart[$this->id] as $item) { 98 | 99 | if ($item->identifier == $identifier) return $item; 100 | 101 | } 102 | 103 | return false; 104 | } 105 | 106 | /** 107 | * Returns the first occurance of an item with a given id 108 | * 109 | * @param string $id The item id 110 | * @return Item Item object 111 | */ 112 | public function find($id) 113 | { 114 | foreach (static::$cart[$this->id] as $item) { 115 | 116 | if ($item->id == $id) return $item; 117 | 118 | } 119 | 120 | return false; 121 | } 122 | 123 | /** 124 | * Remove an item from the cart 125 | * 126 | * @param mixed $id 127 | * @return void 128 | */ 129 | public function remove($id) 130 | { 131 | unset(static::$cart[$this->id][$id]); 132 | 133 | $this->saveCart(); 134 | } 135 | 136 | /** 137 | * Destroy the cart 138 | * 139 | * @return void 140 | */ 141 | public function destroy() 142 | { 143 | static::$cart[$this->id] = array(); 144 | 145 | $this->saveCart(); 146 | } 147 | 148 | /** 149 | * Set the cart identifier 150 | * 151 | * @param string $identifier 152 | */ 153 | public function setIdentifier($id) 154 | { 155 | $this->id = $id; 156 | 157 | if ( ! array_key_exists($this->id, static::$cart)) { 158 | static::$cart[$this->id] = array(); 159 | } 160 | 161 | $this->saveCart(); 162 | } 163 | 164 | /** 165 | * Return the current cart identifier 166 | * 167 | * @return void 168 | */ 169 | public function getIdentifier() 170 | { 171 | return $this->identifier; 172 | } 173 | 174 | protected function saveCart() 175 | { 176 | $data = static::$cart; 177 | 178 | $expires = Config::get('moltincart.cache_expire', 60); 179 | $cacheID = $this->cachePrefix . $this->id; 180 | 181 | if($expires == -1) 182 | { 183 | LaravelCacheStorage::forever($cacheID, $data); 184 | } 185 | else 186 | { 187 | LaravelCacheStorage::put($cacheID, $data, $expires); 188 | } 189 | } 190 | } 191 | -------------------------------------------------------------------------------- /src/Moltin/Cart/Storage/LaravelFile.php: -------------------------------------------------------------------------------- 1 | 9 | * @link http://github.com/moltin/laravel-cart 10 | * 11 | */ 12 | 13 | namespace Moltin\Cart\Storage; 14 | 15 | use Moltin\Cart\Item; 16 | use Moltin\Cart\Storage; 17 | use Illuminate\Support\Facades\Config; 18 | 19 | class LaravelFile implements \Moltin\Cart\StorageInterface 20 | { 21 | protected $storagePath; 22 | 23 | protected $identifier; 24 | 25 | protected static $cart = array(); 26 | 27 | public function __construct() 28 | { 29 | $folderName = Config::get('moltincart.storage_folder_name', 'Cart'); 30 | $this->storagePath = storage_path($folderName); 31 | 32 | if ( ! file_exists($this->storagePath)) { 33 | mkdir($this->storagePath, 0777, true); 34 | } 35 | } 36 | 37 | public function __destruct() 38 | { 39 | $this->saveCart(); 40 | } 41 | 42 | /** 43 | * @param $identifier 44 | */ 45 | public function restore($identifier) 46 | { 47 | $contents = null; 48 | $cartFilename = $this->storagePath . '/' . $identifier; 49 | 50 | if (file_exists($cartFilename)) { 51 | $contents = file_get_contents($cartFilename); 52 | } 53 | 54 | if ( ! empty($contents)) { 55 | static::$cart = unserialize($contents); 56 | } 57 | } 58 | 59 | /** 60 | * Add or update an item in the cart 61 | * 62 | * @param Item $item The item to insert or update 63 | * @return void 64 | */ 65 | public function insertUpdate(Item $item) 66 | { 67 | static::$cart[$item->identifier] = $item; 68 | 69 | $this->saveCart(); 70 | } 71 | 72 | /** 73 | * Retrieve the cart data 74 | * 75 | * @param bool $asArray 76 | * @return array 77 | */ 78 | public function &data($asArray = false) 79 | { 80 | $cart =& static::$cart; 81 | 82 | if ( ! $asArray) { 83 | return $cart; 84 | } 85 | 86 | $data = $cart; 87 | 88 | foreach ($data as &$item) { 89 | $item = $item->toArray(); 90 | } 91 | 92 | return $data; 93 | } 94 | 95 | /** 96 | * Check if the item exists in the cart 97 | * 98 | * @param $identifier 99 | * @internal param mixed $id 100 | * @return boolean 101 | */ 102 | public function has($identifier) 103 | { 104 | $data = static::$cart; 105 | 106 | foreach ($data as $item) { 107 | if ($item->identifier == $identifier) { 108 | return true; 109 | } 110 | } 111 | 112 | return false; 113 | } 114 | 115 | /** 116 | * Get a single cart item by id 117 | * 118 | * @param mixed $id The item id 119 | * @return Item The item class 120 | */ 121 | public function item($identifier) 122 | { 123 | foreach (static::$cart as $item) { 124 | if ($item->identifier == $identifier) { 125 | return $item; 126 | } 127 | } 128 | 129 | return false; 130 | } 131 | 132 | /** 133 | * Returns the first occurance of an item with a given id 134 | * 135 | * @param string $id The item id 136 | * @return Item Item object 137 | */ 138 | public function find($id) 139 | { 140 | foreach (static::$cart as $item) { 141 | if ($item->id == $id) { 142 | return $item; 143 | } 144 | } 145 | 146 | return false; 147 | } 148 | 149 | /** 150 | * Remove an item from the cart 151 | * 152 | * @param mixed $id 153 | * @return void 154 | */ 155 | public function remove($id) 156 | { 157 | unset(static::$cart[$id]); 158 | 159 | $this->saveCart(); 160 | } 161 | 162 | /** 163 | * Destroy the cart 164 | * 165 | * @return void 166 | */ 167 | public function destroy() 168 | { 169 | static::$cart = array(); 170 | 171 | $this->saveCart(); 172 | } 173 | 174 | /** 175 | * Set the cart identifier 176 | * 177 | * @param string $identifier 178 | */ 179 | public function setIdentifier($identifier) 180 | { 181 | $this->identifier = $identifier; 182 | 183 | // Session::put("cart_identifier", $identifier); 184 | 185 | $this->saveCart(); 186 | } 187 | 188 | /** 189 | * Return the current cart identifier 190 | * 191 | * @return void 192 | */ 193 | public function getIdentifier() 194 | { 195 | return $this->identifier; 196 | } 197 | 198 | /** 199 | * Save the cart to persistant storage 200 | * 201 | * @return void 202 | */ 203 | protected function saveCart() 204 | { 205 | $data = static::$cart; 206 | $cartFilename = $this->storagePath . '/' . $this->identifier; 207 | 208 | if ( ! empty($data)) { 209 | file_put_contents($cartFilename, serialize($data)); 210 | } 211 | } 212 | } 213 | -------------------------------------------------------------------------------- /src/Moltin/Cart/Storage/LaravelSession.php: -------------------------------------------------------------------------------- 1 | 15 | * @copyright 2013 Moltin Ltd. 16 | * @version dev 17 | * @link http://github.com/moltin/cart 18 | * 19 | */ 20 | 21 | namespace Moltin\Cart\Storage; 22 | 23 | use Moltin\Cart\Item; 24 | use Session; 25 | 26 | class LaravelSession implements \Moltin\Cart\StorageInterface 27 | { 28 | protected $identifier; 29 | protected static $cart = array(); 30 | 31 | public function restore() 32 | { 33 | $carts = Session::get('cart'); 34 | 35 | if ($carts) static::$cart = $carts; 36 | } 37 | 38 | /** 39 | * Add or update an item in the cart 40 | * 41 | * @param Item $item The item to insert or update 42 | * @return void 43 | */ 44 | public function insertUpdate(Item $item) 45 | { 46 | static::$cart[$this->id][$item->identifier] = $item; 47 | 48 | $this->saveCart(); 49 | } 50 | 51 | /** 52 | * Retrieve the cart data 53 | * 54 | * @return array 55 | */ 56 | public function &data($asArray = false) 57 | { 58 | $cart =& static::$cart[$this->id]; 59 | 60 | if ( ! $asArray) return $cart; 61 | 62 | $data = $cart; 63 | 64 | foreach ($data as &$item) { 65 | $item = $item->toArray(); 66 | } 67 | 68 | return $data; 69 | } 70 | 71 | /** 72 | * Check if the item exists in the cart 73 | * 74 | * @param mixed $id 75 | * @return boolean 76 | */ 77 | public function has($identifier) 78 | { 79 | foreach (static::$cart[$this->id] as $item) { 80 | 81 | if ($item->identifier == $identifier) return true; 82 | 83 | } 84 | 85 | return false; 86 | } 87 | 88 | /** 89 | * Get a single cart item by id 90 | * 91 | * @param mixed $id The item id 92 | * @return Item The item class 93 | */ 94 | public function item($identifier) 95 | { 96 | foreach (static::$cart[$this->id] as $item) { 97 | 98 | if ($item->identifier == $identifier) return $item; 99 | 100 | } 101 | 102 | return false; 103 | } 104 | 105 | /** 106 | * Returns the first occurance of an item with a given id 107 | * 108 | * @param string $id The item id 109 | * @return Item Item object 110 | */ 111 | public function find($id) 112 | { 113 | foreach (static::$cart[$this->id] as $item) { 114 | 115 | if ($item->id == $id) return $item; 116 | 117 | } 118 | 119 | return false; 120 | } 121 | 122 | /** 123 | * Remove an item from the cart 124 | * 125 | * @param mixed $id 126 | * @return void 127 | */ 128 | public function remove($id) 129 | { 130 | unset(static::$cart[$this->id][$id]); 131 | 132 | $this->saveCart(); 133 | } 134 | 135 | /** 136 | * Destroy the cart 137 | * 138 | * @return void 139 | */ 140 | public function destroy() 141 | { 142 | static::$cart[$this->id] = array(); 143 | 144 | $this->saveCart(); 145 | } 146 | 147 | /** 148 | * Set the cart identifier 149 | * 150 | * @param string $identifier 151 | */ 152 | public function setIdentifier($id) 153 | { 154 | $this->id = $id; 155 | 156 | if ( ! array_key_exists($this->id, static::$cart)) { 157 | static::$cart[$this->id] = array(); 158 | } 159 | 160 | $this->saveCart(); 161 | } 162 | 163 | /** 164 | * Return the current cart identifier 165 | * 166 | * @return void 167 | */ 168 | public function getIdentifier() 169 | { 170 | return $this->identifier; 171 | } 172 | 173 | protected function saveCart() 174 | { 175 | $data = static::$cart; 176 | 177 | Session::put('cart', $data); 178 | } 179 | } 180 | -------------------------------------------------------------------------------- /src/config/moltincart.php: -------------------------------------------------------------------------------- 1 | 'session', //session, cache, file 5 | 6 | // Cache 7 | // Laravel documentation for more information 8 | 'cache_prefix' => 'moltin_cart_', 9 | 'cache_expire' => '-1', //in minutes, -1 permanent caching 10 | 11 | // Filesystem 12 | // Folder Name inside the Storage Path 13 | 'storage_folder_name' => 'moltin_cart', 14 | 15 | // Identifier 16 | // With a requestcookie (choose for storage: cache, the session will be expired), the cart could be reloaded from a http request, example: the customer could save his cart link (email, hyperlink) and reopen this later. 17 | // If there is no request, the cookie will be loaded. 18 | 'identifier' => 'cookie', //cookie, requestcookie 19 | 20 | //Request Cookie 21 | 'requestid' => 'CartID', //http input request identifier, example: your customer/backoffice could reload the cart in your shop controller, /public/shop?CartID=871f0bc18ca76e68bf7c3adf8f9426ef 22 | ); 23 | --------------------------------------------------------------------------------