Commit a1e889f727342fa13d58d5af99046b0b40b24c38
1 parent
1cd398ea
add variantSku
Showing
3 changed files
with
27 additions
and
11 deletions
Show diff stats
models/Product.php
| @@ -371,10 +371,12 @@ | @@ -371,10 +371,12 @@ | ||
| 371 | public function getFullName():string | 371 | public function getFullName():string |
| 372 | { | 372 | { |
| 373 | $name = ''; | 373 | $name = ''; |
| 374 | + $groupName = $this->category->getTaxGroups()->where(['use_in_name'=>1])->joinWith('lang')->one()->lang->title; | ||
| 375 | + | ||
| 374 | if (!empty( $this->category->lang->category_synonym )) { | 376 | if (!empty( $this->category->lang->category_synonym )) { |
| 375 | - $name = $name . $this->category->lang->category_synonym . ' '; | 377 | + $name = $name . ($groupName ? $groupName : $this->category->lang->category_synonym) . ' '; |
| 376 | } else { | 378 | } else { |
| 377 | - $name = $name . $this->category->lang->title . ' '; | 379 | + $name = $name . ($groupName ? $groupName : $this->category->lang->title) . ' '; |
| 378 | } | 380 | } |
| 379 | 381 | ||
| 380 | if (!empty( $this->brand )) { | 382 | if (!empty( $this->brand )) { |
models/TaxGroup.php
| @@ -16,6 +16,8 @@ | @@ -16,6 +16,8 @@ | ||
| 16 | * @property boolean $is_filter | 16 | * @property boolean $is_filter |
| 17 | * @property integer $level | 17 | * @property integer $level |
| 18 | * @property integer $sort | 18 | * @property integer $sort |
| 19 | + * @property integer $use_in_name | ||
| 20 | + * @property string $meta_robots | ||
| 19 | * @property boolean $display | 21 | * @property boolean $display |
| 20 | * @property boolean $is_menu | 22 | * @property boolean $is_menu |
| 21 | * @property string $remote_id | 23 | * @property string $remote_id |
| @@ -97,10 +99,15 @@ | @@ -97,10 +99,15 @@ | ||
| 97 | 'level', | 99 | 'level', |
| 98 | 'sort', | 100 | 'sort', |
| 99 | 'position', | 101 | 'position', |
| 102 | + 'use_in_name', | ||
| 100 | ], | 103 | ], |
| 101 | 'integer', | 104 | 'integer', |
| 102 | ], | 105 | ], |
| 103 | [ | 106 | [ |
| 107 | + ['meta_robots'], | ||
| 108 | + 'string' | ||
| 109 | + ], | ||
| 110 | + [ | ||
| 104 | [ 'categories' ], | 111 | [ 'categories' ], |
| 105 | 'safe', | 112 | 'safe', |
| 106 | ], | 113 | ], |
| @@ -113,13 +120,15 @@ | @@ -113,13 +120,15 @@ | ||
| 113 | public function attributeLabels() | 120 | public function attributeLabels() |
| 114 | { | 121 | { |
| 115 | return [ | 122 | return [ |
| 116 | - 'id' => 'Tax Group ID', | ||
| 117 | - 'is_filter' => 'Use in filter', | ||
| 118 | - 'sort' => 'Sort', | ||
| 119 | - 'display' => 'Display', | ||
| 120 | - 'is_menu' => 'Отображать в характеристиках', | ||
| 121 | - 'level' => 'уровень', | ||
| 122 | - 'ppsition' => 'Позиция', | 123 | + 'id' => 'Tax Group ID', |
| 124 | + 'is_filter' => 'Use in filter', | ||
| 125 | + 'sort' => 'Sort', | ||
| 126 | + 'display' => 'Display', | ||
| 127 | + 'is_menu' => 'Отображать в характеристиках', | ||
| 128 | + 'level' => 'уровень', | ||
| 129 | + 'position' => 'Позиция', | ||
| 130 | + 'meta_robots' => 'Meta Robots', | ||
| 131 | + 'use_in_name' => 'Использовать в названии', | ||
| 123 | ]; | 132 | ]; |
| 124 | } | 133 | } |
| 125 | 134 |
views/tax-group/_form.php
| @@ -55,10 +55,15 @@ | @@ -55,10 +55,15 @@ | ||
| 55 | 55 | ||
| 56 | <?= $form->field($model, 'is_menu') | 56 | <?= $form->field($model, 'is_menu') |
| 57 | ->checkbox() ?> | 57 | ->checkbox() ?> |
| 58 | - | 58 | + |
| 59 | + <?= $form->field($model, 'use_in_name') | ||
| 60 | + ->checkbox() ?> | ||
| 61 | + | ||
| 59 | <?= $form->field($model, 'sort') | 62 | <?= $form->field($model, 'sort') |
| 60 | ->textInput() ?> | 63 | ->textInput() ?> |
| 61 | - | 64 | + |
| 65 | + <?= $form->field($model, 'meta_robots') | ||
| 66 | + ->textInput() ?> | ||
| 62 | <?php | 67 | <?php |
| 63 | echo LanguageForm::widget( | 68 | echo LanguageForm::widget( |
| 64 | [ | 69 | [ |