Пример #1
0
 public function init()
 {
     $paramsArr = ['offerUrl' => $this->offerUrl, 'textButton' => $this->textButton, 'type' => $this->type, 'columns' => $this->columns, 'model' => $this->model, 'showTotal' => $this->showTotal, 'showOptions' => $this->showOptions, 'showOffer' => $this->showOffer, 'showTruncate' => $this->showTruncate, 'currency' => $this->currency, 'otherFields' => $this->otherFields, 'currencyPosition' => $this->currencyPosition, 'showCountArrows' => $this->showCountArrows];
     foreach ($paramsArr as $key => $value) {
         if ($value === 'false') {
             $this->{$key} = false;
         }
     }
     $this->getView()->registerJs("pistol88.cart.elementsListWidgetParams = " . json_encode($paramsArr));
     if ($this->type == NULL) {
         $this->type = self::TYPE_FULL;
     }
     if ($this->offerUrl == NULL) {
         $this->offerUrl = Url::toRoute(['/cart/default/index']);
     }
     if ($this->cart == NULL) {
         $this->cart = yii::$app->cart;
     }
     if ($this->textButton == NULL) {
         $this->textButton = yii::t('cart', 'Cart (<span class="pistol88-cart-price">{p}</span>)', ['c' => $this->cart->getCount(), 'p' => $this->cart->getCostFormatted()]);
     }
     if ($this->currency == NULL) {
         $this->currency = yii::$app->cart->currency;
     }
     if ($this->currencyPosition == NULL) {
         $this->currencyPosition = yii::$app->cart->currencyPosition;
     }
     \app\modules\cart\assets\WidgetAsset::register($this->getView());
     return parent::init();
 }
Пример #2
0
 public function init()
 {
     parent::init();
     \app\modules\cart\assets\WidgetAsset::register($this->getView());
     if ($this->text == NULL) {
         $this->text = yii::t('cart', 'Truncate');
     }
     return true;
 }
Пример #3
0
 public function init()
 {
     if ($this->type == NULL) {
         $this->type = self::TYPE_SELECT;
     }
     parent::init();
     \app\modules\cart\assets\WidgetAsset::register($this->getView());
     return true;
 }
Пример #4
0
 public function init()
 {
     parent::init();
     \app\modules\cart\assets\WidgetAsset::register($this->getView());
     if ($this->offerUrl == NULL) {
         $this->offerUrl = Url::toRoute(["/cart/default/index"]);
     }
     if ($this->text === NULL) {
         $this->text = '{c} ' . Yii::t('cart', 'on') . ' {p}';
     }
     return true;
 }
Пример #5
0
 public function init()
 {
     parent::init();
     \app\modules\cart\assets\WidgetAsset::register($this->getView());
     if ($this->options === NULL) {
         $this->options = (object) [];
     }
     if ($this->text === NULL) {
         $this->text = Yii::t('cart', 'Buy');
     }
     if ($this->cssClass === NULL) {
         $this->cssClass = 'btn btn-success';
     }
     return true;
 }
Пример #6
0
 public function init()
 {
     parent::init();
     \app\modules\cart\assets\WidgetAsset::register($this->getView());
     return true;
 }