@switch($attribute->type)
@case('text')
@if ($attribute->code == 'country')
@foreach (core()->countries() as $country)
@endforeach
@elseif ($attribute->code == 'state')
@else
@endif
@break
@case('price')
{{ core()->currencySymbol(core()->getBaseCurrencyCode()) }}
@break
@case('textarea')
@break
@case('date')
@break
@case('datetime')
@break
@case('select')
@php
$selectedOption = old($attribute->code) ?: $seller[$attribute->code];
$options = $attribute->options()->orderBy('sort_order')->get();
@endphp
@foreach ($options as $option)
@endforeach
@break
@case('multiselect')
@php
$selectedOption = old($attribute->code) ?: explode(',', $seller[$attribute->code]);
$selectedOption = collect($selectedOption)
->filter(fn ($value) => ! empty($value))->toArray();
$modelValue = ! empty($selectedOption) ? json_encode($selectedOption) : '';
@endphp
@foreach ($attribute->options()->with('translations')->orderBy('sort_order')->get() as $option)
@endforeach
@break
@case('checkbox')
@php
$selectedOption = old($attribute->code) ?: explode(',', $seller[$attribute->code]);
@endphp
@foreach ($attribute->options as $option)
@endforeach
@break
@case('boolean')
@php $selectedValue = old($attribute->code) ?: $seller[$attribute->code] @endphp
@break
@case('image')
@case('file')
@if ($seller[$attribute->code])
@lang('marketplace::app.seller.products.edit.remove')
@endif
@break
@endswitch
@pushOnce('scripts')
@endPushOnce