@php $thumb = $product->thumbnailUrl(); $hover = $product->hoverImageUrl(); $title = ___($product, 'title') ?: ($product->page_title ?: __('alts.product')); $url = $product->url(); $pivot = $product->categories->first(); $category = $pivot?->category; $categoryTitle = $category ? ___($category, 'title') : ''; $categoryUrl = $category ? __url('/shop') . '?category=' . urlencode($category->slug ?: (string) $category->id) : $url; $excerpt = \Illuminate\Support\Str::limit(trim(strip_tags((string) ___($product, 'description'))), 160); $hasDiscount = (int) $product->discount > 0 || ((int) $product->original_price > 0 && (int) $product->original_price > (int) $product->price); $soldOut = $product->isSoldOut(); $comingSoon = (int) $product->stage === \App\Models\Products::STAGE_COMING_SOON; @endphp
@if($thumb) {{ $title }} @if($hover) @endif @endif
@if($product->isNew())
{{ __('public.shop.new') }}
@endif @if($hasDiscount && !$soldOut)
@if((int) $product->discount > 0) {{ (int) $product->discount }}% @else {{ __('public.shop.sale') }} @endif
@endif @if($soldOut)
{{ __('public.shop.sold_out') }}
@elseif($comingSoon)
{{ __('public.shop.coming_soon') }}
@endif
@if($soldOut || $comingSoon) {{ __('public.shop.view_product') }} @else @endif
@if($categoryTitle) @endif
{{ $title }}
{{ money($product->price) }} @if((int) $product->original_price > (int) $product->price) {{ money($product->original_price) }} @endif
@if($thumb) {{ $title }} @if($hover) @endif @endif
@if($product->isNew())
{{ __('public.shop.new') }}
@endif @if($hasDiscount && !$soldOut)
@if((int) $product->discount > 0) {{ (int) $product->discount }}% @else {{ __('public.shop.sale') }} @endif
@endif
@if($soldOut || $comingSoon) {{ __('public.shop.view_product') }} @else @endif
@if($categoryTitle) @endif
{{ $title }}
{{ money($product->price) }} @if((int) $product->original_price > (int) $product->price) {{ money($product->original_price) }} @endif
@if($excerpt)

{{ $excerpt }}

@endif