File: /www/wwwroot/www.shooperm.com/storage/framework/views/25dd307cb54154566da364a4143b0e179d39904b.php
<?php $__env->startSection('title'); ?>
<?php if(isset($filter_name)): ?>
<?php echo e($filter_name->name ?? $filter_name); ?>
<?php else: ?>
<?php echo e($tag); ?>
<?php endif; ?>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<!-- brand_banner::start -->
<div class="brand_banner d-flex align-items-center">
<div class="container">
<div class="row">
<div class="col-12">
<h3 class="branding_text">
<?php if(isset($filter_name)): ?>
<?php echo e($filter_name->name ?? $filter_name); ?>
<?php else: ?>
<?php echo e($tag); ?>
<?php endif; ?>
</h3>
</div>
</div>
</div>
</div>
<!-- brand_banner::end -->
<div class="prodcuts_area ">
<div class="container">
<div class="row">
<?php echo $__env->make('frontend.amazy.partials._listing_sidebar', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<div id="dataWithPaginate" class="col-lg-8 col-xl-9">
<?php echo $__env->make('frontend.amazy.partials.listing_paginate_data', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
</div>
</div>
</div>
<div class="add-product-to-cart-using-modal">
</div>
<input type="hidden" id="login_check" value="<?php if(auth()->check()): ?> 1 <?php else: ?> 0 <?php endif; ?>">
</div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make(theme('partials.add_to_cart_script'), \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php echo $__env->make(theme('partials.add_to_compare_script'), \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php $__env->startPush('scripts'); ?>
<script type="text/javascript">
(function($){
"use strict";
var filterType = [];
$(document).ready(function(){
'<?php if(isset($color) && $color->id == 1): ?>'+
'<?php $__currentLoopData = $color->values; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $ki => $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>'+
$("span.colors_<?php echo e($ki); ?>").css("background", "<?php echo e($item->value); ?>");
'<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>'+
'<?php endif; ?>'
$(document).on('click', '#refresh_btn', function(event){
event.preventDefault();
filterType = [];
fetch_data(1);
$('.attr_checkbox').prop('checked', false);
$('.color_checkbox').removeClass('selected_btn');
$('.category_checkbox').prop('checked', false);
$('#price_range_div').html(
`<div class="wrapper">
<div class="range-slider">
<input type="text" class="js-range-slider-0" value=""/>
</div>
<div class="extra-controls form-inline">
<div class="form-group">
<div class="price_rangs">
<input type="text" class="js-input-from form-control" id="min_price" value="<?php echo e(isset($min_price_lowest) ? $min_price_lowest : 0); ?>" readonly/>
<p>Min</p>
</div>
<div class="price_rangs">
<input type="text" class="js-input-to form-control" id="max_price" value="<?php echo e(isset($max_price_highest) ? $max_price_highest : 0); ?>" readonly/>
<p>Max</p>
</div>
</div>
</div>
</div>`
);
var minVal = parseInt($('#min_price').val());
var maxVal = parseInt($('#max_price').val());
$("#slider-range").slider({
range: true,
min: minVal,
max: maxVal,
values: [minVal, maxVal],
slide: function (event, ui) {
$("#amount").val(ui.values[0]+"-"+ui.values[1]);
},
});
$("#amount").val(
$("#slider-range").slider("values", 0)+"-"+$("#slider-range").slider("values", 1)
);
});
$(document).on('click', '.getProductByChoice', function(event){
let type = $(this).data('id');
let el = $(this).data('value');
getProductByChoice(type, el);
});
$(document).on('change', '.getFilterUpdateByIndex', function(event){
var paginate = $('#paginate_by').val();
var prev_stat = $('.filterCatCol').val();
var sort_by = $('#product_short_list').val();
var requestItem = $('#item_request').val();
var requestItemType = $('#item_request_type').val();
$('#pre-loader').show();
$.get("<?php echo e(route('frontend.sort_product_filter_by_type')); ?>", {paginate:paginate, sort_by:sort_by, requestItem:requestItem, requestItemType:requestItemType}, function(data){
$('#dataWithPaginate').html(data);
$('#product_short_list').niceSelect();
$('#paginate_by').niceSelect();
$('#pre-loader').hide();
$('.filterCatCol').val(prev_stat);
activeTab();
initLazyload();
});
});
$(document).on('click', '.page_link', function(event){
event.preventDefault();
let page = $(this).attr('href').split('page=')[1];
var filterStatus = $('.filterCatCol').val();
if (filterStatus == 0) {
fetch_data(page);
}
else {
fetch_filter_data(page);
}
});
$(document).on('click', ".add_to_cart_gift_thumnail", function() {
addToCart($(this).attr('data-gift-card-id'),$(this).attr('data-seller'),1,$(this).attr('data-base-price'),1,'gift_card',$(this).data('prod_info'));
});
$(document).on('click', '.add_to_wishlist_from_search', function(event){
event.preventDefault();
let product_id = $(this).data('product_id');
let type = $(this).data('type');
let seller_id = $(this).data('seller_id');
let is_login = $('#login_check').val();
if(is_login == 1){
addToWishlist(product_id,seller_id, type);
}else{
toastr.warning("<?php echo e(__('defaultTheme.please_login_first')); ?>","<?php echo e(__('common.warning')); ?>");
}
});
function fetch_data(page){
$('#pre-loader').show();
if(page != 'undefined'){
var paginate = $('#paginate_by').val();
var sort_by = $('#product_short_list').val();
if (sort_by != null && paginate != null) {
var url = window.location.href+'&sort_by='+sort_by+'&paginate='+paginate+'&page='+page;
}else if (sort_by == null && paginate != null) {
var url = window.location.href+'&paginate='+paginate+'&page='+page;
}else {
var url = window.location.href+'&page='+page;
}
$.ajax({
url: url,
success:function(data)
{
$('#dataWithPaginate').html(data);
$('#product_short_list').niceSelect();
$('#paginate_by').niceSelect();
$('#pre-loader').hide();
activeTab();
initLazyload();
}
});
}else{
toastr.warning("<?php echo e(__('defaultTheme.this_is_undefined')); ?>","<?php echo e(__('common.warning')); ?>");
}
}
function fetch_filter_data(page){
$('#pre-loader').show();
var paginate = $('#paginate_by').val();
var sort_by = $('#product_short_list').val();
var requestItem = $('#item_request').val();
var requestItemType = $('#item_request_type').val();
if (sort_by != null && paginate != null) {
var url = "<?php echo e(route('frontend.product_filter_page_by_type')); ?>"+'?requestItem='+requestItem+'&requestItemType='+requestItemType+'&sort_by='+sort_by+'&paginate='+paginate+'&page='+page;
}else if (sort_by == null && paginate != null) {
var url = "<?php echo e(route('frontend.product_filter_page_by_type')); ?>"+'?requestItem='+requestItem+'&requestItemType='+requestItemType+'&paginate='+paginate+'&page='+page;
}else {
var url = "<?php echo e(route('frontend.product_filter_page_by_type')); ?>"+'?requestItem='+requestItem+'&requestItemType='+requestItemType+'&page='+page;
}
if(page != 'undefined'){
$.ajax({
url:url,
success:function(data)
{
$('#dataWithPaginate').html(data);
$('#product_short_list').niceSelect();
$('#paginate_by').niceSelect();
$('.filterCatCol').val(1);
$('#pre-loader').hide();
activeTab();
initLazyload();
}
});
}else{
toastr.warning("<?php echo e(__('defaultTheme.this_is_undefined')); ?>","<?php echo e(__('common.warning')); ?>");
}
}
let minimum_price = 0;
let maximum_price = 0;
let price_range_gloval = 0;
$(document).on('click', '.js-range-slider-0', function(event){
var price_range = $("#amount").val().split('-');
minimum_price = price_range[0];
maximum_price = price_range[1];
price_range_gloval = price_range;
myEfficientFn();
});
var myEfficientFn = debounce(function() {
$('#min_price').val(minimum_price);
$('#max_price').val(maximum_price);
getProductByChoice("price_range",price_range_gloval);
}, 500);
function debounce(func, wait, immediate) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
if (!immediate) func.apply(context, args);
};
var callNow = immediate && !timeout;
clearTimeout(timeout);
timeout = setTimeout(later, wait);
if (callNow) func.apply(context, args);
};
};
// $(".js-range-slider-0").ionRangeSlider({
// type: "double",
// min: $('#min_price').val(),
// max: $('#max_price').val(),
// from: $('#min_price').val(),
// to: $('#max_price').val(),
// drag_interval: true,
// min_interval: null,
// max_interval: null
// });
$(function () {
var minVal = parseInt($('#min_price').val());
console.log(minVal);
var maxVal = parseInt($('#max_price').val());
$("#slider-range").slider({
range: true,
min: minVal,
max: maxVal,
values: [minVal, maxVal],
slide: function (event, ui) {
$("#amount").val(ui.values[0]+"-"+ui.values[1]);
},
});
$("#amount").val(
$("#slider-range").slider("values", 0)+"-"+$("#slider-range").slider("values", 1)
);
});
function getProductByChoice(type,el)
{
var requestItem = $('#item_request').val();
var requestItemType = $('#item_request_type').val();
console.log(requestItem)
console.log(requestItemType)
var objNew = {filterTypeId:type, filterTypeValue:[el]};
var objExistIndex = filterType.findIndex((objData) => objData.filterTypeId === type );
if (objExistIndex < 0) {
filterType.push(objNew);
}else {
var objExist = filterType[objExistIndex];
if (objExist && objExist.filterTypeId == "price_range") {
objExist.filterTypeValue.pop(el);
}
if (objExist && objExist.filterTypeId == "rating") {
objExist.filterTypeValue.pop(el);
}
if (objExist.filterTypeValue.includes(el)) {
objExist.filterTypeValue.pop(el);
}else {
objExist.filterTypeValue.push(el);
}
}
$('#pre-loader').show();
$.post('<?php echo e(route('frontend.product_filter_by_type')); ?>', {_token:'<?php echo e(csrf_token()); ?>', filterType:filterType, requestItem:requestItem, requestItemType:requestItemType}, function(data){
$('#dataWithPaginate').html(data);
$('.filterCatCol').val(1);
$('#product_short_list').niceSelect();
$('#paginate_by').niceSelect();
$('#pre-loader').hide();
activeTab();
initLazyload();
});
}
function activeTab(){
var active_tab = localStorage.getItem('view_product_tab');
if(active_tab != null && active_tab == 'profile'){
$("#profile").addClass("active");
$("#profile").addClass("show");
$("#home").removeClass('active');
$("#home-tab").removeClass("active");
}else{
$("#home").addClass("active");
$("#home").addClass("show");
$("#profile").removeClass('active');
$("#profile-tab").removeClass("active");
}
}
activeTab();
$(document).on('click', ".view-product", function () {
var target = $(this).attr("href");
if(target == '#profile'){
localStorage.setItem('view_product_tab', 'profile');
$(this).addClass("active");
$("#profile").addClass("active");
$("#profile").addClass("show");
$("#home").removeClass('active');
$("#home-tab").removeClass("active");
}else{
localStorage.setItem('view_product_tab', 'home');
$("#home").addClass("active");
$("#home").addClass("show");
$("#profile").removeClass('active');
$("#profile-tab").removeClass("active");
}
});
});
})(jQuery);
</script>
<?php $__env->stopPush(); ?>
<?php echo $__env->make('frontend.amazy.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /www/wwwroot/www.shooperm.com/resources/views/frontend/amazy/pages/listing.blade.php ENDPATH**/ ?>