You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
after running that command, there should be a new file on your config folder name ```shopping_cart.php```
960
+
961
+
Open this file and let's update the storage use. Find the key which says ```'storage' => null,```
962
+
And update it to your newly created DBStorage Class, which on our example,
963
+
```'storage' => \App\DBStorage::class,```
964
+
965
+
OR If you have multiple cart instance (example WishList), you can inject the custom database storage
966
+
to your cart instance by injecting it to the service provider of your wishlist cart, you replace the storage
967
+
to use your custom storage. See below:
801
968
802
969
```
803
970
use Darryldecode\Cart\Cart;
@@ -823,7 +990,7 @@ class WishListProvider extends ServiceProvider
823
990
{
824
991
$this->app->singleton('wishlist', function($app)
825
992
{
826
-
$storage = new WishListDBStorage(); <-- Your new custom storage
993
+
$storage = new DBStorage(); <-- Your new custom storage
827
994
$events = $app['events'];
828
995
$instanceName = 'cart_2';
829
996
$session_key = '88uuiioo99888';
@@ -840,39 +1007,6 @@ class WishListProvider extends ServiceProvider
840
1007
```
841
1008
842
1009
843
-
## Changelogs
844
-
845
-
**2.4.0
846
-
- added new method on a condition: $condition->getAttributes(); (Please see [Conditions](#conditions) section)
847
-
848
-
**2.3.0
849
-
- added new Cart Method: Cart::addItemCondition($productId, $itemCondition)
850
-
- added new Cart Method: Cart::getTotalQuantity()
851
-
852
-
**2.2.1
853
-
- bug fixes
854
-
855
-
**2.2.0
856
-
- added new Cart Method: Cart::getConditionsByType($type)
857
-
- added new Item Method: Cart::removeConditionsByType($type)
858
-
859
-
**2.1.1
860
-
- when a new product with the same ID is added on a cart and a quantity is provided, it will increment its current quantity instead of overwriting it. There's a chance that you will also need to update an item's quantity but not incrementing it but reducing it, please just see the documentation (Please see Cart::update() section, and read carefully)
861
-
862
-
**2.1.0
863
-
- added new Cart Method: getCalculatedValue($totalOrSubTotalOrPrice)
864
-
- added new Item Method: getPriceSum()
865
-
866
-
**2.0.0 (breaking change)
867
-
- major changes in dealing with conditions (Please see [Conditions](#conditions) section, and read carefully)
868
-
- All conditions added on per item bases should have now target => 'item' instead of 'subtotal'
869
-
- All conditions added on per cart bases should have now target => 'subtotal' instead of 'total'
870
-
871
-
**1.1.0
872
-
- added new method: clearCartConditions()
873
-
- added new method: removeItemCondition($itemId, $conditionName)
874
-
- added new method: removeCartCondition($conditionName)
875
-
876
1010
## License
877
1011
878
1012
The Laravel Shopping Cart is open-sourced software licensed under the [MIT license](http://opensource.org/licenses/MIT)
0 commit comments