File tree Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Expand file tree Collapse file tree 1 file changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,13 @@ return [
3434 //....
3535 'components' => [
3636 'cart' => [
37- 'class' => 'yii2mod\cart\Cart'
37+ 'class' => 'yii2mod\cart\Cart',
38+ // you can change default storage class as following:
39+ 'storageClass' => [
40+ 'class' => 'yii2mod\cart\storage\DatabaseStorage',
41+ // you can also override some properties
42+ 'deleteIfEmpty' => true
43+ ]
3844 ],
3945 ]
4046];
@@ -85,8 +91,21 @@ $totalVat = $cart->getAttributeTotal('vat');
8591// clear the cart
8692$cart->clear();
8793
88- // render the contents of the cart with default parameters
89- echo \yii2mod\cart\widgets\CartGrid::widget();
94+ ```
95+
96+ #### View Cart Items
97+
98+ You can use the ` CartGrid ` widget for generate table with cart items as following:
99+ ``` php
100+ <?php echo \yii2mod\cart\widgets\CartGrid::widget([
101+ // Some widget property maybe need to change.
102+ 'cartColumns' => [
103+ 'id',
104+ 'label',
105+ 'price'
106+ ]
107+ ]); ?>
108+
90109```
91110
92111#### Items in the cart
You can’t perform that action at this time.
0 commit comments