@if (!$product->created_at->lt(\Carbon\Carbon::now()->subDays(7))) {{ __('routes.NEW') }} @endif
{{ __('routes.QUICK VIEW') }}
@php $defaultVariation = \App\Models\Variation::query() ->where(['product_id' => $product->id, 'is_default' => 1]) ->first(); if (!$defaultVariation) { $defaultVariationImage = $product->getFirstMediaUrl(Helper::PRODUCT_MAIN_IMAGE_COLLECTION, 'preview'); } else { $defaultVariationImage = $defaultVariation->getFirstMediaUrl(Helper::VARIATIONS_COLLECTION, 'preview'); $defaultVariationColor = $defaultVariation->color; } $colors = \App\Models\Variation::query() ->where(['product_id' => $product->id, 'is_default' => false, 'is_show' => true]) ->select('color_id') ->distinct() ->with(['color']) ->get() ->map(function ($item) { return $item->color; }); if (isset($defaultVariationColor)) { $visibleColors = $colors->where('id', '!=', $defaultVariationColor->id)->take(4); } else { $visibleColors = $colors->take(4); } $remainingColorsCount = max(0, $colors->count() - $visibleColors->count()); // حساب عدد الألوان المتبقية @endphp @if (isset($defaultVariationColor)) @endif @foreach ($visibleColors as $color) @endforeach @if ($remainingColorsCount > 1) +{{ $remainingColorsCount }} @endif

{{ str($product->name)->limit(15) }}

@if (auth('web')->check()) @if ($product->isFavoritedByUser(auth('web')->id())) @else @endif @else @endif

{{ Helper::calculatePrice($product->sale_price) }} {{ Helper::currentCurrency()->code }} @if ($product->sale_price !== $product->regular_price) {{ Helper::calculatePrice($product->regular_price) }} @endif