@php $baseCurrency = base_currency(); $baseCurrencyCode = $baseCurrency?->currency_code ?? 'RON'; $listingFormCurrencies = listing_form_currencies(); if ($listingFormCurrencies->isEmpty() && ! empty($currency_list)) { $listingFormCurrencies = collect($currency_list) ->filter(fn ($currency) => in_array(strtoupper((string) $currency->currency_code), ['RON', 'EUR'], true)) ->values(); } $selectedCurrencyCode = strtoupper((string) old('price_currency_code', $baseCurrencyCode)); if (! $listingFormCurrencies->contains(fn ($currency) => strtoupper((string) $currency->currency_code) === $selectedCurrencyCode)) { $selectedCurrencyCode = strtoupper((string) $baseCurrencyCode); } $displayPrice = old('regular_price'); if ($displayPrice === null && isset($listing) && $listing->regular_price !== null && $listing->regular_price !== '') { $displayPrice = convert_price_from_base_currency((float) $listing->regular_price, $selectedCurrencyCode); } $displayPrice = format_listing_price_input_value($displayPrice); @endphp
@once @push('style_section') @endpush @push('js_section') @endpush @endonce