1{{--
2 Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the GNU Affero General Public License v3.0.
3 See the LICENCE file in the repository root for full licence text.
4--}}
5@php
6 $itemErrors = $validationErrors['orderItems'] ?? [];
7
8 $checkout = $checkout ?? true;
9
10 $modifiers = $modifiers ?? [];
11 $extraClasses = presence($extraClasses ?? null);
12@endphp
13
14<ul class="{{ class_with_modifiers('order-line-items', $modifiers) }} {{ $extraClasses }}">
15 @foreach ($order->items as $i)
16 <li class="order-line-items__item order-line-items__item--main">
17 <div class="order-line-items__data order-line-items__data--name">
18 @php
19 $subtext = $i->getSubtext();
20 @endphp
21 <div>{{ $i->getDisplayName(true) }}</div>
22 @if ($subtext !== null)
23 <div class="order-line-items__subtext">
24 {{ $subtext }}
25 </div>
26 @endif
27
28 @if (isset($itemErrors[$i->id]))
29 <ul class="order-line-items__errors">
30 @foreach ($itemErrors[$i->id] as $message)
31 <li>{{ $message }}</li>
32 @endforeach
33 </ul>
34 @endif
35
36 </div>
37 @if (isset($weight))
38 <div class="order-line-items__data order-line-items__data--weight">
39 @if ($i->product->weight !== null)
40 {{ $i->product->weight }}g
41 @endif
42 </div>
43 @endif
44 <div class="order-line-items__data order-line-items__data--quantity">
45 {{ osu_trans_choice('common.count.item', $i->quantity) }}
46 </div>
47 <div class="order-line-items__data order-line-items__data--value">
48 {{ currency($i->subtotal()) }}
49 </div>
50 </li>
51 @endforeach
52
53 @if ($checkout && $order->shipping > 0)
54 <li class="order-line-items__item order-line-items__item--footer">
55 <div class="order-line-items__data order-line-items__data--name">
56 {{ osu_trans('store.order.subtotal') }}
57 </div>
58 <div class="order-line-items__data order-line-items__data--value">
59 {{ currency($order->getSubtotal()) }}
60 </div>
61 </li>
62
63 <li class="order-line-items__item order-line-items__item--footer">
64 <div class="order-line-items__data order-line-items__data--name">
65 {{ osu_trans('store.order.shipping_and_handling') }}
66 </div>
67 <div class="order-line-items__data order-line-items__data--value">
68 {{ currency($order->shipping) }}
69 </div>
70 </li>
71 @endif
72
73 @if (!$checkout)
74 <li class="order-line-items__item order-line-items__item--footer order-line-items__item--footer-total">
75 <div class="order-line-items__data order-line-items__data--name">
76 {{ osu_trans('store.order.total') }}
77 </div>
78 <div class="order-line-items__data order-line-items__data--value">
79 {{ currency($order->getSubtotal()) }}
80 </div>
81 </li>
82 @endif
83</ul>