private function _cartJson($json) { if ($cartModel = yii::$app->cart) { $json['elementsHTML'] = \pistol88\cart\widgets\ElementsList::widget(); $json['count'] = $cartModel->getCount(); $json['price'] = $cartModel->getCostFormatted(); } else { $json['count'] = 0; $json['price'] = 0; } return Json::encode($json); }
private function _cartJson($json) { if ($cartModel = yii::$app->cart) { if (!($elementsListWidgetParams = yii::$app->request->post('elementsListWidgetParams'))) { $elementsListWidgetParams = []; } $json['elementsHTML'] = \pistol88\cart\widgets\ElementsList::widget($elementsListWidgetParams); $json['count'] = $cartModel->getCount(); $json['clear_price'] = $cartModel->getCount(false); $json['price'] = $cartModel->getCostFormatted(); } else { $json['count'] = 0; $json['price'] = 0; $json['clear_price'] = 0; } return Json::encode($json); }
<div class="col-lg-3 col-md-4 col-sm-12"> <div class="arm-right-column"> <div class="service-order"> <div class="row"> <div class="col-md-6"> <h3>Чек <span class="pistol88-cart-count"><?php echo yii::$app->cart->count; ?> </span></h3> </div> <div class="col-md-6 custom-service"> </div> </div> <?php echo ElementsList::widget(['columns' => '3', 'showCountArrows' => false, 'type' => ElementsList::TYPE_FULL]); ?> <div class="row"> <div class="col-md-7"> <div class="total"> <?php echo CartInformer::widget(['htmlTag' => 'span', 'text' => '{c} на {p}']); ?> </div> </div> <div class="col-md-5"> <?php if (yii::$app->has('promocode')) { ?> <div class="promocode">
<div class="row"> <div class="col-lg-9"> <h3>Состав</h3> </div> <div class="col-lg-3"> <a href="#productsModal" data-toggle="modal" data-target="#productsModal" class="choice-product btn "><?php echo yii::t('order', 'Choose'); ?> ... <span class="glyphicon glyphicon-plus add-option"></span></a> </div> </div> </div> <div class="panel-body"> <div class="cart"> <?php echo ElementsList::widget(['type' => ElementsList::TYPE_FULL, 'showOffer' => false, 'otherFields' => yii::$app->getModule('order')->cartCustomFields]); ?> </div> <?php echo BuyByCode::widget(); ?> </div> </div> <?php if (yii::$app->has('promocode')) { ?> <div class=" panel panel-default"> <div class="panel-heading"> <div class="row"> <div class="col-lg-9">
public function actionCartInfo() { die(json_encode(['cart' => ElementsList::widget(['columns' => '3', 'showCountArrows' => false, 'type' => ElementsList::TYPE_FULL]), 'total' => CartInformer::widget(['htmlTag' => 'div', 'text' => '{c} на {p}']), 'count' => yii::$app->cart->count])); }
public function actionCartInfo() { die(json_encode(['cart' => ElementsList::widget(['type' => ElementsList::TYPE_FULL, 'showOffer' => false, 'otherFields' => $this->module->cartCustomFields]), 'total' => CartInformer::widget(['htmlTag' => 'div', 'text' => '{c} на {p}']), 'count' => yii::$app->cart->count])); }