/** * Подготовка данных для шаблона * @return $this */ public function run() { if (static::$isRegisteredAssets === false) { ShopAsset::register($this->getView()); $options = $this->clientOptions; $options = Json::encode($options); $this->getView()->registerJs(<<<JS (function(sx, \$, _) { sx.Shop = new sx.classes.shop.App({$options}); })(sx, sx.\$, sx._); JS ); static::$isRegisteredAssets = true; } return parent::run(); }
/** * Подготовка данных для шаблона * @return $this */ public function run() { if (static::$isRegisteredAssets === false) { ShopAsset::register($this->getView()); $options = (array) $this->clientOptions; $options['cartData'] = \Yii::$app->shop->shopFuser->jsonSerialize(); $options = Json::encode($options); $this->getView()->registerJs(<<<JS (function(sx, \$, _) { sx.Shop = new sx.classes.shop.App({$options}); })(sx, sx.\$, sx._); JS ); static::$isRegisteredAssets = true; } return parent::run(); }
echo \yii\widgets\DetailView::widget(['model' => $model, "template" => "<tr><th>{label}</th><td style='text-align: right;'>{value}</td></tr>", "options" => ['class' => 'sx-result-table table detail-view'], 'attributes' => [['label' => \skeeks\cms\shop\Module::t('app', 'The total value of the goods'), 'value' => \Yii::$app->money->intlFormatter()->format($model->money)], ['label' => \skeeks\cms\shop\Module::t('app', 'Discount, margin'), 'value' => \Yii::$app->money->intlFormatter()->format($model->moneyDiscount)], ['label' => \skeeks\cms\shop\Module::t('app', 'Delivery service'), 'value' => \Yii::$app->money->intlFormatter()->format($model->moneyDelivery)], ['label' => \skeeks\cms\shop\Module::t('app', 'Taxe'), 'value' => \Yii::$app->money->intlFormatter()->format($model->moneyVat)], ['label' => \skeeks\cms\shop\Module::t('app', 'Weight (gramm)'), 'value' => $model->weight . " " . \skeeks\cms\shop\Module::t('app', 'g.')], ['label' => \skeeks\cms\shop\Module::t('app', 'In total'), 'format' => 'raw', 'value' => Html::tag('b', \Yii::$app->money->intlFormatter()->format($model->money))]]]); ?> </div> </div> </div> <?php echo $form->buttonsCreateOrUpdate($shopFuser); ?> <? \skeeks\cms\shop\assets\ShopAsset::register($this); $clientData = \yii\helpers\Json::encode([ 'backendFuserSave' => \skeeks\cms\helpers\UrlHelper::construct([ '/shop/admin-order/create-order-fuser-save', 'shopFuserId' => $shopFuser->id ])->enableAdmin()->toString(), ]); $shopJson = \yii\helpers\Json::encode([ 'backend-add-product' => \skeeks\cms\helpers\UrlHelper::construct([ '/shop/admin-order/create-order-add-product', 'shopFuserId' => $shopFuser->id ])->enableAdmin()->toString(),