Commit 2e22f66f88cd54ea23e067c7241baf31b9c6baeb
1 parent
852cc8d1
Links fixed
Showing
40 changed files
with
134 additions
and
99 deletions
Show diff stats
controllers/TaxGroupController.php
models/LabelSearch.php
... | ... | @@ -6,7 +6,7 @@ |
6 | 6 | use yii\data\ActiveDataProvider; |
7 | 7 | |
8 | 8 | /** |
9 | - * LabelSearch represents the model behind the search form about `backend\models\Label`. | |
9 | + * LabelSearch represents the model behind the search form about `artweb\artbox\ecommerce\models\Label`. | |
10 | 10 | */ |
11 | 11 | class LabelSearch extends Label |
12 | 12 | { | ... | ... |
models/ProductFrontendSearch.php
views/brand/_form.php
1 | 1 | <?php |
2 | 2 | |
3 | - use common\modules\language\widgets\LanguageForm; | |
4 | - use common\modules\product\models\Brand; | |
5 | - use common\modules\product\models\BrandLang; | |
3 | + use artweb\artbox\components\artboximage\ArtboxImageHelper; | |
4 | + use artweb\artbox\language\widgets\LanguageForm; | |
5 | + use artweb\artbox\ecommerce\models\Brand; | |
6 | + use artweb\artbox\ecommerce\models\BrandLang; | |
6 | 7 | use yii\helpers\Html; |
7 | 8 | use yii\web\View; |
8 | 9 | use yii\widgets\ActiveForm; |
... | ... | @@ -35,7 +36,7 @@ |
35 | 36 | 'gif', |
36 | 37 | 'png', |
37 | 38 | ], |
38 | - 'initialPreview' => !empty( $model->imageUrl ) ? \common\components\artboximage\ArtboxImageHelper::getImage($model->imageUrl, 'list') : '', | |
39 | + 'initialPreview' => !empty( $model->imageUrl ) ? ArtboxImageHelper::getImage($model->imageUrl, 'list') : '', | |
39 | 40 | 'overwriteInitial' => true, |
40 | 41 | 'showRemove' => false, |
41 | 42 | 'showUpload' => false, |
... | ... | @@ -47,7 +48,7 @@ |
47 | 48 | |
48 | 49 | <?= LanguageForm::widget([ |
49 | 50 | 'modelLangs' => $modelLangs, |
50 | - 'formView' => '@backend/views/brand/_form_language', | |
51 | + 'formView' => '@artweb/artbox/ecommerce/views/brand/_form_language', | |
51 | 52 | 'form' => $form, |
52 | 53 | ]) ?> |
53 | 54 | ... | ... |
views/brand/_form_language.php
views/brand/create.php
views/brand/index.php
1 | 1 | <?php |
2 | 2 | |
3 | - use common\modules\product\models\Brand; | |
4 | - use common\modules\product\models\BrandSearch; | |
3 | + use artweb\artbox\ecommerce\models\Brand; | |
4 | + use artweb\artbox\ecommerce\models\BrandSearch; | |
5 | 5 | use yii\data\ActiveDataProvider; |
6 | 6 | use yii\helpers\Html; |
7 | 7 | use yii\grid\GridView; | ... | ... |
views/brand/update.php
views/brand/view.php
views/category/_form.php
1 | 1 | <?php |
2 | 2 | |
3 | - use common\modules\language\widgets\LanguageForm; | |
4 | - use common\modules\product\models\Category; | |
5 | - use common\modules\product\models\CategoryLang; | |
3 | + use artweb\artbox\components\artboximage\ArtboxImageHelper; | |
4 | + use artweb\artbox\language\widgets\LanguageForm; | |
5 | + use artweb\artbox\ecommerce\models\Category; | |
6 | + use artweb\artbox\ecommerce\models\CategoryLang; | |
6 | 7 | use yii\helpers\Html; |
7 | 8 | use yii\web\View; |
8 | 9 | use yii\widgets\ActiveForm; |
... | ... | @@ -53,7 +54,7 @@ |
53 | 54 | 'gif', |
54 | 55 | 'png', |
55 | 56 | ], |
56 | - 'initialPreview' => !empty( $model->imageUrl ) ? \common\components\artboximage\ArtboxImageHelper::getImage( | |
57 | + 'initialPreview' => !empty( $model->imageUrl ) ? ArtboxImageHelper::getImage( | |
57 | 58 | $model->imageUrl, |
58 | 59 | 'list' |
59 | 60 | ) : '', |
... | ... | @@ -71,7 +72,7 @@ |
71 | 72 | <?= LanguageForm::widget( |
72 | 73 | [ |
73 | 74 | 'modelLangs' => $modelLangs, |
74 | - 'formView' => '@backend/views/category/_form_language', | |
75 | + 'formView' => '@artweb/artbox/ecommerce/views/category/_form_language', | |
75 | 76 | 'form' => $form, |
76 | 77 | ] |
77 | 78 | ) ?> | ... | ... |
views/category/_form_language.php
views/category/create.php
views/category/index.php
1 | 1 | <?php |
2 | 2 | |
3 | - use common\modules\product\models\Category; | |
3 | + use artweb\artbox\ecommerce\models\Category; | |
4 | 4 | use yii\helpers\Html; |
5 | 5 | use kartik\grid\GridView; |
6 | 6 | |
7 | 7 | /** |
8 | 8 | * @var $this yii\web\View |
9 | - * @var $searchModel common\modules\product\models\CategorySearch | |
9 | + * @var $searchModel artweb\artbox\ecommerce\models\CategorySearch | |
10 | 10 | * @var $dataProvider yii\data\ActiveDataProvider |
11 | 11 | */ |
12 | 12 | $this->title = Yii::t('product', 'Categories'); | ... | ... |
views/category/update.php
views/category/view.php
views/delivery/_form.php
1 | 1 | <?php |
2 | 2 | |
3 | - use common\models\OrderDeliveryLang; | |
3 | + use artweb\artbox\ecommerce\models\OrderDeliveryLang; | |
4 | 4 | use yii\helpers\Html; |
5 | 5 | use yii\widgets\ActiveForm; |
6 | - use common\modules\language\widgets\LanguageForm; | |
6 | + use artweb\artbox\language\widgets\LanguageForm; | |
7 | 7 | |
8 | 8 | /** |
9 | 9 | * @var yii\web\View $this |
10 | - * @var common\models\Delivery $model | |
10 | + * @var artweb\artbox\ecommerce\models\Delivery $model | |
11 | 11 | * @var yii\widgets\ActiveForm $form |
12 | 12 | * @var OrderDeliveryLang[] $modelLangs |
13 | 13 | */ |
... | ... | @@ -30,7 +30,7 @@ |
30 | 30 | |
31 | 31 | <?= LanguageForm::widget([ |
32 | 32 | 'modelLangs' => $modelLangs, |
33 | - 'formView' => '@backend/views/delivery/_form_language', | |
33 | + 'formView' => '@artweb/artbox/ecommerce/views/delivery/_form_language', | |
34 | 34 | 'form' => $form, |
35 | 35 | ]) ?> |
36 | 36 | ... | ... |
views/delivery/_form_language.php
views/delivery/create.php
views/delivery/index.php
views/delivery/update.php
views/delivery/view.php
views/label/_form.php
1 | 1 | <?php |
2 | 2 | |
3 | - use backend\models\Label; | |
4 | - use backend\models\OrderLabelLang; | |
5 | - use common\modules\language\widgets\LanguageForm; | |
3 | + use artweb\artbox\ecommerce\models\Label; | |
4 | + use artweb\artbox\ecommerce\models\OrderLabelLang; | |
5 | + use artweb\artbox\language\widgets\LanguageForm; | |
6 | 6 | use yii\helpers\Html; |
7 | 7 | use yii\web\View; |
8 | 8 | use yii\widgets\ActiveForm; |
... | ... | @@ -23,7 +23,7 @@ |
23 | 23 | |
24 | 24 | <?= LanguageForm::widget([ |
25 | 25 | 'modelLangs' => $modelLangs, |
26 | - 'formView' => '@backend/views/label/_form_language', | |
26 | + 'formView' => '@artweb/artbox/ecommerce/views/label/_form_language', | |
27 | 27 | 'form' => $form, |
28 | 28 | ]) ?> |
29 | 29 | ... | ... |
views/label/_form_language.php
views/label/create.php
views/label/index.php
views/label/update.php
views/label/view.php
views/manage/index.php
views/manage/view.php
... | ... | @@ -36,7 +36,7 @@ |
36 | 36 | $variants_string .= Html::a( |
37 | 37 | $variant->lang->title, |
38 | 38 | [ |
39 | - '/product/variant/view', | |
39 | + 'variant/view', | |
40 | 40 | 'id' => $variant->id, |
41 | 41 | ] |
42 | 42 | ) . '<br>'; |
... | ... | @@ -72,7 +72,7 @@ |
72 | 72 | <?= Html::a( |
73 | 73 | Yii::t('product', 'Variants'), |
74 | 74 | [ |
75 | - '/product/variant/index', | |
75 | + 'variant/index', | |
76 | 76 | 'product_id' => $model->id, |
77 | 77 | ], |
78 | 78 | [ 'class' => 'btn btn-info' ] | ... | ... |
views/tax-group/_form.php
... | ... | @@ -7,7 +7,7 @@ |
7 | 7 | use yii\web\View; |
8 | 8 | use yii\widgets\ActiveForm; |
9 | 9 | use artweb\artbox\ecommerce\helpers\ProductHelper; |
10 | - use artweb\artbox\ecommerce\components\artboxtree\ArtboxTreeHelper; | |
10 | + use artweb\artbox\components\artboxtree\ArtboxTreeHelper; | |
11 | 11 | |
12 | 12 | /** |
13 | 13 | * @var View $this | ... | ... |
views/tax-group/create.php
... | ... | @@ -9,11 +9,15 @@ |
9 | 9 | * @var View $this |
10 | 10 | * @var TaxGroup $model |
11 | 11 | * @var TaxGroupLang[] $modelLangs |
12 | + * @var int $level | |
12 | 13 | */ |
13 | 14 | $this->title = Yii::t('rubrication', 'Create Tax Group'); |
14 | 15 | $this->params[ 'breadcrumbs' ][] = [ |
15 | 16 | 'label' => Yii::t('rubrication', 'Tax Groups'), |
16 | - 'url' => [ 'index' ], | |
17 | + 'url' => [ | |
18 | + 'index', | |
19 | + 'level' => $level, | |
20 | + ], | |
17 | 21 | ]; |
18 | 22 | $this->params[ 'breadcrumbs' ][] = $this->title; |
19 | 23 | ?> |
... | ... | @@ -21,9 +25,12 @@ |
21 | 25 | |
22 | 26 | <h1><?= Html::encode($this->title) ?></h1> |
23 | 27 | |
24 | - <?= $this->render('_form', [ | |
25 | - 'model' => $model, | |
26 | - 'modelLangs' => $modelLangs, | |
27 | - ]) ?> | |
28 | + <?= $this->render( | |
29 | + '_form', | |
30 | + [ | |
31 | + 'model' => $model, | |
32 | + 'modelLangs' => $modelLangs, | |
33 | + ] | |
34 | + ) ?> | |
28 | 35 | |
29 | 36 | </div> | ... | ... |
views/tax-group/index.php
... | ... | @@ -27,7 +27,7 @@ |
27 | 27 | Yii::t('rubrication', 'Create Group'), |
28 | 28 | Url::to( |
29 | 29 | [ |
30 | - '/rubrication/tax-group/create', | |
30 | + 'tax-group/create', | |
31 | 31 | 'level' => $level, |
32 | 32 | ] |
33 | 33 | ), |
... | ... | @@ -38,18 +38,18 @@ |
38 | 38 | <?= GridView::widget( |
39 | 39 | [ |
40 | 40 | 'dataProvider' => $dataProvider, |
41 | - 'filterModel' => $searchModel, | |
41 | + 'filterModel' => $searchModel, | |
42 | 42 | 'columns' => [ |
43 | 43 | [ 'class' => 'yii\grid\SerialColumn' ], |
44 | 44 | 'id', |
45 | 45 | [ |
46 | 46 | 'attribute' => 'is_filter', |
47 | - 'format' => 'boolean', | |
48 | - 'filter' => \Yii::$app->formatter->booleanFormat, | |
47 | + 'format' => 'boolean', | |
48 | + 'filter' => \Yii::$app->formatter->booleanFormat, | |
49 | 49 | ], |
50 | 50 | [ |
51 | 51 | 'attribute' => 'groupName', |
52 | - 'value' => 'lang.title', | |
52 | + 'value' => 'lang.title', | |
53 | 53 | ], |
54 | 54 | [ |
55 | 55 | 'label' => \Yii::t('rubrication', 'Options count'), |
... | ... | @@ -85,12 +85,17 @@ |
85 | 85 | ], |
86 | 86 | 'urlCreator' => function ($action, $model, $key, $index) use ($level) { |
87 | 87 | if ($action === 'options') { |
88 | - $url = '/admin/rubrication/tax-option?group=' . $model->id; | |
88 | + $url = Url::to( | |
89 | + [ | |
90 | + 'tax-option/index', | |
91 | + 'group' => $model->id, | |
92 | + ] | |
93 | + ); | |
89 | 94 | return $url; |
90 | 95 | } elseif ($action === 'update') { |
91 | 96 | $url = Url::to( |
92 | 97 | [ |
93 | - '/rubrication/tax-group/update', | |
98 | + 'tax-group/update', | |
94 | 99 | 'level' => $level, |
95 | 100 | 'id' => $model->id, |
96 | 101 | ] |
... | ... | @@ -99,7 +104,7 @@ |
99 | 104 | } elseif ($action === 'delete') { |
100 | 105 | $url = Url::to( |
101 | 106 | [ |
102 | - '/rubrication/tax-group/delete', | |
107 | + 'tax-group/delete', | |
103 | 108 | 'level' => $level, |
104 | 109 | 'id' => $model->id, |
105 | 110 | ] | ... | ... |
views/tax-option/_form.php
1 | 1 | <?php |
2 | 2 | |
3 | + use artweb\artbox\components\artboximage\ArtboxImageHelper; | |
3 | 4 | use artweb\artbox\language\widgets\LanguageForm; |
4 | 5 | use artweb\artbox\ecommerce\models\TaxGroup; |
5 | 6 | use artweb\artbox\ecommerce\models\TaxOptionLang; |
... | ... | @@ -54,7 +55,7 @@ |
54 | 55 | 'gif', |
55 | 56 | 'png', |
56 | 57 | ], |
57 | - 'initialPreview' => !empty( $model->imageUrl ) ? \artweb\artbox\ecommerce\components\artboximage\ArtboxImageHelper::getImage( | |
58 | + 'initialPreview' => !empty( $model->imageUrl ) ? ArtboxImageHelper::getImage( | |
58 | 59 | $model->imageUrl, |
59 | 60 | 'list' |
60 | 61 | ) : '', | ... | ... |
views/variant/create.php
... | ... | @@ -19,12 +19,12 @@ |
19 | 19 | $this->title = Yii::t('product', 'Create Variant'); |
20 | 20 | $this->params[ 'breadcrumbs' ][] = [ |
21 | 21 | 'label' => Yii::t('product', 'Products'), |
22 | - 'url' => [ '/product/manage/index' ], | |
22 | + 'url' => [ 'manage/index' ], | |
23 | 23 | ]; |
24 | 24 | $this->params[ 'breadcrumbs' ][] = [ |
25 | 25 | 'label' => $product->lang->title, |
26 | 26 | 'url' => [ |
27 | - '/product/manage/view', | |
27 | + 'manage/view', | |
28 | 28 | 'id' => $product->id, |
29 | 29 | ], |
30 | 30 | ]; | ... | ... |
views/variant/index.php
... | ... | @@ -18,12 +18,12 @@ |
18 | 18 | $this->title = Yii::t('product', 'Variants for ') . $product->lang->title; |
19 | 19 | $this->params[ 'breadcrumbs' ][] = [ |
20 | 20 | 'label' => Yii::t('product', 'Products'), |
21 | - 'url' => [ '/product/manage/index' ], | |
21 | + 'url' => [ 'manage/index' ], | |
22 | 22 | ]; |
23 | 23 | $this->params[ 'breadcrumbs' ][] = [ |
24 | 24 | 'label' => $product->lang->title, |
25 | 25 | 'url' => [ |
26 | - '/product/manage/view', | |
26 | + 'manage/view', | |
27 | 27 | 'id' => $product->id, |
28 | 28 | ], |
29 | 29 | ]; | ... | ... |
views/variant/update.php
... | ... | @@ -26,12 +26,12 @@ |
26 | 26 | ) . ' ' . $model->lang->title; |
27 | 27 | $this->params[ 'breadcrumbs' ][] = [ |
28 | 28 | 'label' => Yii::t('product', 'Products'), |
29 | - 'url' => [ '/product/manage/index' ], | |
29 | + 'url' => [ 'manage/index' ], | |
30 | 30 | ]; |
31 | 31 | $this->params[ 'breadcrumbs' ][] = [ |
32 | 32 | 'label' => $model->product->lang->title, |
33 | 33 | 'url' => [ |
34 | - '/product/manage/view', | |
34 | + 'manage/view', | |
35 | 35 | 'id' => $model->product->id, |
36 | 36 | ], |
37 | 37 | ]; | ... | ... |
views/variant/view.php
... | ... | @@ -15,18 +15,21 @@ |
15 | 15 | $this->title = $model->lang->title; |
16 | 16 | $this->params[ 'breadcrumbs' ][] = [ |
17 | 17 | 'label' => Yii::t('product', 'Products'), |
18 | - 'url' => [ 'index' ], | |
18 | + 'url' => [ 'manage/index' ], | |
19 | 19 | ]; |
20 | 20 | $this->params[ 'breadcrumbs' ][] = [ |
21 | 21 | 'label' => $model->product->lang->title, |
22 | 22 | 'url' => [ |
23 | - 'view', | |
23 | + 'manage/view', | |
24 | 24 | 'id' => $model->product->id, |
25 | 25 | ], |
26 | 26 | ]; |
27 | 27 | $this->params[ 'breadcrumbs' ][] = [ |
28 | 28 | 'label' => Yii::t('product', 'Variants'), |
29 | - 'url' => [ '/product/variant?product_id=' . $model->product->id ], | |
29 | + 'url' => [ | |
30 | + 'variant/index', | |
31 | + 'product_id' => $model->product->id, | |
32 | + ], | |
30 | 33 | ]; |
31 | 34 | $this->params[ 'breadcrumbs' ][] = $this->title; |
32 | 35 | $properties_string = ''; |
... | ... | @@ -83,7 +86,7 @@ |
83 | 86 | 'value' => Html::a( |
84 | 87 | $model->product->fullname, |
85 | 88 | [ |
86 | - '/product/manage/view', | |
89 | + 'product/manage/view', | |
87 | 90 | 'id' => $model->id, |
88 | 91 | ] |
89 | 92 | ), | ... | ... |
widgets/views/brandsCarousel.php
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | /** |
3 | 3 | * @var Brand[] $brands |
4 | 4 | */ |
5 | - use artweb\artbox\ecommerce\components\artboximage\ArtboxImageHelper; | |
5 | + use artweb\artbox\components\artboximage\ArtboxImageHelper; | |
6 | 6 | use artweb\artbox\ecommerce\models\Brand; |
7 | 7 | |
8 | 8 | ?> |
... | ... | @@ -10,9 +10,14 @@ |
10 | 10 | <div class="pc_prev"></div> |
11 | 11 | <div class="prods_carousel"> |
12 | 12 | <ul> |
13 | - <?php foreach($brands as $brand) { ?> | |
13 | + <?php foreach ($brands as $brand) { ?> | |
14 | 14 | <li> |
15 | - <span><a href="<?= \yii\helpers\Url::to('/brands/' . $brand->lang->alias) ?>" title="<?= $brand->lang->title ?>"><?= $brand->image ? ArtboxImageHelper::getImage($brand->imageFile, 'brandlist') : '' ?></a></span> | |
15 | + <span><a href="<?= \yii\helpers\Url::to( | |
16 | + '/brands/' . $brand->lang->alias | |
17 | + ) ?>" title="<?= $brand->lang->title ?>"><?= $brand->image ? ArtboxImageHelper::getImage( | |
18 | + $brand->imageFile, | |
19 | + 'brandlist' | |
20 | + ) : '' ?></a></span> | |
16 | 21 | </li> |
17 | 22 | <?php } ?> |
18 | 23 | </ul> | ... | ... |
widgets/views/product_smart.php
... | ... | @@ -2,6 +2,7 @@ |
2 | 2 | /** |
3 | 3 | * @var $product artweb\artbox\ecommerce\models\Product |
4 | 4 | */ |
5 | + use artweb\artbox\components\artboximage\ArtboxImageHelper; | |
5 | 6 | use yii\helpers\Html; |
6 | 7 | use yii\helpers\Url; |
7 | 8 | |
... | ... | @@ -29,7 +30,7 @@ |
29 | 30 | 'product' => $product->lang->alias, |
30 | 31 | ] |
31 | 32 | ) ?>"> |
32 | - <?= \artweb\artbox\ecommerce\components\artboximage\ArtboxImageHelper::getImage( | |
33 | + <?= ArtboxImageHelper::getImage( | |
33 | 34 | $product->enabledVariants[ 0 ]->imageUrl, |
34 | 35 | 'list', |
35 | 36 | [ | ... | ... |
widgets/views/submenu.php
... | ... | @@ -3,32 +3,42 @@ |
3 | 3 | * @var Category $rootCategory |
4 | 4 | * @var string $rootClass |
5 | 5 | */ |
6 | + use artweb\artbox\components\artboximage\ArtboxImageHelper; | |
6 | 7 | use artweb\artbox\ecommerce\models\Category; |
7 | 8 | |
8 | 9 | ?> |
9 | 10 | <div class="menu_item"> |
10 | - <?= \yii\helpers\Html::a($rootCategory->lang->title, [ | |
11 | - 'catalog/category', | |
12 | - 'category' => $rootCategory, | |
13 | - ], [ 'class' => 'submenu_button ' . $rootClass ]) ?> | |
11 | + <?= \yii\helpers\Html::a( | |
12 | + $rootCategory->lang->title, | |
13 | + [ | |
14 | + 'catalog/category', | |
15 | + 'category' => $rootCategory, | |
16 | + ], | |
17 | + [ 'class' => 'submenu_button ' . $rootClass ] | |
18 | + ) ?> | |
14 | 19 | <div class="submenu"> |
15 | 20 | <ul class="categories"> |
16 | - <?php foreach($items as $item) : ?> | |
21 | + <?php foreach ($items as $item) : ?> | |
17 | 22 | <li class="sub_cat"> |
18 | 23 | <span><?= $item[ 'item' ]->title ?></span> |
19 | - <?php if(!empty( $item[ 'children' ] )) : ?> | |
24 | + <?php if (!empty( $item[ 'children' ] )) : ?> | |
20 | 25 | <div class="sub_cat_content"> |
21 | 26 | <div class="content_items"> |
22 | - <?php foreach($item[ 'children' ] as $_item) : ?> | |
23 | - <div class="content_item"><a href="<?= \yii\helpers\Url::to([ | |
24 | - 'catalog/category', | |
25 | - 'category' => $_item[ 'item' ], | |
26 | - ]) ?>"> | |
27 | + <?php foreach ($item[ 'children' ] as $_item) : ?> | |
28 | + <div class="content_item"><a href="<?= \yii\helpers\Url::to( | |
29 | + [ | |
30 | + 'catalog/category', | |
31 | + 'category' => $_item[ 'item' ], | |
32 | + ] | |
33 | + ) ?>"> | |
27 | 34 | <div class="picture"> |
28 | - <?php if(empty( $_item[ 'item' ]->image )) : ?> | |
35 | + <?php if (empty( $_item[ 'item' ]->image )) : ?> | |
29 | 36 | <img src="/images/no_photo.png"> |
30 | 37 | <?php else : ?> |
31 | - <?= $_item[ 'item' ]->imageUrl ? \artweb\artbox\ecommerce\components\artboximage\ArtboxImageHelper::getImage($_item[ 'item' ]->imageUrl, 'mainmenu') : '' ?> | |
38 | + <?= $_item[ 'item' ]->imageUrl ? ArtboxImageHelper::getImage( | |
39 | + $_item[ 'item' ]->imageUrl, | |
40 | + 'mainmenu' | |
41 | + ) : '' ?> | |
32 | 42 | <?php endif ?> |
33 | 43 | </div> |
34 | 44 | <div class="title"><?= $_item[ 'item' ]->title ?></div> | ... | ... |