% if ( @$basket ) {
% foreach my $obj ( @$basket ) { % $total_num += $obj->number; % $total_sum += $obj->number * $obj->price; % if ( $context ) { % } else { % } % }
<% $context ? ' ' : '' %> Артикул Название Цвет Размер Цена Кол-во Сумма
\ % if ( $context ) {  \ % } else { \ % } <% $obj->articul %> <% exists $obj->{item} ? $obj->{item}->ext_id : '' %> <% $obj->name %> <% $obj->colour || ' ' %> <% $obj->size || ' ' %><% $obj->price %> <% $obj->number %> <% $obj->number * $obj->price %>
Итого товаров <% $total_num %> <% $total_sum %>
Доставка <% $order->sum_delivery %>
Скидка <% $order->sum_discount || 0 %>
Итого с доставкой <% $order->sum_total %>
% unless ( $context ) {
% } % if ( ref $filter_params eq 'HASH' ) { % while ( my ($key, $value) = each %$filter_params ) { % next if grep { $_->{attr} eq $key } $order->structure(); % } % }
% if ( @coupons ) { % foreach my $coupon ( @coupons ) { % }
Использованные купоны Скидка
<% $coupon->code %> <% $coupon->discount %>
% } % } else {
Заказ пустой
% } <%args> $order => undef $filter_params => undef $context => undef <%init> return unless ref $order; my $basket = $keeper->{webshop}->get_basket( order_id => $order->id, status => 1, with_products => 1, ) // []; my $total_sum = 0; my $total_num = 0; my @coupons = $keeper->get_documents ( class => 'webshop::Coupon', lclass => 'webshop::OrderCouponLink', lsource => $order->id, ) if $order->sum_discount;