Commit b3a3a952073f6236e375380321be68e24382eb0c
1 parent
98a320ef
Breadcrumbs and order fix
Showing
1 changed file
with
16 additions
and
1 deletions
Show diff stats
views/order/print.php
@@ -38,6 +38,7 @@ use yii\widgets\DetailView; | @@ -38,6 +38,7 @@ use yii\widgets\DetailView; | ||
38 | [ | 38 | [ |
39 | 'attribute' => 'user.username', | 39 | 'attribute' => 'user.username', |
40 | 'label' => \Yii::t('app', 'Client Username'), | 40 | 'label' => \Yii::t('app', 'Client Username'), |
41 | + 'value' => $order->user?$order->user->username:$order->name, | ||
41 | ], | 42 | ], |
42 | [ | 43 | [ |
43 | 'attribute' => 'email', | 44 | 'attribute' => 'email', |
@@ -68,6 +69,10 @@ use yii\widgets\DetailView; | @@ -68,6 +69,10 @@ use yii\widgets\DetailView; | ||
68 | 'value' => $order->declaration?:null, | 69 | 'value' => $order->declaration?:null, |
69 | ], | 70 | ], |
70 | [ | 71 | [ |
72 | + 'attribute' => 'consignment', | ||
73 | + 'value' => $order->consignment?:null, | ||
74 | + ], | ||
75 | + [ | ||
71 | 'attribute' => 'stock', | 76 | 'attribute' => 'stock', |
72 | 'value' => $order->stock?:null, | 77 | 'value' => $order->stock?:null, |
73 | ], | 78 | ], |
@@ -85,7 +90,17 @@ use yii\widgets\DetailView; | @@ -85,7 +90,17 @@ use yii\widgets\DetailView; | ||
85 | ], | 90 | ], |
86 | [ | 91 | [ |
87 | 'attribute' => 'shipping_by', | 92 | 'attribute' => 'shipping_by', |
88 | - 'value' => $order->shipping_by?:null, | 93 | + 'value' => $order->shipping_by?function() use($order) { |
94 | + switch ($order->shipping_by) { | ||
95 | + case 1: | ||
96 | + return 'Отправитель'; | ||
97 | + break; | ||
98 | + case 2: | ||
99 | + return 'Получатель'; | ||
100 | + break; | ||
101 | + } | ||
102 | + return null; | ||
103 | + }:null, | ||
89 | ], | 104 | ], |
90 | [ | 105 | [ |
91 | 'attribute' => 'city', | 106 | 'attribute' => 'city', |