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; } \pistol88\cart\assets\WidgetAsset::register($this->getView()); return parent::init(); }
public function init() { if ($this->type == NULL) { $this->type = self::TYPE_SELECT; } parent::init(); \pistol88\cart\assets\WidgetAsset::register($this->getView()); return true; }
public function init() { parent::init(); \pistol88\cart\assets\WidgetAsset::register($this->getView()); if ($this->text == NULL) { $this->text = yii::t('cart', 'Truncate'); } return true; }
public function init() { parent::init(); \pistol88\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; }
public function init() { parent::init(); \pistol88\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; }
public function init() { parent::init(); \pistol88\cart\assets\WidgetAsset::register($this->getView()); return true; }