get('basket'); $data = $basket->getData(); $variants = []; if (!empty($data)) { $variants = $basket->findModels(array_keys($data)); } $formatter = \Yii::$app->formatter; $sum = 0; $sumDiscount = 0; foreach ($basket->findModels(array_keys($basket->getData())) as $variant) { $count = $basket->getItem($variant->id)[ 'count' ]; $sum += $variant->price * $count; if (!empty($variant->price_old)) { $sumDiscount += ( $variant->price_old - $variant->price ) * $count; } } if (!empty($variants)) { ?>
getItem($variant->id)[ 'count' ]; ?>
product->image ? $variant->product->image->getPath( ) : '@frontend/img/no-image.png' ) ->fillResize(50, 50) ->renderImage( [ 'alt' => $variant->product->lang->title, 'title' => $variant->product->lang->title, ] ), [ '/product/view', 'id' => $variant->product->id, ], [ 'target' => '_blank', ] ); ?> product->lang->title, [ '/product/view', 'id' => $variant->product->id, ], [ 'target' => '_blank', ] ); ?> 'form-control increase-product-basket', ] ); ?> asDecimal($variant->price ? : 0, 2); ?> price_old)) { echo $formatter->asDecimal($variant->price_old - $variant->price, 2); } else { echo $formatter->asDecimal(0, 2); } ?> asDecimal( ( $variant->price ? : 0 ) * $count, 2 ); ?>
asDecimal($sum, 2); ?>

Итоговый счет

asDecimal($sum, 2); ?>
asDecimal($sumDiscount, 2); ?>
asDecimal($sum, 2); ?>
'fa fa-' ]), [ 'checkout/info' ], [ 'class' => 'btn btn-success', ] ) ?>