@extends('layout.frontend.master') @php use App\Models\Area; use App\Models\Timeslot; $title = (app()->currentLocale()=='en')?$product->name_en:$product->name_ar; $gallery = ($product->gallery)?explode(',', $product->gallery):''; $weights = json_decode($product->measurements, true); $price = json_decode($product->price, true); $sale_price = json_decode($product->sale_price, true); $quantity = json_decode($product->quantity, true); $dbranch = ''; foreach($pickups as $pickup){ if(session('sel-branch') && session('sel-branch')==$pickup->id){ $bname = $pickup->name; } } if(session('sel-area')){ $selarea = Area::find(session('sel-area')); $selareaname = (app()->currentLocale()=='en')?$selarea->name_en:$selarea->name_ar; } if(session('sel-slot')){ $selslot = Timeslot::find(session('sel-slot')); } @endphp @section('meta-title', 'LEREVE - '.$title) @push('asset-top') @endpush @section('content') @if(!empty($gallery)) @foreach($gallery as $image) @endforeach @endif @if(!empty($gallery)) @foreach($gallery as $image) @endforeach @endif {{$title}} {!! app()->currentLocale()=='en'?substr($product->description_en, 0,20):substr($product->description_ar, 0,20) !!} {{-- @if($sale_price[$weights[0]]) @else @endif --}} @if($product->single_sale_price!=null ) @if($product->single_sale_price < $product->single_price) {{$product->single_sale_price}} KWD{{$product->single_price}} KWD @else {{$product->single_price}} KWD @endif @elseif($product->single_price!=null) {{$product->single_price}} KWD @else @if($sale_price!='null' && $weights!='null' && $weights!=null) @if(array_key_exists($weights[0], $sale_price)) @if($sale_price[$weights[0]]&&$sale_price[$weights[0]] < $price[$weights[0]]) {{$sale_price[$weights[0]]}} KWD{{$price[$weights[0]]}} KWD @else {{$price[$weights[0]]}} KWD @endif @endif @endif {{--{{$price[$weights[0]]}} {{__('KWD')}}--}} @endif {{-- @if(array_key_exists($weights[0], $quantity)) {{(app()->getLocale() == 'en') ? ($quantity[$weights[0]] > 0 ? __('Stock') : __('Out of Stock')) : ($quantity[$weights[0]] > 0 ? __('المخزون') : __('غير متوفر في المخزون'))}} @else {{(app()->getLocale() == 'en') ? __('Out of Stock') : __('غير متوفر في المخزون')}} @endif --}} @if($product->single_quantity) {{(app()->getLocale() == 'en') ? __('Stock') : __('المخزون') }} @else {{(app()->getLocale() == 'en') ? __('Out of Stock') : __('غير متوفر في المخزون')}} @endif @csrf @if($product->preparation_time) {{__('Preparation Time')}} : {{$product->preparation_time.' '.$product->units}} @endif @if($product->show_variation) @if(count($variations)) @foreach($variations as $varid=>$variation) @php $varTitle = (app()->currentLocale()=='en') ? $variation['main']->name_en:$variation['main']->name_ar; $input_type = $variation['main']->input_type; $checkbox_qty = $variation['main']->checkbox_qty; @endphp {{$varTitle}} @if($input_type=='text') (+{{$variation['data'][$varid]['price']}} KWD) @endif @foreach($variation['maindata'] as $valid=>$varval) @php if($input_type!='text'){ $varValTitle = (app()->currentLocale()=='en') ? $varval->name_en:(($varval->name_ar)?$varval->name_ar:$varval->name_en); $varValPrice = ($variation['data'][$valid]['price']) ? $variation['data'][$valid]['price'] : 0; $varValSPrice = $variation['data'][$valid]['sale_price']; $varValQty = $variation['data'][$valid]['quantity']; $input_name = ($input_type=='checkbox') ? 'variation['.$varid.'][]' : 'variation['.$varid.']'; } else { $varValTitle = $varTitle; $varValPrice = ($variation['data'][$varid]['price']) ? $variation['data'][$varid]['price'] : 0; $varReq = (array_key_exists('text_req', $variation['data'][$varid])) ? $variation['data'][$varid]['text_req']:0; $input_name = 'variation['.$varid.']'; } @endphp @if($input_type == 'text') @else {{$varValTitle}} @if($input_type == 'checkbox') @if($varValSPrice) (+{{$varValSPrice}} KWD{{$varValPrice}} KWD) @else (+{{$varValPrice}} KWD) @endif @endif @error('variation') {{$message}} @enderror @if($checkbox_qty=='on') @endif @endif @endforeach @endforeach @endif @endif @if($weights) {{ app()->currentLocale() == 'en' ? $category->name_en : $category->name_ar}} {{__('Weight')}} @if($weights) @foreach($weights as $weight) {{$weight}} @endforeach @endif @error('weight') {{$message}} @enderror @endif {{__('Select Delivery/Pickup')}} @if(session('deliveryType')) {{': '.session('deliveryType')}} @endif {{ __('Select Delivery/Pickup') }} {{__('Delivery')}} {{__('Pickup')}} {{__('Submit')}} @error('deliveryType') {{$message}} @enderror {{-- all())) style="display: none;" @endif> @if(count($pickups)==0) {{__('No Branch Available')}} @else {{__('Select Area')}} @if(session('sel-branch')) : {{$bname}} @endif {{ __('Select Pickup Branch') }} @foreach($pickups as $key=>$branch) store_busy) class="hide-store" @endif > id) ? 'checked' : ((!session('sel-branch') && $key==0 && $branch->store_busy==0)?'checked':'') }} {{($key==0 && $branch->store_busy==0)?'checked':''}} data-name="{{$branch->name}}" data-id="{{$branch->id}}" value="{{$branch->id}}"> {{$branch->name}} @endforeach {{__('Submit')}} @error('branch') {{$message}} @enderror @endif --}} @if(count($areas)==0) {{__('No Area Available')}} @else {{-- {{__('Select Area')}} @if(session('sel-area')) : {{$selareaname}} @endif {{ __('Select Your Delivery Area') }} currentLocale() == 'en' ? "dir='rtl'":''}}> @foreach($areas as $branch => $narea) @foreach($narea as $key => $area) @if($key == 0 && $dbranch == '') @php $dbranch = $branch; @endphp @endif @if($area) @php // Extract the area name based on the locale if(app()->currentLocale() == 'en') { $aname = $area->name_en; } else { $aname = $area->name_ar; } @endphp {{$aname}} @endif @endforeach @endforeach {{__('Submit')}} @error('area') {{$message}} @enderror --}} {{-- {{__('Select Delivery date')}} @if(session('sel-date')) : {{session('sel-date')}} @endif {{__('Select Your Delivery date')}} @for($i = 0; $i < 4; $i++) {{ date('l, d, M', strtotime('+' . ($i) . ' day')) }} @endfor {{__('Submit')}} @error('del_date') {{$message}} @enderror --}} {{-- {{__('Select Delivery Time')}} @if(session('sel-slot')) : {{__('Between')}} {{date('h:i A', strtotime($selslot->start))}} {{__('To')}} {{date('h:i A', strtotime($selslot->end))}} @endif {{__('Select Delivery Time')}} @php $day = date('l', strtotime('+1 day')); @endphp @if(count($slots)) @foreach($slots as $i=>$slot) {{__('Between')}} {{date('h:i A', strtotime($slot->start))}} {{__('To')}} {{date('h:i A', strtotime($slot->end))}} @endforeach @else {{__('No Slots available')}} @endif {{__('Submit')}} @error('slot') {{$message}} @enderror --}} @endif {{__('Card message')}} {{__('Write Your Message')}} {{__('Submit')}} @if($product->show_addon) {{__('Add to Cart')}} @else {{__('Add to Cart')}} @endif {{__('General Info')}} {!! app()->currentLocale()=='en'?$product->description_en:$product->description_ar !!} {{__('Add on something to make it extra special!')}} @if($product->addon_val!=null && $product->addon_val!='null') @php $vals = json_decode($product->addon_val, true); @endphp @foreach($addons as $akey=>$addon) @if(in_array($addon['main']['id'], $vals)) @php $input = $addon['main']['input_type']; @endphp {{(app()->currentLocale()=='en')?$addon['main']['name_en']:$addon['main']['name_ar']}} ({{__('You can select')}}@if($input=='radio') {{__('only one')}} @else {{__('multiple')}} @endif ) @foreach($addon['value'] as $avkey=>$value) @if($value->thumbnail) @else @endif {{(app()->currentLocale()=='en')?$value->name_en:$value->name_ar}} {{$value->price}} {{__('KWD')}} @endforeach @endif @endforeach @endif {{__('You Might Also Like')}} @foreach($recommended as $product) @if($product->single_sale_price) @php $percent = (($product->single_price-$product->single_sale_price)/$product->single_price) * 100; $percent = ceil($percent); @endphp @endif @php $percent = (($product->single_price-$product->single_sale_price)/$product->single_price) * 100; $percent = ceil($percent); $weights = json_decode($product->measurements, true); @endphp @if($percent) {{$percent}}% {{__('OFF')}} @endif {{ (app()->getlocale()=='en') ? $product->name_en : $product->name_ar }} @if($product->single_sale_price < $product->single_price && $product->single_sale_price!='null' && $product->single_sale_price!=null) {{$product->single_sale_price}} {{__('KWD')}} {{$product->single_price}} {{__('KWD')}} @else {{$product->single_price}} {{__('KWD')}} @endif {{-- @if(count($weights)>1) {{__('Select Options')}} @else {{__('Add To Cart')}} @endif --}} @endforeach {{__('Keep Browsing')}} @foreach($categories as $category) {{(app()->currentLocale()=='en')?$category->name_en:$category->name_ar}} {{__('Shop Now')}} @endforeach @if(Auth::check()) {{__('Rate this ')}}{{(app()->currentLocale()=='en')?$product->name_en:$product->name_ar}} @csrf {{__('Submit')}} @endif {{-- @if(count($review) > 0) @foreach($review as $review) {{$review->rating}} {{$review->review}} @endforeach @endif --}} @endsection @push('asset-bottom') @endpush
{!! app()->currentLocale()=='en'?substr($product->description_en, 0,20):substr($product->description_ar, 0,20) !!}
{!! app()->currentLocale()=='en'?$product->description_en:$product->description_ar !!}