Commit 2976f2f05b34eaf735ef61fffaa28741f788816c
1 parent
94580277
-Remove sku order problems fix
Showing
1 changed file
with
15 additions
and
1 deletions
Show diff stats
views/order/_form.php
| @@ -389,6 +389,11 @@ JS; | @@ -389,6 +389,11 @@ JS; | ||
| 389 | 'attribute' => 'product_name', | 389 | 'attribute' => 'product_name', |
| 390 | 'content' => function($model) { | 390 | 'content' => function($model) { |
| 391 | if (!empty($model->product_name)) { | 391 | if (!empty($model->product_name)) { |
| 392 | + | ||
| 393 | + if (empty($model->productVariant)) { | ||
| 394 | + return ''; | ||
| 395 | + } | ||
| 396 | + | ||
| 392 | return Html::a( | 397 | return Html::a( |
| 393 | StringHelper::truncate($model->product_name, 10, '...'), | 398 | StringHelper::truncate($model->product_name, 10, '...'), |
| 394 | '#', | 399 | '#', |
| @@ -418,6 +423,11 @@ JS; | @@ -418,6 +423,11 @@ JS; | ||
| 418 | 'attribute' => 'productVariant.lang.title', | 423 | 'attribute' => 'productVariant.lang.title', |
| 419 | 'label' => \Yii::t('app', 'Цвет'), | 424 | 'label' => \Yii::t('app', 'Цвет'), |
| 420 | 'content' => function($model) { | 425 | 'content' => function($model) { |
| 426 | + | ||
| 427 | + if (empty($model->productVariant)) { | ||
| 428 | + return ''; | ||
| 429 | + } | ||
| 430 | + | ||
| 421 | if (preg_match('@.*\.(png|jpg|gif)@i', $model->productVariant->lang->title)) { | 431 | if (preg_match('@.*\.(png|jpg|gif)@i', $model->productVariant->lang->title)) { |
| 422 | return ''; | 432 | return ''; |
| 423 | } else { | 433 | } else { |
| @@ -514,8 +524,12 @@ JS; | @@ -514,8 +524,12 @@ JS; | ||
| 514 | 'pageSummary' => false, | 524 | 'pageSummary' => false, |
| 515 | ], | 525 | ], |
| 516 | [ | 526 | [ |
| 517 | - // 'label' => \Yii::t('app', 'Склады'), | ||
| 518 | 'content' => function($model) { | 527 | 'content' => function($model) { |
| 528 | + | ||
| 529 | + if (empty($model->productVariant)) { | ||
| 530 | + return '<i class="glyphicon glyphicon-remove"></i>'; | ||
| 531 | + } | ||
| 532 | + | ||
| 519 | $content = '<table class="table"><tbody><tr><th>Склад</th><th>кол.</th></tr>'; | 533 | $content = '<table class="table"><tbody><tr><th>Склад</th><th>кол.</th></tr>'; |
| 520 | foreach ($model->productVariant->variantStocks as $stock) { | 534 | foreach ($model->productVariant->variantStocks as $stock) { |
| 521 | $content .= '<tr><td>' . $stock->stock->title . '</td><td>' . $stock->quantity . '</td></tr>'; | 535 | $content .= '<tr><td>' . $stock->stock->title . '</td><td>' . $stock->quantity . '</td></tr>'; |