@props(['product']) {{--
--}} {{-- --}} {{-- @if (isset($product->image))--}} {{-- @if(json_decode($product->image) == '')--}} {{-- ...--}} {{-- @else--}} {{-- @if(count(json_decode($product->image)) > 1)--}} {{-- --}} {{-- @else--}} {{-- @foreach (json_decode($product->image) as $index => $image)--}} {{-- @if(pathinfo($image, PATHINFO_EXTENSION) == 'jpg' ||--}} {{-- pathinfo($image, PATHINFO_EXTENSION) == 'jpeg' ||--}} {{-- pathinfo($image, PATHINFO_EXTENSION) == 'web' ||--}} {{-- pathinfo($image, PATHINFO_EXTENSION) == 'png' )--}} {{-- --}} {{-- @else--}} {{-- --}} {{-- @endif--}} {{-- @endforeach--}} {{-- @endif--}} {{-- @endif--}} {{-- @else--}} {{-- ...--}} {{-- @endif--}} {{-- --}} {{--
--}} {{--
--}} {{-- --}} {{--
{{ substr($product->name, 0, 20) }} {{strlen($product->name) > 20 ? '...' : ''}}
--}} {{--
--}} {{--

--}} {{-- {{ $product->category ? $product->category->name : '' }}--}} {{--

--}} {{--

--}} {{-- {{ $product->avg_rating }} --}} {{-- --}} {{--

--}} {{-- @if($product->discount != '' && $product->discount > 0)--}} {{--
--}} {{--
-{{ $product->discount}}%--}} {{-- {{ $product->tax_inclusive_price }}--}} {{--
--}} {{--
--}} {{-- M.R.P.: {{ $product->mrp }}--}} {{--
--}} {{-- Including of all taxes--}} {{--
--}} {{-- @else--}} {{--
--}} {{--
{{ $product->tax_inclusive_price }}
--}} {{-- Including of all taxes--}} {{--
--}} {{-- @endif--}} {{--
--}} {{-- @if(getStock($product->id) >= 1 || $product->type == 'service')--}} {{-- ADD TO CART--}} {{-- @else--}} {{-- OUT OF STOCK--}} {{-- @endif--}} {{--
--}} {{--
--}} {{--
--}}
@if (isset($product->image)) @if(json_decode($product->image) == '') @php $supported_image = array('jpg','jpeg','web','png'); $ext = strtolower(pathinfo($product->image, PATHINFO_EXTENSION)); @endphp @if(in_array($ext, $supported_image)) ... @endif @else @php $image_type = false; $path = ''; $supported_image = array('jpg','jpeg','web','png'); foreach (json_decode($product->image) as $index => $image){ $ext = strtolower(pathinfo($image, PATHINFO_EXTENSION)); if (in_array($ext, $supported_image) === true){ $path = $index; $image_type = true; break; } } @endphp @if($image_type === true) ... @endif @endif @else ... @endif @if($product->discount != '' && $product->discount > 0)
{{ $product->discount}}% off
@endif