Commit 2d913ccb2339ec5f1175dfde9a45e0900d53ef9a
1 parent
894d945a
-Product log fixes
Showing
2 changed files
with
10 additions
and
30 deletions
Show diff stats
components/OrderProductLogger.php
| @@ -43,7 +43,7 @@ | @@ -43,7 +43,7 @@ | ||
| 43 | $log->order_id = $params['order_id']; | 43 | $log->order_id = $params['order_id']; |
| 44 | $log->data = Json::encode($data); | 44 | $log->data = Json::encode($data); |
| 45 | 45 | ||
| 46 | - if (\Yii::$app->user instanceof User) { | 46 | + if (\Yii::$app->user->identity instanceof User) { |
| 47 | $log->user_id = (integer) \Yii::$app->user->identity->id; | 47 | $log->user_id = (integer) \Yii::$app->user->identity->id; |
| 48 | } else { | 48 | } else { |
| 49 | $log->user_id = NULL; | 49 | $log->user_id = NULL; |
views/order/_log_product_item.php
| @@ -12,17 +12,11 @@ | @@ -12,17 +12,11 @@ | ||
| 12 | use yii\helpers\Url; | 12 | use yii\helpers\Url; |
| 13 | 13 | ||
| 14 | ?> | 14 | ?> |
| 15 | -<div class="box box-success"> | 15 | +<div class="box box-success collapsed-box"> |
| 16 | <div class="box-header with-border"> | 16 | <div class="box-header with-border"> |
| 17 | - <h3 class="box-title">История товара <a href="<?= Url::to( | ||
| 18 | - [ | ||
| 19 | - '/ecommerce/variant/view', | ||
| 20 | - 'product_id' => $model->productVariant->product->id, | ||
| 21 | - 'id' => $model->productVariant->id, | ||
| 22 | - ] | ||
| 23 | - ) ?>" target="_blank" class="text-green"><?php echo $model->sku; ?></a></h3> | 17 | + <h3 class="box-title">История товара <span class="text-green"><?php echo $model->sku; ?></span></h3> |
| 24 | <div class="box-tools pull-right"> | 18 | <div class="box-tools pull-right"> |
| 25 | - <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i> | 19 | + <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i> |
| 26 | </button> | 20 | </button> |
| 27 | </div> | 21 | </div> |
| 28 | </div> | 22 | </div> |
| @@ -37,7 +31,8 @@ | @@ -37,7 +31,8 @@ | ||
| 37 | echo Html::img( | 31 | echo Html::img( |
| 38 | $model->productVariant->imageUrl, | 32 | $model->productVariant->imageUrl, |
| 39 | [ | 33 | [ |
| 40 | - 'class' => 'img-thumbnail', | 34 | + 'class' => 'img-thumbnail img-center', |
| 35 | + 'width' => '50%', | ||
| 41 | ] | 36 | ] |
| 42 | ); | 37 | ); |
| 43 | } | 38 | } |
| @@ -56,33 +51,18 @@ | @@ -56,33 +51,18 @@ | ||
| 56 | </div> | 51 | </div> |
| 57 | <div class="box-footer no-padding"> | 52 | <div class="box-footer no-padding"> |
| 58 | <ul class="nav nav-stacked"> | 53 | <ul class="nav nav-stacked"> |
| 59 | - <li><a target="_blank" href="<?= Url::to( | ||
| 60 | - [ | ||
| 61 | - '/ecommerce/manage/view', | ||
| 62 | - 'id' => $model->productVariant->product->id, | ||
| 63 | - ] | ||
| 64 | - ) ?>">Название: <span class="text-orange pull-right"><?php echo StringHelper::truncate( | 54 | + <li><a href="#" class="no-click">Название: <span class="text-orange pull-right"><?php echo StringHelper::truncate( |
| 65 | $model->productVariant->product->lang->title, | 55 | $model->productVariant->product->lang->title, |
| 66 | 35, | 56 | 35, |
| 67 | '...' | 57 | '...' |
| 68 | ); ?></span></a></li> | 58 | ); ?></span></a></li> |
| 69 | - <li><a target="_blank" href="<?= Url::to( | ||
| 70 | - [ | ||
| 71 | - '/ecommerce/category/view', | ||
| 72 | - 'id' => $model->productVariant->category->id, | ||
| 73 | - ] | ||
| 74 | - ) ?>">Категория: | 59 | + <li><a href="#" class="no-click">Категория: |
| 75 | <span class="pull-right text-orange"><?php echo $model->productVariant->category->lang->title; ?></span></a> | 60 | <span class="pull-right text-orange"><?php echo $model->productVariant->category->lang->title; ?></span></a> |
| 76 | </li> | 61 | </li> |
| 77 | - <li><a target="_blank" href="<?= Url::to( | ||
| 78 | - [ | ||
| 79 | - '/ecommerce/brand/view', | ||
| 80 | - 'id' => $model->productVariant->product->brand->id, | ||
| 81 | - ] | ||
| 82 | - ) ?>">Брэнд: | 62 | + <li><a href="#" class="no-click">Брэнд: |
| 83 | <span class="pull-right text-orange"><?php echo $model->productVariant->product->brand->lang->title; ?></span></a> | 63 | <span class="pull-right text-orange"><?php echo $model->productVariant->product->brand->lang->title; ?></span></a> |
| 84 | </li> | 64 | </li> |
| 85 | - <li><a target="_blank" href="#">Метки: | 65 | + <li><a href="#" class="no-click">Метки: |
| 86 | <?php | 66 | <?php |
| 87 | if ($model->productVariant->product->is_discount) { | 67 | if ($model->productVariant->product->is_discount) { |
| 88 | echo Html::tag( | 68 | echo Html::tag( |