/** * @inheritdoc */ public function init() { if (!isset($this->successCreate)) { $this->successCreate = Module::t('category', 'Category has been successfully created.'); } if (!isset($this->errorCreate)) { $this->errorCreate = Module::t('category', 'Category has not been created. Please try again!'); } if (!isset($this->successUpdate)) { $this->successUpdate = Module::t('category', 'Category has been successfully saved.'); } if (!isset($this->successBatchUpdate)) { $this->successBatchUpdate = Module::t('category', '{count} categories have been successfully saved.'); } if (!isset($this->errorUpdate)) { $this->errorUpdate = Module::t('category', 'Category has not been saved. Please try again!'); } if (!isset($this->successDelete)) { $this->successDelete = Module::t('category', 'Category has been successfully deleted.'); } if (!isset($this->successBatchDelete)) { $this->successBatchDelete = Module::t('category', 'Categories have been successfully deleted.'); } parent::init(); }
/** * Registers entity types. * * @param Application $app */ public function registerEntityTypes($app) { /** @var \im\base\types\EntityTypesRegister $typesRegister */ $typesRegister = $app->get('typesRegister'); $typesRegister->registerEntityType(new EntityType('product', 'im\\catalog\\models\\Product')); $typesRegister->registerEntityType(new EntityType('product_meta', 'im\\catalog\\models\\ProductMeta')); $typesRegister->registerEntityType(new EntityType('category_meta', 'im\\catalog\\models\\CategoryMeta')); $typesRegister->registerEntityType(new EntityType('product_category_meta', 'im\\catalog\\models\\ProductCategoryMeta')); $typesRegister->registerEntityType(new EntityType('categories_facet', 'im\\catalog\\models\\CategoriesFacet', 'facets', Module::t('facet', 'Categories facet'))); $typesRegister->registerEntityType(new EntityType('product_categories_facet', 'im\\catalog\\models\\ProductCategoriesFacet', 'facets', Module::t('facet', 'Product categories facet'))); }
<?php // echo $this->render('_search', ['model' => $searchModel]); ?> <div class="box"> <div class="box-header with-border"> <h3 class="box-title"><?php echo $this->params['subtitle']; ?> </h3> <div class="box-tools pull-right"> <?php echo Html::a('<i class="fa fa-plus"></i>', ['create'], ['class' => 'btn btn-sm btn-default']); ?> </div> </div> <div class="box-body"> <?php Pjax::begin(); ?> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['name', ['attribute' => 'parentName', 'value' => 'relatedParent.name', 'label' => Module::t('product/productType', 'Parent Type')], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{update} {delete}']]]); ?> <?php Pjax::end(); ?> </div> </div>
/* @var $this yii\web\View */ /* @var $model im\catalog\models\Product */ $this->title = Module::t('product', 'Products'); $this->params['subtitle'] = Module::t('product', 'Product updating'); $this->params['breadcrumbs'] = [['label' => $this->title, 'url' => ['index']], $this->params['subtitle']]; ?> <div class="box box-success"> <div class="box-header with-border"> <h3 class="box-title"><?php echo $this->params['subtitle']; ?> </h3> <div class="box-tools pull-right"> <?php echo Html::a('<i class="fa fa-reply"></i>', ['index'], ['class' => 'btn btn-sm btn-default', 'title' => Module::t('module', 'Cancel')]); ?> <?php echo Html::a('<i class="fa fa-plus"></i>', ['create'], ['class' => 'btn btn-sm btn-default', 'title' => Module::t('module', 'Create')]); ?> <?php echo Html::a('<i class="fa fa-trash-o"></i>', ['delete', 'id' => $model->id], ['class' => 'btn btn-sm btn-default', 'title' => Module::t('module', 'Delete'), 'data-confirm' => Module::t('module', 'Are you sure you want to delete this item?'), 'data-method' => 'delete']); ?> </div> </div> <div class="box-body"> <?php echo $this->render('_form', ['model' => $model]); ?> </div> </div>
/** * Deletes an existing ProductType model. * If deletion is successful, the browser will be redirected to the 'index' page. * @param integer $id * @return mixed */ public function actionDelete($id) { $this->findModel($id)->delete(); Yii::$app->session->setFlash('success', Module::t('product/productType', 'Product type has been successfully deleted.')); return $this->redirect(['index']); }
<?php use im\catalog\Module; use yii\helpers\Html; use yii\grid\GridView; use yii\widgets\Pjax; /* @var $this yii\web\View */ /* @var $searchModel im\catalog\models\ProductOptionSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = Module::t('option', 'Product options'); $this->params['subtitle'] = Module::t('option', 'Product options list'); $this->params['breadcrumbs'][] = $this->title; ?> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <div class="box"> <div class="box-header with-border"> <h3 class="box-title"><?php echo $this->params['subtitle']; ?> </h3> <div class="box-tools pull-right"> <?php echo Html::a('<i class="fa fa-plus"></i>', ['create'], ['class' => 'btn btn-sm btn-default']); ?> </div> </div>
/** * @return array Statuses list */ public static function getStatusesList() { return [self::STATUS_ACTIVE => Module::t('product', 'Active'), self::STATUS_INACTIVE => Module::t('product', 'Inactive')]; }
/** * Deletes an existing ProductOption model. * If deletion is successful, the browser will be redirected to the 'index' page. * @param integer $id * @return mixed */ public function actionDelete($id) { $this->findModel($id)->delete(); Yii::$app->session->setFlash('success', Module::t('attribute', 'Option has been successfully deleted.')); return $this->redirect(['index']); }
<?php use im\catalog\Module; use yii\helpers\Html; /* @var $this yii\web\View */ /* @var $model im\eav\models\Attribute */ $this->title = Module::t('attribute', 'Attributes'); $this->params['subtitle'] = Module::t('attribute', 'Attribute creation'); $this->params['breadcrumbs'] = [['label' => $this->title, 'url' => ['index']], $this->params['subtitle']]; ?> <div class="box box-primary"> <div class="box-header with-border"> <h3 class="box-title"><?php echo $this->params['subtitle']; ?> </h3> <div class="box-tools pull-right"> <?php echo Html::a('<i class="fa fa-reply"></i>', ['index'], ['class' => 'btn btn-sm btn-default', 'title' => Module::t('module', 'Cancel')]); ?> </div> </div> <div class="box-body"> <?php echo $this->render('_form', ['model' => $model]); ?> </div> </div>
<?php use im\catalog\Module; use yii\helpers\Html; use yii\grid\GridView; use yii\widgets\Pjax; /* @var $this yii\web\View */ /* @var $searchModel im\catalog\models\BrandSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = Module::t('brand', 'Brands'); $this->params['subtitle'] = Module::t('brand', 'Brands list'); $this->params['breadcrumbs'][] = $this->title; ?> <div class="box"> <div class="box-header with-border"> <h3 class="box-title"><?php echo $this->params['subtitle']; ?> </h3> <div class="box-tools pull-right"> <?php echo Html::a('<i class="fa fa-plus"></i>', ['create'], ['class' => 'btn btn-sm btn-default']); ?> </div> </div> <div class="box-body"> <?php Pjax::begin(); ?> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['name', ['class' => 'yii\\grid\\ActionColumn', 'template' => '{update} {delete}']]]);
/** * @inheritdoc */ public function getCMSDescription() { return Module::t('module', 'Widget for displaying product categories list'); }
/** * @inheritdoc */ public function attributeLabels() { return ['id' => Module::t('product/productType', 'ID'), 'name' => Module::t('product/productType', 'Name'), 'parent_id' => Module::t('product/productType', 'Parent'), 'eAttributes' => Module::t('product/productType', 'Attributes'), 'options' => Module::t('product/productType', 'Options')]; }
<?php use im\catalog\Module; use yii\helpers\Html; use yii\grid\GridView; use yii\widgets\Pjax; /* @var $this yii\web\View */ /* @var $searchModel im\catalog\models\ProductAttributeSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = Module::t('attribute', 'Product attributes'); $this->params['subtitle'] = Module::t('attribute', 'Product attributes list'); $this->params['breadcrumbs'][] = $this->title; ?> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <div class="box"> <div class="box-header with-border"> <h3 class="box-title"><?php echo $this->params['subtitle']; ?> </h3> <div class="box-tools pull-right"> <?php echo Html::a('<i class="fa fa-plus"></i>', ['create'], ['class' => 'btn btn-sm btn-default']); ?> </div> </div>
/** * @inheritdoc */ public function attributeLabels() { return ['id' => Module::t('menu', 'ID'), 'name' => Module::t('menu', 'Name'), 'created_at' => Module::t('brand', 'Created At'), 'updated_at' => Module::t('brand', 'Updated At')]; }
/* @var $form yii\widgets\ActiveForm */ ?> <div class="value-form"> <?php $form = ActiveForm::begin(); ?> <?php echo $form->field($model, 'attribute_id')->widget(Select2::classname(), ['data' => ArrayHelper::map(Attribute::find()->asArray()->orderBy('name')->all(), 'id', 'presentation'), 'options' => ['prompt' => '']]); ?> <?php echo $form->field($model, 'value')->textInput(['maxlength' => true]); ?> <?php echo $form->field($model, 'presentation')->textInput(['maxlength' => true]); ?> <?php echo Html::submitButton($model->isNewRecord ? Module::t('module', 'Create') : Module::t('module', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-primary' : 'btn btn-success']); ?> <?php ActiveForm::end(); ?> </div>
<button class="btn btn-sm btn-default" title="<?php echo Module::t('category', 'Create'); ?> " data-toolbar-action="create"><span class="fa fa-plus" aria-hidden="true"></span></button> <button class="btn btn-sm btn-default" title="<?php echo Module::t('category', 'Edit'); ?> " data-toolbar-action="edit" data-not-selected-message="<?php echo Module::t('category', 'Please, select category to edit'); ?> "><span class="fa fa-pencil" aria-hidden="true"></span></button> <button class="btn btn-sm btn-default" title="<?php echo Module::t('category', 'Delete'); ?> " data-toolbar-action="delete" data-not-selected-message="<?php echo Module::t('category', 'Please, select categories to delete'); ?> "><span class="fa fa-trash-o" aria-hidden="true"></span></button> <?php JsTreeToolbar::end(); ?> </div> <div class="clearfix"></div> </div> </div> </div> <div class="col-xs-8"> <?php TreeDetails::begin(['id' => $treeDetailsId]); ?> <?php
<?php use im\catalog\Module; use yii\helpers\Html; use yii\grid\GridView; use yii\widgets\Pjax; /* @var $this yii\web\View */ /* @var $searchModel im\catalog\models\ProductSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = Module::t('product', 'Products'); $this->params['subtitle'] = Module::t('product', 'Products list'); $this->params['breadcrumbs'][] = $this->title; ?> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <div class="box"> <div class="box-header with-border"> <h3 class="box-title"><?php echo $this->params['subtitle']; ?> </h3> <div class="box-tools pull-right"> <?php echo Html::a('<i class="fa fa-plus"></i>', ['create'], ['class' => 'btn btn-sm btn-default']); ?> </div> </div>
<?php use im\catalog\Module; /* @var $this yii\web\View */ /* @var $model im\catalog\models\Category */ $this->title = Module::t('category', 'Categories'); $this->params['subtitle'] = Module::t('category', 'Category creation'); $this->params['breadcrumbs'] = [['label' => $this->title, 'url' => ['index']], $this->params['subtitle']]; ?> <div class="box box-primary"> <div class="box-header with-border"> <h3 class="box-title"><?php echo $this->params['subtitle']; ?> </h3> </div> <div class="box-body"> <?php echo $this->render('_form', ['model' => $model]); ?> </div> </div>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?> <div class="box"> <div class="box-header with-border"> <h3 class="box-title"><?php echo $this->params['subtitle']; ?> </h3> <div class="box-tools pull-right"> <?php echo Html::a('<i class="fa fa-plus"></i>', ['create'], ['class' => 'btn btn-sm btn-default']); ?> </div> </div> <div class="box-body"> <?php Pjax::begin(); ?> <?php echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => ['value', ['attribute' => 'attribute', 'value' => 'eAttribute.presentation', 'label' => Module::t('value', 'Attribute')], ['class' => 'yii\\grid\\ActionColumn', 'template' => '{update} {delete}']]]); ?> <?php Pjax::end(); ?> </div> </div>