Server : nginx/1.18.0 System : Linux localhost 6.14.3-x86_64-linode168 #1 SMP PREEMPT_DYNAMIC Mon Apr 21 19:47:55 EDT 2025 x86_64 User : www-data ( 33) PHP Version : 8.0.16 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, Directory : /var/www/ecommerce/resources/views/frontend/pages/ |
@extends('frontend.layouts.master')
@section('title', 'PRODUCT PAGE')
@section('main-content')
<!-- Breadcrumbs -->
<div class="breadcrumbs">
<div class="container">
<div class="row">
<div class="col-12">
<div class="bread-inner">
<ul class="bread-list">
<li><a href="{{ route('home') }}">Home<i class="ti-arrow-right"></i></a></li>
<li class="active"><span>Shop List</span></li>
</ul>
</div>
</div>
</div>
</div>
</div>
<!-- End Breadcrumbs -->
<!-- Product Style 1 -->
<section class="product-area shop-sidebar shop-list shop section">
<div class="container">
<div class="row flex-xs-reverse-column">
<div class="col-lg-3 col-md-4 col-12">
<div class="shop-sidebar">
<!-- Shop By Price -->
<div class="single-widget range">
<h3 class="title">Shop by Price</h3>
<div class="price-filter">
<div class="price-filter-inner">
{{-- <div id="slider-range" data-min="10" data-max="2000" data-currency="%"></div>
<div class="price_slider_amount">
<div class="label-input">
<span>Range:</span>
<input type="text" id="amount" name="price_range" value='@if (!empty($_GET['price'])) {{$_GET['price']}} @endif' placeholder="Add Your Price"/>
</div>
</div> --}}
@php
$max = DB::table('products')->where('status', 'active')->max('price');
@endphp
<div id="slider-range" data-min="0" data-max="{{ $max }}"></div>
<div class="product_filter">
<button type="button" class="filter_button btn"
onclick="return addFilterBy('price_range')">Filter</button>
<div class="label-input">
<span>Range:</span>
<input style="" type="text" id="amount" readonly />
<input type="hidden" name="price_range" id="price_range"
value="@if (!empty($_GET['price'])){{ $_GET['price'] }}@endif" />
</div>
</div>
</div>
</div>
</div>
<!--/ End Shop By Price -->
<!-- Single Widget -->
<div class="single-widget recent-post">
<h3 class="title">Recent post</h3>
@foreach ($recent_products as $product)
@php
$photo = explode(',', $product->photo);
@endphp
<div class="single-post">
<div class="image d-inline-block">
<img class="img-fluid lazyload" data-src="{{ Helper::imagePath($photo[0]) }}" alt="{{ $photo[0] }}">
</div>
<div class="content d-inline-block">
<h5><a
href="{{ route('product-detail', $product->slug) }}">{{ $product->title }}</a>
</h5>
@if ($product->discount)
<p class="price">
<del class="text-muted">
{!! config('shop.currency_symbol') . ' ' . number_format($product->price, 2) !!}
</del>
<span class="d-block font-weight-bold">
{!! config('shop.currency_symbol') . ' ' . number_format($product->discounted_price, 2) !!}
</span>
</p>
@else
<p class="price">{!! config('shop.currency_symbol') !!}
{{ number_format($product->price, 2) }} </p>
@endif
</div>
</div>
@endforeach
</div>
<!--/ End Single Widget -->
<!-- Single Widget -->
@php
$brands = DB::table('brands')
->orderBy('title', 'ASC')
->where('status', 'active')
->get();
@endphp
@if($brands->count())
<div class="single-widget category">
<h3 class="title">Vendors</h3>
<ul class="categor-list">
@foreach ($brands as $brand)
<li><a href="{{ route('product-brand', $brand->slug) }}">{{ $brand->title }}</a>
</li>
@endforeach
</ul>
</div>
@endif
<!--/ End Single Widget -->
</div>
</div>
<div class="col-lg-9 col-md-8 col-12 mb-4">
<div class="row">
<div class="col-12">
<!-- Shop Top -->
<div class="shop-top">
<div class="shop-shorter">
<div class="single-shorter">
<label>Show :</label>
<select class="show nice-select" name="show" onchange="return addFilterBy('show')">
<option value="">Default</option>
@foreach ([10, 20, 30, 40] as $text)
<option value="{!! $text !!}" {!! request()->input('show') == $text ? 'selected' : '' !!}>
{!! $text !!}</option>
@endforeach
</select>
</div>
<div class="single-shorter">
<label>Sort By :</label>
<select class="sortBy nice-select" name='sortBy'
onchange="return addFilterBy('sortBy')">
<option value="">Default</option>
@foreach (['title' => 'Name', 'price' => 'Price', 'category' => 'Category', 'brand' => 'Vendor'] as $value => $text)
<option value="{!! $value !!}" {!! request()->input('sortBy') === $value ? 'selected' : '' !!}>
{!! $text !!}</option>
@endforeach
</select>
</div>
</div>
<ul class="view-mode">
<li><a
href="{{ route(
request()->route()->getName(),
request()->route()->parameters() + ['mode' => 'grid'] +
request()->query(),
) }}"><i
class="fa fa-th-large"></i></a>
</li>
<li class="active"><a href="javascript:void(0)"><i
class="fa fa-th-list"></i></a></li>
</ul>
</div>
<!--/ End Shop Top -->
</div>
</div>
<div class="row">
@if ($products->count())
@foreach ($products as $product)
@include('frontend.partials.list-product', [
'product' => $product
])
@endforeach
@else
<h4 class="text-warning" style="margin:100px auto;">There are no products.</h4>
@endif
</div>
<div class="row">
<div class="col-md-12 justify-content-center d-flex">
{{ $products->appends($_GET)->links() }}
</div>
</div>
</div>
</div>
</div>
</section>
<!--/ End Product Style 1 -->
<!-- Modal -->
{{-- @if ($products)
@foreach ($products as $key => $product)
<div class="modal fade" id="{{ $product->id }}" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
class="ti-close" aria-hidden="true"></span></button>
</div>
<div class="modal-body">
<div class="row no-gutters">
<div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
<!-- Product Slider -->
<div class="product-gallery">
<div class="quickview-slider-active">
@php
$photo = explode(',', $product->photo);
@endphp
@foreach ($photo as $data)
<div class="single-slider">
<img src="{{ Helper::imagePath($data) }}" alt="{{ $data }}">
</div>
@endforeach
</div>
</div>
<!-- End Product slider -->
</div>
<div class="col-lg-6 col-md-12 col-sm-12 col-xs-12">
<div class="quickview-content">
<h2>{{ $product->title }}</h2>
<div class="quickview-ratting-review">
<div class="quickview-ratting-wrap">
<div class="quickview-ratting">
@php
$rate = $product->reviews->avg('rate');
$rate_count = $product->reviews->count();
@endphp
@for ($i = 1; $i <= 5; $i++)
@if ($rate >= $i)
<i class="yellow fa fa-star"></i>
@else
<i class="fa fa-star"></i>
@endif
@endfor
</div>
<a href="#"> ({{ $rate_count }} customer review)</a>
</div>
<div class="quickview-stock">
@if ($product->stock > 0)
<span><i class="fa fa-check-circle-o"></i> {{ $product->stock }} in
stock</span>
@else
<span><i class="fa fa-times-circle-o text-danger"></i>
{{ $product->stock }} out stock</span>
@endif
</div>
</div>
@if ($product->discount)
<h3><small><del class="text-muted">{!! config('shop.currency_symbol') !!}
{{ number_format($product->price, 2) }}</del></small>
{!! config('shop.currency_symbol') !!}
{{ number_format($product->discounted_price, 2) }}
</h3>
@else
<h3>
{!! config('shop.currency_symbol') !!} {{ number_format($product->price, 2) }}
</h3>
@endif
<div class="quickview-peragraph">
<p>{!! html_entity_decode($product->summary) !!}</p>
</div>
<form action="{{ route('single-add-to-cart') }}" method="POST">
@csrf
<div class="quantity">
<!-- Input Order -->
<div class="input-group">
<div class="button minus">
<button type="button" class="btn btn-primary btn-number"
disabled="disabled" data-type="minus" data-field="quant[1]">
<i class="ti-minus"></i>
</button>
</div>
<input type="hidden" name="slug" value="{{ $product->slug }}">
<input type="text" name="quant[1]" class="input-number" data-min="1"
data-max="1000" value="1">
<div class="button plus">
<button type="button" class="btn btn-primary btn-number"
data-type="plus" data-field="quant[1]">
<i class="ti-plus"></i>
</button>
</div>
</div>
<!--/ End Input Order -->
</div>
<div class="add-to-cart">
<button type="submit" class="btn">Add to cart</button>
<a href="{{ route('add-to-wishlist', $product->slug) }}"
class="btn min"><i class="ti-heart"></i></a>
</div>
</form>
<div class="default-social">
<!-- ShareThis BEGIN -->
<div class="sharethis-inline-share-buttons"></div><!-- ShareThis END -->
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@endforeach
@endif --}}
<!-- Modal end -->
@endsection
@push('styles')
<!-- Jquery Ui -->
<link rel="stylesheet" href="{{ asset('frontend/css/jquery-ui.css') }}">
<style>
.pagination {
display: inline-flex;
}
.filter_button {
text-align: center;
background: #3CC78F;
padding: 8px 16px;
margin-top: 10px;
color: white;
border: none;
}
</style>
@endpush
@push('scripts')
<script src="{{ asset('frontend/js/jquery-ui.min.js') }}"></script>
{{-- <script>
$('.cart').click(function(){
var quantity=1;
var pro_id=$(this).data('id');
$.ajax({
url:"{{route('add-to-cart')}}",
type:"POST",
data:{
_token:"{{csrf_token()}}",
quantity:quantity,
pro_id:pro_id
},
success:function(response){
console.log(response);
if(typeof(response)!='object'){
response=$.parseJSON(response);
}
if(response.status){
swal('success',response.msg,'success').then(function(){
document.location.href=document.location.href;
});
}
else{
swal('error',response.msg,'error').then(function(){
// document.location.href=document.location.href;
});
}
}
})
});
</script> --}}
<script>
function addFilterBy(elementName) {
let filterKey = elementName;
let filterVal = $('[name="' + elementName + '"]').val();
const url = new URL(window.location);
if (filterVal) {
url.searchParams.set(filterKey, filterVal);
} else {
url.searchParams.delete(filterKey);
}
window.location.assign(url.toString());
}
$(function() {
/*----------------------------------------------------*/
/* Jquery Ui slider js
/*----------------------------------------------------*/
const $sliderRange = $("#slider-range");
const $priceRange = $("#price_range");
const $amount = $("#amount");
if ($sliderRange.length > 0) {
const max_value = parseInt($sliderRange.data('max')) || 500;
const min_value = parseInt($sliderRange.data('min')) || 0;
const currency = $sliderRange.data('currency') || '';
let price_range = min_value + '-' + max_value;
if ($priceRange.length > 0 && $priceRange.val()) {
price_range = $priceRange.val().trim();
}
let price = price_range.split('-');
$sliderRange.slider({
range: true,
min: min_value,
max: max_value,
values: price,
slide: function(event, ui) {
$amount.val(currency + ui.values[0] + " - " + currency + ui.values[1]);
$priceRange.val(ui.values[0] + "-" + ui.values[1]);
}
});
}
if ($amount.length > 0) {
const m_currency = $sliderRange.data('currency') || '';
$amount.val(m_currency + $sliderRange.slider("values", 0) +
" - " + m_currency + $sliderRange.slider("values", 1));
}
})
</script>
@endpush