Exemple #1
0
<?php

/* @var $this yii\web\View */
/* @var $cart app\models\Cart */
use app\models\CartItems;
use app\models\Session;
use yii\helpers\Url;
use yii\helpers\Html;
$this->title = Yii::t('app', 'Your cart');
$cartItems = CartItems::find()->where(['cart_id' => $cart->id]);
$cart->processCart();
$dataProvider = new yii\data\ActiveDataProvider(['query' => $cartItems]);
$formatter = \Yii::$app->formatter;
?>
<h1><?php 
echo Html::encode($this->title);
?>
</h1>
<?php 
$session = new Session();
$errors = $session->getErrors();
$session->clearErrors();
foreach ($errors as $e) {
    ?>
<div class="alert alert-danger"><h2><?php 
    echo $e;
    ?>
</h2></div><?php 
}
$successes = $session->getSuccesses();
$session->clearSuccesses();
Exemple #2
0
 public function getItems($entity)
 {
     return CartItems::find('all', array('conditions' => array('carts' => $entity->_id)));
 }