From 2976f2f05b34eaf735ef61fffaa28741f788816c Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 21 Dec 2016 12:22:35 +0200 Subject: [PATCH] -Remove sku order problems fix --- views/order/_form.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/views/order/_form.php b/views/order/_form.php index 925a72c..63a20e9 100755 --- a/views/order/_form.php +++ b/views/order/_form.php @@ -389,6 +389,11 @@ JS; 'attribute' => 'product_name', 'content' => function($model) { if (!empty($model->product_name)) { + + if (empty($model->productVariant)) { + return ''; + } + return Html::a( StringHelper::truncate($model->product_name, 10, '...'), '#', @@ -418,6 +423,11 @@ JS; 'attribute' => 'productVariant.lang.title', 'label' => \Yii::t('app', 'Цвет'), 'content' => function($model) { + + if (empty($model->productVariant)) { + return ''; + } + if (preg_match('@.*\.(png|jpg|gif)@i', $model->productVariant->lang->title)) { return ''; } else { @@ -514,8 +524,12 @@ JS; 'pageSummary' => false, ], [ - // 'label' => \Yii::t('app', 'Склады'), 'content' => function($model) { + + if (empty($model->productVariant)) { + return ''; + } + $content = ''; foreach ($model->productVariant->variantStocks as $stock) { $content .= ''; -- libgit2 0.21.4
Складкол.
' . $stock->stock->title . '' . $stock->quantity . '