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 | 371 | public function getFullName():string |
| 372 | 372 | { |
| 373 | 373 | $name = ''; |
| 374 | + $groupName = $this->category->getTaxGroups()->where(['use_in_name'=>1])->joinWith('lang')->one()->lang->title; | |
| 375 | + | |
| 374 | 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 | 378 | } else { |
| 377 | - $name = $name . $this->category->lang->title . ' '; | |
| 379 | + $name = $name . ($groupName ? $groupName : $this->category->lang->title) . ' '; | |
| 378 | 380 | } |
| 379 | 381 | |
| 380 | 382 | if (!empty( $this->brand )) { | ... | ... |
models/TaxGroup.php
| ... | ... | @@ -16,6 +16,8 @@ |
| 16 | 16 | * @property boolean $is_filter |
| 17 | 17 | * @property integer $level |
| 18 | 18 | * @property integer $sort |
| 19 | + * @property integer $use_in_name | |
| 20 | + * @property string $meta_robots | |
| 19 | 21 | * @property boolean $display |
| 20 | 22 | * @property boolean $is_menu |
| 21 | 23 | * @property string $remote_id |
| ... | ... | @@ -97,10 +99,15 @@ |
| 97 | 99 | 'level', |
| 98 | 100 | 'sort', |
| 99 | 101 | 'position', |
| 102 | + 'use_in_name', | |
| 100 | 103 | ], |
| 101 | 104 | 'integer', |
| 102 | 105 | ], |
| 103 | 106 | [ |
| 107 | + ['meta_robots'], | |
| 108 | + 'string' | |
| 109 | + ], | |
| 110 | + [ | |
| 104 | 111 | [ 'categories' ], |
| 105 | 112 | 'safe', |
| 106 | 113 | ], |
| ... | ... | @@ -113,13 +120,15 @@ |
| 113 | 120 | public function attributeLabels() |
| 114 | 121 | { |
| 115 | 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 | 55 | |
| 56 | 56 | <?= $form->field($model, 'is_menu') |
| 57 | 57 | ->checkbox() ?> |
| 58 | - | |
| 58 | + | |
| 59 | + <?= $form->field($model, 'use_in_name') | |
| 60 | + ->checkbox() ?> | |
| 61 | + | |
| 59 | 62 | <?= $form->field($model, 'sort') |
| 60 | 63 | ->textInput() ?> |
| 61 | - | |
| 64 | + | |
| 65 | + <?= $form->field($model, 'meta_robots') | |
| 66 | + ->textInput() ?> | |
| 62 | 67 | <?php |
| 63 | 68 | echo LanguageForm::widget( |
| 64 | 69 | [ | ... | ... |