@php
$tiers = [];
foreach ($cat->Products as $k => $v) {
$tiers[$v->tier][] = $v;
}
@endphp
@if (
isset($settings->content->group_by_tier) &&
$settings->content->group_by_tier &&
count($tiers) > 1
)
@foreach ($tiers as $tier_id => $products)
{{
isset($settings->content->tier_names->{$tier_id}) &&
$settings->content->tier_names->{$tier_id} ?
$settings->content->tier_names->{$tier_id} :
$tier_id
}}
@include(
'Plugins/Payment/Views/Elements/Order/category_contents',
[
'cat' => $cat,
'categories' => $categories,
'products' => $products
]
)
@endforeach
@else
@include(
'Plugins/Payment/Views/Elements/Order/category_contents',
[
'cat' => $cat,
'categories' => $categories,
'products' => $cat->Products
]
)
@endif