Commit b588767bef090d828d7385b9c2858e731b257a84
1 parent
8fa44a60
all sum in order
Showing
1 changed file
with
3 additions
and
1 deletions
 
Show diff stats
views/order/_form.php
| @@ -114,7 +114,9 @@ JS; | @@ -114,7 +114,9 @@ JS; | ||
| 114 | </div> | 114 | </div> | 
| 115 | 115 | ||
| 116 | <?php | 116 | <?php | 
| 117 | + $sum = 0; | ||
| 117 | foreach ($model->orderProducts as $index => $orderProduct) { | 118 | foreach ($model->orderProducts as $index => $orderProduct) { | 
| 119 | + $sum += ($orderProduct->count * $orderProduct->price) | ||
| 118 | ?> | 120 | ?> | 
| 119 | <div class="row row-order-product"> | 121 | <div class="row row-order-product"> | 
| 120 | <div class="col-md-4"> | 122 | <div class="col-md-4"> | 
| @@ -286,7 +288,7 @@ JS; | @@ -286,7 +288,7 @@ JS; | ||
| 286 | ?> | 288 | ?> | 
| 287 | 289 | ||
| 288 | <div class="ln_solid"></div> | 290 | <div class="ln_solid"></div> | 
| 289 | - | 291 | + <div>Всего: <?=$sum?></div> | 
| 290 | <div class="form-group"> | 292 | <div class="form-group"> | 
| 291 | <?= Html::submitButton( | 293 | <?= Html::submitButton( | 
| 292 | $model->isNewRecord ? Yii::t('order', 'Create') : Yii::t('order', 'Update'), | 294 | $model->isNewRecord ? Yii::t('order', 'Create') : Yii::t('order', 'Update'), |