@if(count($offerRules) > 0) @php $n=1; $categoryIds = array_column($offerRules,'category_id'); $sameCategory = (count(array_unique($categoryIds, SORT_REGULAR)) === 1); @endphp @foreach ($offerRules as $keys => $offer)
{!! Form::hidden('is_offer_item', 1) !!} {!! Form::hidden('variation_id', $offer['vitem_id']) !!} {!! Form::hidden('variation_master_id', $offer['variation_id']) !!}
@php $selectText = $offer['name']; $itemName = $offer['item']['name']; if((int)$offer['variation_id'] > 0){ $selectText .=" - ".$offer['vm_name']; $itemName .= " - ".$offer['vm_name']; } $num = ($n == 1) ? __('v2/front_site.first') :__('v2/front_site.second'); @endphp
@if($sameCategory) {!! __('v2/front_site.select_same',['num'=>$num,'text'=>$selectText]) !!} @else {!! __('v2/front_site.select_item_deal',['text'=>$selectText]) !!} @endif
  • {{ $itemName }}

{!! $offer['item']['description'] !!}

@php $variationId = $itemPrice = 0; $itemId = $offer['item']['id']; @endphp
@if (isset($removedIngredients[$itemId]) && count($removedIngredients[$itemId]) > 0) @php $j=1; @endphp

{!! __('v2/front_site.removed') !!}

@foreach ($removedIngredients[$itemId] as $rKey => $remove)
@php $j++; @endphp @endforeach
@endif
@if (isset($extraIngredients[$itemId]) && count($extraIngredients[$itemId]) > 0)

{!! __('v2/front_site.extra') !!}

@php $l=1; $categoryId = 0; @endphp @if (isset($globalExtraCategory[$itemId]) && count($globalExtraCategory) > 0 ) @foreach ($globalExtraCategory[$itemId] as $key => $extraCategories) @php if($l == 1){ $categoryId = $extraCategories['id']; } @endphp
  • {!! $extraCategories['name'] !!}
  • @php $l++; @endphp @endforeach @endif
    @php $k = 1; @endphp @foreach ($extraIngredients[$itemId] as $extra) @php $extraPrice = $extra['price']; if(count($extra['item_variations']) > 0){ $variationKey = array_search($offer['variation_id'], array_column($extra['item_variations'], 'id')); if(isset($extra['item_variations'][$variationKey])){ $extraPrice = $extra['item_variations'][$variationKey]['price']; } } @endphp
    @php $k++; @endphp @endforeach
    @endif
    @php $n++; @endphp @endforeach @endif