dev-master
9999999-devYii2 Cart extension
BSD-3-Clause
The Requires
by MarcioCamello
extension yii2 cart mcms moltin
Yii2 Cart extension
Cart extensions for Yii 2 Refactory library from Codeginiter Cart Class v3.0dev, (*1)
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require --prefer-dist marciocamello/yii2-mcms-cart "*"
or add, (*4)
"marciocamello/yii2-mcms-cart": "*"
to the require section of your composer.json
file., (*5)
use mcms\cart\Cart; $cart = new Cart(); $data = array( 'id' => 'sku_123ABC', 'qty' => 1, 'price' => 39.95, 'name' => 'T-Shirt', 'options' => array('Size' => 'L', 'Color' => 'Red') ); $cart->insert($data);
use mcms\cart\Cart; $cart = new Cart(); $data = array( array( 'id' => 'sku_123ABC', 'qty' => 1, 'price' => 39.95, 'name' => 'T-Shirt', 'options' => array('Size' => 'L', 'Color' => 'Red') ), array( 'id' => 'sku_567ZYX', 'qty' => 1, 'price' => 9.95, 'name' => 'Coffee Mug' ), array( 'id' => 'sku_965QRS', 'qty' => 1, 'price' => 29.95, 'name' => 'Shot Glass' ) ); $cart->insert($data);
use yii\helpers\Html; use yii\widgets\ActiveForm; use mcms\cart\Cart; $cart = new Cart(); if($_POST) { $cart->update($_POST); Yii::$app->controller->refresh(); }
'cart-form', 'options' => ['class' => 'form-horizontal'], ]) ?>
QTY | Item Description | Item Price | Sub-Total |
---|---|---|---|
'3', 'size' => '5']); ?> |
has_options($items['rowid']) == TRUE): ?>
product_options($items['rowid']) as $option_name => $option_value): ?>
: |
format_number($items['price']); ?> | $format_number($items['subtotal']); ?> |
Total | $format_number($cart->total()); ?> |
Yii2 Cart extension
BSD-3-Clause
extension yii2 cart mcms moltin