@extends('admin.layout') @section('content')

{{ translate('Product') }}

@forelse ($product->productAttach as $key => $photo) @if ($key == 0)
@else
@endif @empty @endforelse
@php $qty = 0; if ($product->variant_product) { foreach ($product->stocks as $key => $stock) { $qty += $stock->qty; } } else { $qty = $product->current_stock; } @endphp

{{ $product->getTranslation('title') }}

@for ($i = 0; $i < $product->review->avg('rate'); $i++) @endfor @for ($i = 0; $i < 5 - $product->review->avg('rate'); $i++) @endfor

@if (roundNumberMaxHalf(explode('-', homeDiscountedPrice($product->id))[0]) == roundNumberMaxHalf(explode('-', homeDiscountedPrice($product->id))[1])) {{ roundNumberMaxHalf(explode('-', homeDiscountedPrice($product->id))[0]) }} {{ currency_sympol()['symbol'] }} @else {{ roundNumberMaxHalf(explode('-', homeDiscountedPrice($product->id))[0]) }} / {{ roundNumberMaxHalf(explode('-', homeDiscountedPrice($product->id))[1]) }} {{ currency_sympol()['symbol'] }} @endif {{-- $540 50% off --}}

@if ($product->advanced_product == 'normal_product' || $product->advanced_product == 'advanced_product' || $product->advanced_product == 'restorants')
@if ($qty > 0) {{ translate('Available quantity') }} {{ $qty }} {{ translate('Pieces') }} @else {{ translate('Out of stock') }} {{ $qty }} {{ translate('Pieces') }} @endif

@elseif($product->advanced_product == 'digital_cards') @if ($product->digitalCards->where('used_card', 0)->count() > 0) {{ translate('Available quantity') }} {{ $product->digitalCards->where('used_card', 0)->count() }} {{ translate('Cards') }} @else {{ translate('Out of stock') }} {{ $product->digitalCards->where('used_card', 0)->count() }} {{ translate('Cards') }} @endif @endif

{{ $product->getTranslation('short_desc') }}



@csrf
@isset(json_decode($product->colors)[0])
{{ translate('Color') }}
    @foreach (json_decode($product->colors) as $key => $color)
  • @endforeach
@endisset @if ($product->choice_options != null) @foreach ($product->choice_options as $key => $choice)
{{ $choice['title'] }}:
@foreach ($choice['options'] as $key => $value)
@endforeach
@endforeach @endif
@if ($product->advanced_product == 'normal_product' || $product->advanced_product == 'advanced_product' || $product->advanced_product == 'restorants')

{{ translate('Available quantity') }}

@if ($qty > 0)

{{ $qty }}

{{ translate('Pieces') }}

@else {{ translate('Out of Stock') }} @endif

{{ translate('Amount') }}

{{ currency_sympol()['symbol'] }}

@endif
@if ($product->getTranslation('serialized_specs') != null || $product->country != null)

{{ translate('Specs') }}

@isset($product->country)
{{ translate('Country') }}:
{{ $product->country ? $product->country->getTranslation('title') : '' }}
@endisset @forelse (json_decode($product->getTranslation('serialized_specs')) as $key => $item)
{{ $key }} :
{{ $item }}
@empty @endforelse
@endif

{{ translate('Reviews') }}

@forelse ($reviews as $key => $review)
{{ $review->user->name }}
@for ($i = 0; $i < $review->rate; $i++) @endfor @for ($i = 0; $i < 5 - $review->rate; $i++) @endfor

{{ $review->review }}


@empty @endforelse
@endsection @section('script') @endsection