Commit 2976f2f05b34eaf735ef61fffaa28741f788816c

Authored by Alexey Boroda
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 389 'attribute' => 'product_name',
390 390 'content' => function($model) {
391 391 if (!empty($model->product_name)) {
  392 +
  393 + if (empty($model->productVariant)) {
  394 + return '';
  395 + }
  396 +
392 397 return Html::a(
393 398 StringHelper::truncate($model->product_name, 10, '...'),
394 399 '#',
... ... @@ -418,6 +423,11 @@ JS;
418 423 'attribute' => 'productVariant.lang.title',
419 424 'label' => \Yii::t('app', 'Цвет'),
420 425 'content' => function($model) {
  426 +
  427 + if (empty($model->productVariant)) {
  428 + return '';
  429 + }
  430 +
421 431 if (preg_match('@.*\.(png|jpg|gif)@i', $model->productVariant->lang->title)) {
422 432 return '';
423 433 } else {
... ... @@ -514,8 +524,12 @@ JS;
514 524 'pageSummary' => false,
515 525 ],
516 526 [
517   - // 'label' => \Yii::t('app', 'Склады'),
518 527 'content' => function($model) {
  528 +
  529 + if (empty($model->productVariant)) {
  530 + return '<i class="glyphicon glyphicon-remove"></i>';
  531 + }
  532 +
519 533 $content = '<table class="table"><tbody><tr><th>Склад</th><th>кол.</th></tr>';
520 534 foreach ($model->productVariant->variantStocks as $stock) {
521 535 $content .= '<tr><td>' . $stock->stock->title . '</td><td>' . $stock->quantity . '</td></tr>';
... ...