@php Assets::addScriptsDirectly('vendor/core/plugins/ecommerce/js/product-option.js'); $product = $product->loadMissing([ 'options' => function ($query) { return $query->with(['values']); }, ]); $oldOption = old('options', []) ?? []; $currentProductOption = $product->options; foreach ($currentProductOption as $key => $option) { $currentProductOption[$key]['name'] = $option->name; foreach ($option['values'] as $valueKey => $value) { $currentProductOption[$key]['values'][$valueKey]['option_value'] = $value->option_value; } } if (!empty($oldOption)) { $currentProductOption = $oldOption; } $isDefaultLanguage = !defined('LANGUAGE_ADVANCED_MODULE_SCREEN_NAME') || !request()->input('ref_lang') || request()->input('ref_lang') == Language::getDefaultLocaleCode(); @endphp @push('header') @endpush
@if ($isDefaultLanguage)
{{ trans('plugins/ecommerce::product-option.add_new_option') }}
@if (! empty($globalOptions))
{{ trans('plugins/ecommerce::product-option.add_global_option') }}
@endif @endif
@push('footer') @if ($isDefaultLanguage) @endif @if ($isDefaultLanguage) @endif
__priceLabel__ __priceTypeLabel__
@if ($isDefaultLanguage) @endif @if ($isDefaultLanguage) @endif __optionValue__
#__label____priceLabel__ __priceTypeLabel__
@if ($isDefaultLanguage) @endif @if ($isDefaultLanguage) @endif

__nameLabel__
@if ($isDefaultLanguage)
__optionTypeLabel__
@endif
__optionValueSortable__
@endpush