Current File : /home/tradevaly/demo.tradevaly.com.bd/resources/views/frontend/single-product.blade.php
@extends('layouts.frontend')
    @section('content') 
            <div class="inner-page-banner heading-title-behind text-center">
              <div class="heading heading-style-title-behind mb-0">
                <div class="heading-title-wrapper">
                  <span>Product Details</span>
                  <h1 class="text-white heading-title h2 font-weight-semibold">Product Details</h1>
                  <ul class="po-bread breadcrumb justify-content-center fadeInUp animated" data-animate="fadeInUp">
                    <li class="breadcrumb-item"><a href="{{ url('/') }}">Home</a></li>
                    
                    @if( array_key_first($category) )
                        <li class="breadcrumb-item"><a href="{{ url('product-list-by-category/'.array_key_first($category)) }}">{{  reset($category) }}</a></li>
                    @endif

                    @if( array_key_last($category) )
                        <li class="breadcrumb-item"><a href="{{ url()->previous() }}">{{  end($category) }}</a></li>
                    @endif

                    <li class="breadcrumb-item">{{ !empty($data[0]['product_name']) ? $data[0]['product_name'] : '' }}</li>

                  </ul>
                </div>
              </div>
            </div>
            <div id="wrapper-content" class="page-shop page-single-product wrapper-content pt-7 pb-19">
                <div class="container">
                    <div class="page-container">
                        <div class="product single-product row">
                            <div class="product-images col-lg-8 d-flex mb-5 mb-lg-0">
                                <div class="slick-slider slider-nav slider-vertical" data-slick-options='{"slidesToShow": 4,"autoplay":true,"dots":false,"arrows":false,"vertical":true,"verticalSwiping":true,"asNavFor": ".slider-for","focusOnSelect": true,"responsive":[{"breakpoint": 768,"settings": {"vertical":false,"verticalSwiping":true}}]}'>
                                    
                                @if( !empty($galleries) )
                                    @foreach($galleries as $value )
                                        <div class="box">
                                            <img src="{{ asset('storage/app/public/products/product_image_gallery/'.$value) }}" alt="Gallery 01">
                                        </div>
                                    @endforeach
                                @endif

                                </div>

                                <div class="slick-slider slider-for slider-vertical" data-slick-options='{"slidesToShow": 1,"autoplay":false,"dots":false,"arrows":false,"asNavFor": ".slider-nav","vertical":true,"verticalSwiping":true,"responsive":[{"breakpoint": 768,"settings": {"vertical":false,"verticalSwiping":false}}]}'>
                                @if( !empty($galleries) )
                                    @foreach($galleries as $value )
                                            <div class="box">
                                                <div class="image"> <img src="{{ asset('storage/app/public/products/product_image_gallery/'.$value) }}" alt="Gallery 01">
                                                </div>
                                            </div>
                                        @endforeach
                                    @endif
                                </div>
                            </div>
                            <div class="product-details col-lg-4">
                                <div class="font-size-h5 text-dark lh-1625">{{ !empty($data[0]['product_name']) ? $data[0]['product_name'] : '' }}</div>
                                <div class="author-rate d-flex mb-0"> 
                                    <span class="rate-item">
                                        <i class="color-rgange fa fa-star" aria-hidden="true"></i>
                                    </span> 
                                    <span class="rate-item">
                                        <i class="color-rgange fa fa-star" aria-hidden="true"></i>
                                    </span> 
                                    <span class="rate-item">
                                        <i class="color-rgange fa fa-star" aria-hidden="true"></i>
                                    </span> 
                                    <span class="rate-item">
                                        <i class="color-rgange fa fa-star" aria-hidden="true"></i>
                                    </span> 
                                    <span class="rate-item">
                                        <i class="color-rgange fa fa-star" aria-hidden="true"></i>
                                    </span> 
                                    
                                    <span class="d-inline-block ml-2 text-gray">3 customer reviews</span> 
                                </div>
                                
                                <div class="mb-3"> 
                                    <span class="text-gray d-inline-block mr-1">Price: </span> 
                                    
                                    @if( !empty($data[0]['product_price']))

                                        @if( $data[0]['product_price'][0]['price_type'] == 1 && !empty($data[0]['product_price'][0]['net_price']) ) 
                                                                        
                                            @if( !empty($data[0]['product_price'][0]['offcer_price']) )
                                                <span class="te xt-dark text-decoration-line-through">
                                                    {{ $data[0]['product_price'][0]['regular_price'] }}.00</span> <br/>
                                            
                                                <span class="text-danger">
                                                    {{ !empty($countryCurrencyOnly[$data[0]['product_price'][0]['country_id']]) ? $countryCurrencyOnly[$data[0]['product_price'][0]['country_id']] : ''}}
                                                    {{ !empty($v['product_price'][0]['net_price']) ?  $v['product_price'][0]['net_price'] : '' }}.00</span> 
                                                
                                            @else
                                                <span class="text-danger">
                                                {{ !empty($countryCurrencyOnly[$data[0]['product_price'][0]['country_id']]) ? $countryCurrencyOnly[$data[0]['product_price'][0]['country_id']] : ''}}
                                                    
                                                {{$data[0]['product_price'][0]['net_price']}}.00</span> 
                                            @endif
                                        
                                        @elseif( $data[0]['product_price'][0]['price_type'] == 2 )

                                            @if( !empty($data[0]['product_price'][0]['from_price'] && $data[0]['product_price'][0]['to_price'] ) )
                                                <span class="text-danger">
                                                {{ !empty($countryCurrencyOnly[$data[0]['product_price'][0]['country_id']]) ? $countryCurrencyOnly[$data[0]['product_price'][0]['country_id']] : ''}}
                                                    
                                                    
                                                {{$data[0]['product_price'][0]['from_price']}}.00-{{$data[0]['product_price'][0]['to_price']}}.00</span> 
                                            @endif

                                        @elseif( $data[0]['product_price'][0]['price_type'] == 3 )
                                            <span class="text-danger">Negotiable</span> 
                                        @endif

                                    @endif

                                </div>
                                
                                <div class="border-top mb-3 pt-5">
                                    
                                    @if( !empty($company->company_name) )
                                        <div class="d-flex"> 
                                            <span class="text-gray d-inline-block mr-1">Posted By: </span> 
                                            <a href="{{ url('company-profile/'.$company->id) }}" class="link-hover-dark-primary">{{ $company->company_name }}</a> 
                                        </div>
                                    @endif
                                    
                                   
                                    @if( !empty($unit->name) )
                                        <div class="d-flex"> 
                                            <span class="text-gray d-inline-block mr-1">Product Unit: </span> 
                                            <span class="text-dark"> {{  $unit->name  }}</span> 
                                        </div>
                                    @endif

                                    @if( !empty($data[0]['product_inventory'][0]['minimum_order']) )
                                        <div class="d-flex"> 
                                            <span class="text-gray d-inline-block mr-1">Minimum Order: </span> 
                                            <span class="text-dark"> {{   $data[0]['product_inventory'][0]['minimum_order'].' '.  $unit->name   }}</span> 
                                        </div>
                                    @endif


                                    @if( !empty($data[0]['product_inventory'][0]['inventory_status']) )
                                        <div class="d-flex"> 
                                            <span class="text-gray d-inline-block mr-1">In Stock: </span> 
                                            <span class="text-dark"> {{   $data[0]['product_inventory'][0]['inventory_status'].' '.  $unit->name   }}</span> 
                                        </div>
                                        @else
                                        <div class="d-flex"> 
                                            <span class="text-gray d-inline-block mr-1">In Stock: </span> 
                                            <span class="text-dark"> Available </span> 
                                        </div>
                                    @endif
                                    
                                    @if( !empty($color) )
                                        <div class="d-flex"> 
                                            <span class="text-gray d-inline-block mr-1">Available Color: </span> 
                                            <span class="text-dark">{{ implode(', ', $color); }}</span> 
                                        </div>
                                    @endif
                                    
                                    @if( !empty($size) )
                                        <div class="d-flex"> 
                                            <span class="text-gray d-inline-block mr-1">Size: </span> 
                                                <span class="text-dark">{{ implode(', ', $size); }}</span> 
                                        </div>
                                    @endif 
                    
                                    
                                    @if( !empty($country) )
                                        <div class="d-flex"> 
                                            <span class="text-gray d-inline-block mr-1">Country of Origin: </span> 
                                            <span class="text-dark"><span class="flag-icon flag-icon-{{ $country->flag }}"></span> {{ $country->name }}</span> 
                                        </div>
                                    @endif

                                    <!-- <div class="d-flex"> <span class="text-gray d-inline-block mr-1">Brand: </span> 
                                    <a href="#" class="link-hover-dark-primary d-inline-block mr-1">tshirt, </a> 
                                    <a href="#" class="link-hover-dark-primary d-inline-block mr-1">pattern, </a> 
                                    <a href="#" class="link-hover-dark-primary">man</a> 
                                    </div> -->
                                    
                                    @if( !empty($data[0]->tentitive_delivery_days ) )
                                        <div class="d-flex"> 
                                            <span class="text-gray d-inline-block mr-1">Tentative Delivery Days: </span> 
                                            <span class="text-dark">{{$data[0]->tentitive_delivery_days}} Days</span> 
                                        </div>
                                    @endif

                                    @if( !empty($data[0]->productInventory ))
                                        @if( !empty($data[0]->productInventory[0]->inventory_status) )
                                            <div class="d-flex"> 
                                                <span class="text-gray d-inline-block mr-1">Stock Status: </span> 
                                                <span class="text-dark">{{ $data[0]->productInventory[0]->inventory_status }} {{ !empty($unit->name) ? $unit->name : '' }}</span> 
                                            </div>
                                        @endif 
                                    @endif 

                                    @if( !empty($data[0]->productInventory ))
                                        @if( !empty($data[0]->productInventory[0]->minimum_order) )
                                        
                                            <div class="d-flex"> 
                                                <span class="text-gray d-inline-block mr-1">Minimum Order: </span> 
                                                <span class="text-dark">{{ $data[0]->productInventory[0]->minimum_order }} {{ !empty($unit->name) ? $unit->name : '' }}</span> 
                                            </div>
                                        @endif 
                                    @endif 


                                    @if( !empty($category) )
                                    <div class="d-flex"> 
                                        <span class="text-gray d-inline-block mr-1">Categories: </span> 
                                            <span class="text-dark">{{ implode(', ', $category); }}</span> 
                                    </div>
                                    @endif 

                                </div>
                                
                               <!--  <div class="card p-4 widget border-0 gallery bg-gray-06 rounded-0 mb-4">
                                  <div class="card-title d-flex mb-0 font-size-md font-weight-semibold text-dark text-uppercase border-bottom pb-2 lh-1"> <span class="text-secondary mr-2"> <i class="far fa-images"></i> </span> <span> photo gallery</span> </div>
                                  <div class="card-body px-0 pt-3 pb-0">
                                    <div class="photo-gallery d-flex flex-wrap justify-content-between"> <a href="{{ asset('public/frontend/images/shop/full-top-store-1.jpg')}}" class="photo-item" data-gtf-mfp="true" data-gallery-id="01"> <img src="{{ asset('public/frontend/images/listing/gallery-05.jpg')}}" alt="Gallery 05"> </a> <a href="{{ asset('public/frontend/images/listing/full-gallery-06.jpg')}}" class="photo-item" data-gtf-mfp="true" data-gallery-id="01"> <img src="{{ asset('public/frontend/images/listing/gallery-06.jpg')}}" alt="Gallery 06"></a> <a href="{{ asset('public/frontend/images/listing/full-gallery-07.jpg')}}" class="photo-item" data-gtf-mfp="true" data-gallery-id="01"> <img src="{{ asset('public/frontend/images/listing/gallery-07.jpg')}}" alt="Gallery 07"></a> </div>
                                  </div>
                                </div> -->

                                @if( !empty($data[0]->productPrice ))

                                    @if( $data[0]->productPrice[0]->price_type ==1  )
                                            
                                        <form>
                                            <div class="form-add-cart d-flex flex-wrap flex-sm-nowrap mb-3">
                                                <div class="input-group align-items-center flex-nowrap col-sm-4 px-3"> <a href="#" class="input-group-prepend"><i class="fal fa-minus"></i></a>
                                                    <input type="text" class="form-control bg-transparent border-0 text-center" value="02"> <a href="#" class="input-group-append text-decoration-none"><i class="fal fa-plus"></i></a> </div>
                                                <div class="button-add-cart pl-0 pl-sm-5">
                                                    <button class="btn btn-primary text-uppercase btn-block font-size-md rounded-0"> Add To Cart </button>
                                                </div>
                                            </div>
                                        </form>
                                    
                                    @else

                                        <!-- <form>
                                            <div class="form-add-cart d-flex flex-wrap flex-sm-nowrap mb-3">
                                            <div class="button-add-cart pl-0 pl-sm-8" style="padding-left: 0px !important;">
                                                    <button type="button" class="btn btn-primary text-uppercase btn-block font-size-md rounded-0 send-query"> Send Query </button>
                                                </div>
                                            </div>
                                        </form> -->

                                    @endif
                                @endif
                               
                            
                                @if( !empty( $data[0]['youtube_video']) )
                                    <div class="card p-4 widget border-0 gallery bg-gray-06 rounded-0 mb-4">
                                    <div class="card-title d-flex mb-0 font-size-md font-weight-semibold text-dark text-uppercase border-bottom pb-2 lh-1"> <span class="text-secondary mr-2"> <i class="fa fa-file-video" aria-hidden="true"></i> </span> 
                                    <span>Products Video</span> </div>
                                    <div class="card-body px-0 pt-3 pb-0">
                                        <div class="photo-gallery d-flex flex-wrap justify-content-between">
                                            <iframe width="100%" height="200" src="https://www.youtube.com/embed/{{ $data[0]['youtube_video'] }}?autoplay=1&mute=1" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
                                        </div>
                                    </div>
                                    </div>
                                @endif

                                <!-- <div class="social-icon light-color">
                                    <ul class="list-inline text-left">
                                        <li class="mr-1 list-inline-item">
                                            <a target="_blank" title="Twitter" href="#"> <i class="fab fa-twitter">
                                             </i> <span>Twitter</span> </a>
                                        </li>
                                        <li class="list-inline-item">
                                            <a target="_blank" title="Facebook" href="#"> <i class="fab fa-facebook-f">
                                            </i> <span>Facebook</span> </a>
                                        </li>
                                    </ul>
                                </div> -->
                            </div>
                        </div>
                        <div class="mb-8 mt-5">
                            <div class="collapse-tabs">
                                <div class="my-tab tabs pb-3 mb-0 border-bottom d-none d-sm-block">
                                    <ul class="nav nav-pills tab-style-01 text-capitalize fs-20 justify-content-center" role="tablist">
                                        
                                        @if( !empty($data[0]['description']) )
                                            <li class="nav-item"> <a class="nav-link active" id="description-tab" data-toggle="tab" href="#description" role="tab" aria-controls="description" aria-selected="true">Description</a> </li>
                                        @endif
                                        <!-- <li class="nav-item"> <a class="nav-link" id="addition-info-tab" data-toggle="tab" href="#addition-info" role="tab" aria-controls="addition-info" aria-selected="false">Addition Information</a> </li>           
                                         -->

                                         
                                        @if( !empty($data[0]['tds_file']) && $data[0]['tds_showable'] ==1 ) 
                                            <li class="nav-item"> <a class="nav-link" id="tsd-tab" data-toggle="tab" href="#tsd" role="tab" aria-controls="tsd" aria-selected="false">TDS File</a> </li>
                                        @endif
                                        
                                        @if( !empty($data[0]['catelog_file']) && $data[0]['catelog_showable'] ==1 )
                                            <li class="nav-item"> <a class="nav-link" id="catalog-tab" data-toggle="tab" href="#catalog" role="tab" aria-controls="catalog" aria-selected="false">Catalog File</a> </li>
                                        @endif

                                        <li class="nav-item"> <a class="nav-link" id="query-tab" data-toggle="tab" href="#query" role="tab" aria-controls="query" aria-selected="false">Inquiry Now</a> </li>
                                        <li class="nav-item"> <a class="nav-link" id="review-tab" data-toggle="tab" href="#review" role="tab" aria-controls="review" aria-selected="false">Reviews (3)</a> </li>
                                    </ul>
                                </div>
                                <div class="bg-gray-02 tab-content py-7">
                                    <div id="collapse-tabs-accordion">

                                        @if( !empty(!empty( $data[0]['description'] )))
                                            
                                            <div class="tab-pane fade show active px-0 px-md-8 mb-4 mb-sm-0" id="description" role="tabpanel" aria-labelledby="description-tab">
                                                <div class="card bg-transparent mb-4 mb-sm-0">
                                                    <div class="card-header d-block d-sm-none bg-transparent px-0 py-1" id="headingDescription">
                                                        <h5 class="mb-0">
                                                            <button class="btn font-size-h5 btn-block" data-toggle="collapse" data-target="#description-collapse" aria-expanded="true" aria-controls="description-collapse">
                                                            Description
                                                            </button>
                                                            </h5> </div>
                                                    <div id="description-collapse" class="collapse show collapsible" aria-labelledby="headingDescription" data-parent="#collapse-tabs-accordion">
                                                        <div class="card-body p-sm-0 border-sm-0">
                                                            <div class="lh-lg text-center">
                                                                <p class="mb-6"> 
                                                                    {!! !empty( $data[0]['description'] ) ? $data[0]['description'] : '' !!}
                                                                </p>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>

                                        @endif

                                        <div class="tab-pane fade px-0 px-md-8 mb-4 mb-sm-0" id="addition-info" role="tabpanel" aria-labelledby="addition-info-tab">
                                            <div class="card bg-transparent mb-4 mb-sm-0">
                                                <div class="card-header d-block d-sm-none bg-transparent px-0 py-1" id="headingAdditonInfo">
                                                    <h5 class="mb-0">
                                                        <button class="btn font-size-h5 btn-block collapsed" data-toggle="collapse" data-target="#addition-info-collapse" aria-expanded="true" aria-controls="description-collapse">
                                                        Addition Information
                                                        </button>
                                                        </h5> </div>
                                                <div id="addition-info-collapse" class="collapse collapsible" aria-labelledby="headingAdditonInfo" data-parent="#collapse-tabs-accordion">
                                                    <div class="card-body p-sm-0 border-sm-0"> </div>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="tab-pane fade px-0 px-md-8 mb-4 mb-sm-0" id="review" role="tabpanel" aria-labelledby="review-tab">
                                            <div class="card bg-transparent mb-4 mb-sm-0">
                                                <div class="card-header d-block d-sm-none bg-transparent px-0 py-1" id="headingReview">
                                                    <h5 class="mb-0">
                                                            <button class="btn font-size-h5 btn-block collapsed" data-toggle="collapse" data-target="#review-collapse" aria-expanded="true" aria-controls="description-collapse">
                                                            Reviews (3)
                                                            </button>
                                                            </h5> </div>
                                                <div id="review-collapse" class="collapse collapsible" aria-labelledby="headingReview" data-parent="#collapse-tabs-accordion">
                                                    <div class="card-body p-sm-0 border-sm-0"> 
                                                            <form>
                            
                                                            <div class="rate mb-3">
                                                                    <input type="radio" id="star5" name="rate" value="5">
                                                                    <label for="star5" title="text">5 stars</label>
                                                                    <input type="radio" id="star4" name="rate" value="4">
                                                                    <label for="star4" title="text">4 stars</label>
                                                                    <input type="radio" id="star3" name="rate" value="3">
                                                                    <label for="star3" title="text">3 stars</label>
                                                                    <input type="radio" id="star2" name="rate" value="2">
                                                                    <label for="star2" title="text">2 stars</label>
                                                                    <input type="radio" id="star1" name="rate" value="1">
                                                                    <label for="star1" title="text">1 star</label>
                                                                  </div>
                                                                <textarea class="form-control" name="txtarea" cols="30" rows="5" placeholder="Write Here....."></textarea><br>
                                                                <a href="#" class="btn btn-sm px-7 text-white btn-animated">Submit</a>
                                                            </form>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                        @if( !empty($data[0]['tds_file']) && $data[0]['tds_showable'] ==1 ) 
                                            <div class="tab-pane fade px-0 px-md-8 mb-4 mb-sm-0" id="tsd" role="tabpanel" aria-labelledby="tsd-tab">
                                                <div class="card bg-transparent mb-4 mb-sm-0">
                                                    
                                                    <div id="review-collapse" class="collapse collapsible" aria-labelledby="headingReview" data-parent="#collapse-tabs-accordion">
                                                        <div class="card-body row p-sm-0 border-sm-0"> 
                                                            <div class="col-md-12">
                                                                <embed src="{{ asset('storage/app/public/products/tds_file/'.$data[0]['tds_file']) }}" type="application/pdf"  frameBorder="0" scrolling="auto" height="500"    width="100%" ></embed>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        @endif

                                        @if( !empty($data[0]['catelog_file'])  && $data[0]['catelog_showable'] ==1  )
                                            <div class="tab-pane fade px-0 px-md-8 mb-4 mb-sm-0" id="catalog" role="tabpanel" aria-labelledby="catalog-tab">
                                                <div class="card bg-transparent mb-4 mb-sm-0">
                                                    
                                                    <div id="review-collapse" class="collapse collapsible" aria-labelledby="headingReview" data-parent="#collapse-tabs-accordion">
                                                        <div class="card-body row p-sm-0 border-sm-0"> 
                                                            <div class="col-md-12">
                                                                <embed src="{{ asset('storage/app/public/products/catelog_file/'.$data[0]['catelog_file']) }}" type="application/pdf"    frameBorder="0" scrolling="auto" height="500"    width="100%" ></embed>
                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        @endif

                                        <div class="tab-pane fade px-0 px-md-8 mb-4 mb-sm-0" id="query" role="tabpanel" aria-labelledby="query-tab">
                                            <div class="card bg-transparent mb-4 mb-sm-0">
                                                <div id="review-collapse" class="collapse collapsible" aria-labelledby="headingReview" data-parent="#collapse-tabs-accordion">
                                                    <div class="card-body p-sm-0 border-sm-0"> 
                                                            
                                                            <h4 style="color:#F49902 ">Contact Supplier</h4>

                                                            <div class="row"  style="margin-top:20px">
                                                                    
                                                                    @if( !empty($data[0]['feature_product_image']) )
                                                                    <div class="col-md-1">
                                                                            <img src="{{ asset('storage/app/public/products/product_feature_image/'.!empty($data[0]['feature_product_image']) ? $data[0]['feature_product_image'] : '') }}" alt="Product Image" style="border:1px solid #ccc">
                                                                    </div>
                                                                    @endif

                                                                    <div class="col-md-8" style="padding-left:0px">
                                                                            <h5>{{ !empty($data[0]['product_name']) ? $data[0]['product_name'] : '' }}</h5>
                                                                            <p class="small-ligh-text">{{ !empty($company->company_name) ? $company->company_name : '' }}</p>
                                                                            
                                                                            <div style="margin-top:-24px">

                                                                                <span class="flag-icon flag-icon-{{ !empty($country->flag) ? $country->flag : '' }}"></span> 
                                                                                <span class="small-ligh-text">{{ !empty($country->name) ? $country->name : '' }}</span> 
                                                                              
                                                                            </div>
                                                                    </div>
                                                            </div>

                                                            <br/>
                                                            <div class="alert alert-danger print-error-msg" style="display:none">
                                                                                    
                                                                <ul  style="margin:0"></ul>

                                                            </div>

                                                            {!! Form::open(array('route' => 'abouts.store', 'method'=>'POST', 'id' => 'form', 'enctype'  => 'multipart/form-data')) !!}
                            
                                                                <div class="form-row" style="margin-top:20px">
                                                                  
                                                                    <div class="mb-2 form-group col-md-12">
                                                                        <div class="input-group mb-1">
                                                                        {!! Form::text('subject', !empty($data[0]['product_name']) ? 'Inquiry About '.$data[0]['product_name'] : '' , array('placeholder' => '', 'id' => 'subject', 'class' => 'form-control-sm form-control subject', 'placeholder' => "Enter your subject")) !!}
                                        
                                                                       </div>
                                                                    </div><!-- form-group col-md-6 -->  
                                                                    
                                                                    <div class="mb-2 form-group col-md-12">
                                                                        <div class="input-group mb-1">
                                                                        <div class="input-group-sm input-group-prepend">
                                                                            <div class="py-0 input-group-text"><i class="fa fa-address-card" aria-hidden="true"></i></div>
                                                                        </div>
                                                                        {!! Form::text('name', null, array('placeholder' => '', 'id' => 'name', 'class' => 'form-control-sm form-control name detect-common', 'placeholder' => "Enter your full name")) !!}
                                                                        </div>
                                                                    </div><!-- form-group col-md-6 -->  

                                                                  <div class="mb-2 form-group col-md-6">
                                                                    <div class="input-group mb-1">
                                                                      <div class="input-group-sm input-group-prepend">
                                                                        <div class="py-0 input-group-text"><span class="flag-icon flag-icon-{{ !empty($queryCountryInfo[0]->flag) ? $queryCountryInfo[0]->flag : '' }}"></span> </div>
                                                                      </div>

                                                                      {!! Form::text('mobile', !empty($queryCountryInfo[0]->calling_code) ? $queryCountryInfo[0]->calling_code : '', array('placeholder' => '',  'id' => 'mobile', 'class' => 'form-control-sm form-control mobile detect-common', 'placeholder' => 'Enter your cell phone number')) !!}
                                        
                                                                    </div>
                                                                  </div><!-- form-group col-md-6 -->
                                                                  <div class="mb-2 form-group col-md-6">
                                                                    
                                                                    <div class="input-group mb-1">
                                                                      <div class="input-group-sm input-group-prepend">
                                                                        <div class="py-0 input-group-text"><i class="far fa-envelope-open" aria-hidden="true"></i></div>
                                                                      </div>
                                                                      {!! Form::email('email', null, array('placeholder' => '',  'id' => 'email', 'class' => 'form-control-sm form-control email detect-common', 'placeholder' => "Enter your email")) !!}
                                        
                                                                    </div>
                                                                  </div><!-- form-group col-md-6 -->
                                                                </div><!-- form-row -->
                                                                
                                                                
                                                                {!! Form::textarea('query', null, array('placeholder' => '',  'id' => 'query',  'class' => 'form-control query detect-common', 'cols' => '30', 'rows' => '5', 'placeholder' => "Enter your query details")) !!}
                                                                
                                                                <br>
                                                                {{ Form::checkbox('read_term','',null, array('class'=>'read_term detect-common', 'onclick' => "$(this).attr('value', this.checked ? 1 : 0)" )) }}
                                                                I have read, agreed to abide by <a href="" target="_blank">Terms and Conditions of Inquiry</a>

                                                                <br><br>
                                                                
                                                                <button type="button" id="submit" class="btn btn-sm px-7 text-white btn-animated">Submit</button>
                                                            
                                                            {!! Form::close() !!}
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                    </div>
                                </div>
                            </div>
                        </div>

                        
                    @if( !empty($relatedProduct) )
                        <div class="relate-products">
                            <h5 class="mb-5 text-left">Related Products</h5>
                            <div class="slick-slider" data-slick-options='{"slidesToShow": 4,"autoplay":true,"dots":false,"arrows":true,"responsive":[{"breakpoint": 1000,"settings": {"slidesToShow": 2}},{"breakpoint": 770,"settings": {"slidesToShow": 1,"arrows":false}}]}'>
                                
                            @foreach($relatedProduct as $v)
                                <div class="box">
                                    <div class="product card border-0 rounded-0 p-0">
                                        <div class="position-relative h-100">
                                            <a href="{{ url('single-product/'.$v['id'])}}"> <img src="{{ asset('storage/app/public/products/product_feature_image/'.$v['feature_product_image']) }}" alt="Product 1" class="card-img-top"> </a>
                                        </div>
                                        <div class="card-body text-center position-relative"> 
                                            <a href="{{ url('single-product/'.$v['id'])}}" class="link-hover-secondary-primary font-size-md mb-1">{{$v['product_name']}}</a>
                                            <div class="product-meta-wrapper position-relative">
                                                <div class="product-meta position-absolute">
                                                    <!-- <div class="mt-1 author-rate d-flex justify-content-center"> 
                                                            <i class="color-rgange fa fa-star" aria-hidden="true"></i>
                                                            <i class="color-rgange fa fa-star" aria-hidden="true"></i>
                                                            <i class="color-rgange fa fa-star" aria-hidden="true"></i>
                                                            <i class="color-rgange fa fa-star" aria-hidden="true"></i>
                                                            <i class="color-rgange fa fa-star" aria-hidden="true"></i>
                                                    </div> -->

                                                        <div class="font-size-md"> 
                                                       
                                                        @if( !empty($v['product_price'][0] ) )
                                                    

                                                            @if( $v['product_price'][0]['price_type'] == 1 && !empty($v['product_price'][0]['net_price']) ) 
                                                                
                                                                @if( !empty($v['product_price'][0]['offcer_price']) )
                                                                    <span class="te xt-dark text-decoration-line-through">{{$v['product_price'][0]['regular_price']}}.00</span> <br/>
                                                                
                                                                    <span class="text-danger">
                                                                        {{ !empty($countryCurrencyOnly[$v['product_price'][0]['country_id']]) ? $countryCurrencyOnly[$v['product_price'][0]['country_id']] : ''}}
                                                                        {{$v['product_price'][0]['net_price']}}.00</span> 
                                                                    
                                                                @else
                                                                    <span class="text-danger">
                                                                    {{ !empty($countryCurrencyOnly[$v['product_price'][0]['country_id']]) ? $countryCurrencyOnly[$v['product_price'][0]['country_id']] : ''}}
                                                                    
                                                                    {{$v['product_price'][0]['net_price']}}.00</span> 
                                                                @endif
                                                            
                                                            @elseif( $v['product_price'][0]['price_type'] == 2 )

                                                                @if( !empty($v['product_price'][0]['from_price'] && $v['product_price'][0]['to_price'] ) )
                                                                    <span class="text-danger">
                                                                    {{ !empty($countryCurrencyOnly[$v['product_price'][0]['country_id']]) ? $countryCurrencyOnly[$v['product_price'][0]['country_id']] : ''}}
                                                                        
                                                                    {{$v['product_price'][0]['from_price']}}.00-{{$v['product_price'][0]['to_price']}}.00</span> 
                                                                @endif

                                                            @elseif( $v['product_price'][0]['price_type'] == 3 )
                                                                <span class="text-danger">Negotiable</span> 
                                                            @endif
                                                            

                                                        @endif
                                                        </div>
                                                   

                                                </div>

                                                @if( !empty($v['product_price'][0] ) )
                                                    @if( $v['product_price'][0]['price_type'] == 1 && !empty($v['product_price'][0]['net_price']) ) 
                                                                    
                                                            <div class="add-to-cart position-absolute w-100"> <a href="{{ url('single-product/'.$v['id'])}}" class="link-hover-dark-primary font-weight-semibold text-uppercase">Add to cart</a> </div>
                                                    
                                                    @else
                                                    <div class="add-to-cart position-absolute w-100"> <a href="{{ url('single-product/'.$v['id'])}}" class="link-hover-dark-primary font-weight-semibold text-uppercase">Send Query</a> </div>
                                                    @endif
                                                @endif
                                                
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            @endforeach
                                
                            </div>
                        </div>
                    @endif


                    </div>
                </div>
            </div>


            @endsection
            

            <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
            
            <script type="text/javascript">
			
			    $(document).on('click', '#submit', function() {   
                
                var subject = $(".subject").val();
                var name = $(".name").val();
                var mobile = $(".mobile").val();
                var email = $(".email").val();
                var query = $(".query").val();
                var read_term = $(".read_term").val();
				
			    

                      $.ajax({
                          url: "{{url('product-inquiries') }}",
                          type: "POST",
                          data: {
                              "_token": "{{ csrf_token() }}",
                              company_id: "{{ !empty($data[0]['company_id']) ? $data[0]['company_id'] : '' }}",
                              product_id: "{{ !empty($data[0]['id']) ? $data[0]['id']  : '' }}",
                              subject: subject,
                              name: name,
                              mobile: mobile,
                              email: email,
                              query: query,
                              read_term: read_term,
                          },

                          beforeSend: function(){
                                $(".ajax-loader-img").css("display", "block");
                            },
                            complete: function(){
                                $(".ajax-loader-img").css("display", "none");
                            },
                          cache: false,
                          success: function(data) {

                                if($.isEmptyObject(data.error)){

                                    $(".print-error-msg").css('display', 'none');
                                    $('.detect-common').css('border', 'none');
                                    $('.detect-common-alert').html(''); 
                                    
                                    $('#form').find("input[type=text], input[type=email], input[type=checkbox], textarea").val("");
                                    $(".subject").val(subject);
                                    $('.read_term').prop('checked', false); 
                                    
                                    //alert(data.success);

                                    toastr.options =
                                    {
                                    "closeButton" : true,
                                    "progressBar" : true
                                    }
                                    toastr.success(data.success);

                                }else{

                                    toastr.options =
                                    {
                                    "closeButton" : true,
                                    "progressBar" : true
                                    }
                                    toastr.error("Something went wrong, Please see the error bellow.");

                                    printErrorMsg(data.error);

                                }

                            }



                      });
                      

                      function printErrorMsg (msg) {
                            
                            //$(".print-error-msg").html('');
                            $(".print-error-msg").html('Something went wrong, Please see the error bellow.');
                           
                           
                            $(".print-error-msg").css('display','block');

                            $('.detect-common').css('border', 'none');
                            $('.detect-common-alert').html('');
                                
                            $.each( msg, function( key, value ) {

                                $('.'+key).css('border', '1px solid red');
                                
                                $( "<span class='invalid-feedback detect-common-alert' role='alert'><strong>"+value+"</strong></span>" ).insertAfter( $( '.'+key ) );
                                
                                //$(".print-error-msg").find("ul").append('<li>'+value+'</li>');

                            });

                        }

                  });

                </script>