@if (count($relatedProducts) > 0) @php $layout = \Modules\CMS\Entities\Page::firstWhere('default', '1')->layout; $productCard = option($layout . '_template_product', ''); @endphp

{{ __('Related Product') }}

@if(count($relatedProducts) > 6) @endif
@foreach ($relatedProducts as $key => $product) @if($key <= 5) @php $offerFlag = $product->offerCheck(); $outOfStock = $product->isOutOfStock(); $outStock = false; @endphp @if($outOfStock['isApprove'])
@if ($productCard['badge'])
@if($outOfStock['outOfStockVisibility'] == 1) @php $outStock = true @endphp

{{ __('Stock Out') }}

@endif @if(isset($product->featured) && $outStock == false)

{{ __('Featured') }}

@endif @if($product->review_average == 5 && $outStock == false)

{{ __('Top Rated') }}

@endif @if($offerFlag && !$product->isVariableProduct() && $outStock == false)

{{ formatCurrencyAmount($product->getDiscountAmount()) }}% {{ __('off') }}

@endif
@endif {{ __('Image') }}
@if(!$product->isVariableProduct() && $outStock == false && !$product->isExternalProduct() && $productCard['add_to_cart'] && !$product->isGroupedProduct()) code }}>
@endif @php $wishlisted = false; if (auth()->user()) { $wishlisted = $product->isWishlist($product->id, optional(auth()->user())->id); } @endphp @if (preference('wishlist') && $productCard['wishlist'])
@endif @if (preference('compare') && $productCard['compare'])
@endif

{{ __('View') }}

{{ trimWords($product->name, 30) }}

@if ($productCard['price'])
@if($product->isVariableProduct()) @php $filterVariationRelated = $product->filterVariation(); @endphp

{{ formatNumber($filterVariationRelated['min']) }} - {{ formatNumber($filterVariationRelated['max']) }}

@elseif($product->isGroupedProduct()) @php $groupProductPrice = $product->groupProducts() @endphp

{{ formatNumber($groupProductPrice['min']) }} - {{ formatNumber($groupProductPrice['max']) }}

@else

{{ $offerFlag ? formatNumber($product->sale_price) : formatNumber($product->regular_price) }}

@endif
@endif @if ($productCard['review'])
    @for ($i = 1; $i <= 5; $i++) @if (round($product->review_average) >= $i)
  • @else
  • @endif @endfor
@endif
@endif @endif @endforeach
@endif