Backups Created:
/home/japatmex/public_html/wp-content/edit-wolf.php
Savvy
W
olf -
MANAGER
Edit File: product.php
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@accessible360/accessible-slick@1.0.1/slick/slick.min.css" /> <link rel="stylesheet" href="https:////cdn.jsdelivr.net/npm/@accessible360/accessible-slick@1.0.1/slick/accessible-slick-theme.min.css" /> <style> #baguetteBox-overlay { display: none !important; } .submit-btn { font-size: 15px; border-radius: 25px; font-weight: bold; font-family: "Circular Std"; border: 0; background: orange; color: #fff; padding: 10px 22px; padding-bottom: 10px; padding-bottom: 10px; } .qty-btn { font-size: 15px; border-radius: 25px; font-weight: bold; font-family: "Circular Std"; border: 0; background: var(--site-main-color); color: #fff; padding: 10px 22px; padding-bottom: 10px; padding-bottom: 10px; } .product_qty{ padding: 8px; border-radius: 20px; border: 1px solid #d9d9d9; background: #f5f5f5; } .desc_accordion{ } #heading-2 a{ font-size: 20px; color: inherit; } .my-tabs-style li a{ padding: 10px; margin-right: 10px; } .nav-tabs li a, .nav-tabs li a:hover { color: #7B7B7B; } .related-products-title-box { margin: 10px 0; } .related-products-title-box a{ font-size: 20px; color: #000; text-decoration: none; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; } .related-products-title-box a:hover{ color: var(--site-main-color); } .related-products-price-box p{ color: var(--site-main-color); text-align: center; font-weight: bold; } .related-products-price-box p span{ color: #333; text-decoration: line-through; } @media only screen and (max-width: 412px) { .single-product-quantity .quantity { display: flex !important; justify-content: space-between; } .single-product-quantity .product_qty { width: 100px; } .single-product-quantity .quantity label{ line-height: 36px; } } </style> <script type="text/javascript"> $(document).ready(function() { var quantitiy = 0; $('.quantity-right-plus').click(function(e) { // Stop acting like a button e.preventDefault(); // Get the field name var quantity = parseInt($('#quantity').val()); // If is not undefined $('#quantity').val(quantity + 1); // Increment }); $('.quantity-left-minus').click(function(e) { // Stop acting like a button e.preventDefault(); // Get the field name var quantity = parseInt($('#quantity').val()); // If is not undefined // Increment if (quantity > 0) { $('#quantity').val(quantity - 1); } }); }); </script> <!-- change by ahsan --> <?php $ci = &get_instance(); if($product->other_color_product!=''){ $img_color_sm=$ci->_create_thumbnail('assets/images/products/',$product->product_slug,$product->featured_image,80,80); ?> <a href="<?php echo site_url('product/'.$product->product_slug); ?>" title="<?=$color_name?>" style="float:left;margin-right:10px;"> <div class="text-center" style="width: 55px;margin-top: 10px"> <div class="container-fluid" style="border: 3px solid #ff5252;padding: 0px;border-radius:40px;"> <img src="<?=base_url().$img_color_sm?>" style="border-radius:40px;"> </div> </div> </a> <?php $ids=explode(',', $product->other_color_product); foreach ($ids as $key => $value) { $product_slug=$ci->get_single_info(array('id' => $value),'product_slug','tbl_gf_ecomm_product '); $featured_image=$ci->get_single_info(array('id' => $value),'featured_image','tbl_gf_ecomm_product '); $img_color_sm=$ci->_create_thumbnail('assets/images/products/',$product_slug,$featured_image,80,80); $color_arr=explode('/', $ci->get_single_info(array('id' => $value),'color','tbl_gf_ecomm_product ')); $color_name=$color_arr[0]; ?> <a href="<?php echo site_url('product/'.$product_slug); ?>" title="<?=$color_name?>" style="float:left"> <div class="text-center" style="width: 55px;margin-top: 10px"> <div class="container-fluid" style="border: 3px solid #eee;padding: 0px;border-radius:40px;"> <img src="<?=base_url().$img_color_sm?>" style="border-radius:40px;"> </div> </div> </a> <?php } } ?> <div class="product_detail_page"> <div class="container"> <div class="row"> <div class="col-12"> <div class="inner_heading mb-4 mt-4"> <h1><?= $product->product_title;?></h1> </div> </div> <div class="col-xl-6" style="margin-right: 2rem;"> <div class="thumbnail_gallary"> <div class="product-image-carousels"> <!-- Main image carousel --> <div class="main-image-slider"> <?php if(isset($product->featured_image)){?> <a href="<?= base_url('uplds'.$this->data['rsStngs']->Theme.'/ecomm/images/products/'.$product->featured_image);?>" data-fancybox="gallery" rel="gal1" data-caption="" class="image-link fancybox"> <img src="<?= base_url('uplds'.$this->data['rsStngs']->Theme.'/ecomm/images/products/'.$product->featured_image);?>" alt=""> </a> <?php }else{?> <a href="<?= base_url('uplds'.$this->data['rsStngs']->Theme.'/ecomm/images/products/');?>" data-fancybox="gallery" rel="gal1" data-caption="" class="image-link fancybox"> <img src="<?= base_url('uplds'.$this->data['rsStngs']->Theme.'/ecomm/images/products/');?>" alt=""> </a> <?php }?> <?php if(isset($product->featured_image2)){?> <a href="<?= base_url('uplds'.$this->data['rsStngs']->Theme.'/ecomm/images/products/'.$product->featured_image2);?>" data-fancybox="gallery" rel="gal1" data-caption="" class="image-link fancybox"> <img src="<?= base_url('uplds'.$this->data['rsStngs']->Theme.'/ecomm/images/products/'.$product->featured_image2);?>" alt=""> </a> <?php }else{?> <a href="<?= base_url('uplds'.$this->data['rsStngs']->Theme.'/ecomm/images/no-image-1.jpg');?>" data-fancybox="gallery" rel="gal1" data-caption="" class="image-link fancybox"> <img src="<?php echo base_url('uplds'.$this->data['rsStngs']->Theme.'/ecomm/images/no-image-1.jpg');?>" ></a> <?php } foreach($product_gallery as $galleryItem) { if(isset($galleryItem->image_file)) { ?> <a href="<?echo base_url('uplds'.$this->data['rsStngs']->Theme.'/ecomm/images/products/gallery/'.$galleryItem->image_file);?>" data-fancybox="gallery" rel="gal1" data-caption="" class="image-link fancybox"> <img src="<?= base_url('uplds'.$this->data['rsStngs']->Theme.'/ecomm/images/products/gallery/'.$galleryItem->image_file);?>" alt=""> </a> <?php } } ?> </div> </div> </div> <!-- SHOP SALE --> <?php if($related_products) { ?> <div class="related-products"> <div class="related-products-main-title"> <h2>Related Products</h2> </div> <div class="owl-carousel owl-theme related-products" id="related-products"> <?php foreach($related_products as $related_product){ ?> <div class="item"> <div class="related-products-content-box"> <div class="related-products-image-box"> <?php if($related_product->featured_image != ''){ ?> <img src="<?php echo base_url('uplds'.$this->data['rsStngs']->Theme.'/ecomm/images/products/'.$related_product->featured_image);?>"> <?php } else {?> <img src="<?php echo base_url('uplds'.$this->data['rsStngs']->Theme.'/ecomm/images/no-image-1.jpg'); ?>"> <?php } ?> </div> <div class="related-products-title-box text-center"> <a href="<?php echo base_url('product/'.$related_product->product_slug);?>"><?=$related_product->product_title?></a> </div> <div class="related-products-price-box"> <p><?php if($related_product->you_save_amt) {echo '<span>Original Price: '.$related_product->product_mrp.' <br/></span>'; }?><?='Price: '.($related_product->product_mrp - $related_product->you_save_amt);?></p> </div> </div> </div> <?php }?> </div> </div> <?php } ?> </div> <div class="col-xl-5"> <div class="inner-heading"> <div class="row align-items-center pb-2"> <div class="col-sm-6"> <div class="product-title"> <h5 class="mb-0" style="margin-bottom: 0px !important;"> <?php //echo $product->product_title; ?> </h5> </div> </div> <div class="col-sm-6"> <div class="add_wish_list borderd_btn"> <button type="button" class="addToWishList submit-btn" data-id="<?php echo isset($product->id) ? $product->id : '' ?>"><i class="fa fa-heart"></i> <?php echo isset($wishlistCheck) && $wishlistCheck->product_id == $product->id ? 'Remove From Wishlist' : 'Add To Wishlist'?></button> </div> </div> </div> <div class="product_rating pb-2"> <i class="fa fa-star" style="color: #7a7a7a"></i> <i class="fa fa-star" style="color: #7a7a7a"></i> <i class="fa fa-star" style="color: #7a7a7a"></i> <i class="fa fa-star" style="color: #7a7a7a"></i> <i class="fa fa-star" style="color: #7a7a7a"></i> </div> <div class="single-product-price pb-2"> <!-- <span class="new-price">PKR <?=$product->product_mrp;?></span> --> <span class="new-price" style="color: var(--site-main-color);"> <?php if($product->you_save_amt!='0'){ ?> <h4 class="new-price mb-0" style="color: var(--site-main-color);"> <?=getusercurrency().' '.Currency_Formator(getuserprice($product->selling_price))?></h4> <h6 style="text-decoration: line-through;" class="old-price mb-0" style="color: var(--site-main-color);"><small> <?=getusercurrency().' '.Currency_Formator(getuserprice($product->product_mrp));?></small></h6> <?php } else { ?> <h4 class="new-price mb-0" style="color: var(--site-main-color);"> <?=getusercurrency().' '.Currency_Formator(getuserprice($product->product_mrp));?></h4> <?php } ?> </span> </div> <div class="product_sku pb-3"> <span class="more"><span class="font-weight-bold">SKU:</span> <?= $product->product_sku;?> </span> </div> <?php if($product->quantity > 0){ ?> <div class="single-product-quantity zquentity_btn pb-3"> <form action="<?=base_url('Ecomm/add_to_cart')?>" method="post" id="cartForm"> <div class="quantity"> <label>Quantity</label> <input type="hidden" name="max_unit_buy" value="<?=$product->max_unit_buy ? $product->max_unit_buy: '1'?>" class="max_unit_buy"> <input type="hidden" name="preview_url" value="<?=current_url()?>"> <input type="hidden" name="product_id" value="<?=$product->id?>" /> <input class="input-text product_qty" name="product_qty" value="1" type="number" min="1" <?php if ($product->max_unit_buy != 0) { echo "max=" . $product->max_unit_buy; } ?> onkeypress="return isNumberKey(event)"> <input type="hidden" name="product_selected_variation"> <button class="cst_button qty-btn " type="submit"><?php if($ci->check_cart($product->id,$this->session->userdata('GSM_FUS_UserId'))){ echo 'Update to cart'; }else{ echo 'Add to Cart'; } ?></button> </div> </form> </div> <?php } else { ?> <div><img style="width: 50%; height: auto;" src="<?= base_url('uplds'.$this->data['rsStngs']->Theme.'/ecomm/images/out_of_stock/1.png');?>" /></div> <?php }?> <div class="desc_accordion"> <div class="flex flex-column faq-section"> <p style="color: var(--site-main-color);"><?php echo htmlspecialchars_decode($product->product_desc);?></p> <div id="accordion"> <div class="card" style="padding: 20px;"> <div id="heading-2"> <a class="collapsed" role="button" data-toggle="collapse" href="#collapse-2" aria-expanded="false" aria-controls="collapse-2"> Features </a> </div> <div id="collapse-2" class="collapse show" data-parent="#accordion" aria-labelledby="heading-2"> <div class="accordion_content"> <p><?php echo htmlspecialchars_decode($product->product_features); ?></p> </div> </div> </div> </div> </div> </div> </div> </div> </div> <!-- <div class="review_section mb-4 mt-4"> <div class="row"> <div class="col-12"> <div class=""> <div class="review_tabs"> <!-- Nav tabs --> <!--<ul class="nav nav-tabs my-tabs-style" role="tablist"> <li role="presentation"><a href="#description_tab" class="active" aria-controls="description_tab" role="tab" data-toggle="tab">Description</a></li> <!-- <li role="presentation"><a href="#features_tab" aria-controls="features_tab" role="tab" data-toggle="tab">Features</a></li> <li role="presentation"><a href="#reviews_tab" aria-controls="reviews_tab" role="tab" data-toggle="tab">Reviews (0)</a></li> --> <!--</ul> <!-- Tab panes --> <!--<div class="tab-content"> <div role="tabpanel" class="tab-pane active" id="description_tab"> <?php print_r($product->product_desc); ?> </div> <!-- <div role="tabpanel" class="tab-pane" id="features_tab"> <?php //print_r($product->product_features); ?> </div> <div role="tabpanel" class="tab-pane" id="reviews_tab"> <div class="borderd_btn"> <button class="qty-btn">Add your Review</button> </div> </div> --> <!--</div> </div> </div> </div> </div> </div> --> </div> </div> <script type="text/javascript" src="<?=base_url('assets/site_assets/js/baguettebox/baguetteBox.min.js')?>"></script> <script type="text/javascript"> baguetteBox.run('.tz-gallery'); </script> <script type="text/javascript"> <?php if(!empty($variation_type_values)) { ?> var variation_type_values = jQuery.parseJSON('<?php echo $variation_type_values; ?>'); <?php }else{ ?> var variation_type_values = {}; <?php } ?> function get_variation_type_value_details() { var var_ids = [], var_values = []; $('.var-select-btn.selected').each(function() { var var_id = $(this).data('var-id'); var var_value = $(this).data('value'); var_ids.push(var_id); var_values.push(var_value); }); for (var key in variation_type_values) { var count_array = []; for (var i = 1; i <= var_ids.length; i++) { if (variation_type_values[key]['var_id' + i] == var_ids[(i - 1)] && variation_type_values[key]['var_text' + i ] == var_values[(i - 1)]) { count_array.push(1); } } if (count_array.length == var_ids.length) { $('[name="product_selected_variation"]').val(variation_type_values[key].id); // setting price if (variation_type_values[key].you_save_amt == 0) { var html = `<span class="new-price"><?=getusercurrency().' ';?> ${variation_type_values[key].price} </span>`; } else { var html = `<span class="new-price"><?=getusercurrency().' ';?> ${variation_type_values[key].sale_price} </span> <span class="old-price"><?=getusercurrency().' ';?> ${variation_type_values[key].price} </span>`; } $('.single-product-price').html(html); // setting image if ($('#dynamic-var-image').length) $('#dynamic-var-image').remove(); if (variation_type_values[key].image && variation_type_values[key].image.trim()) { if (variation_type_values[key].valid_image == true) { var image_url = '<?php echo base_url('assets/images/products/variations'); ?>/' + variation_type_values[key].image; $('.tz-gallery .tab-pane.active div').not('#dynamic-var-image').hide(); $('.tz-gallery .tab-pane.active').append( `<div id="dynamic-var-image"> <a href="${image_url}" class="lightbox"> <img src="${image_url}" alt=""> </a> </div>` ); } else { $('.tz-gallery .tab-pane.active div').not('#dynamic-var-image').show(); } } else { $('.tz-gallery .tab-pane.active div').not('#dynamic-var-image').show(); } refresh_lightbox(); } } } function refresh_lightbox() { try { baguetteBox.destroy('.lightbox'); baguetteBox.run('.lightbox'); } catch (e) { } } $(document).ready(function() { $('.addToWishList').click(function() { var productId = $(this).attr('data-id'); $.ajax({ type: 'POST', url: '<?php echo site_url('Ecomm/wishlist_action') ?>', data: { product_id: productId }, success: function(response) { var obj = $.parseJSON(response); if (obj.success == '1') { location.reload(); } else { swal("Oh..!", obj.msg); } } }); }); get_variation_type_value_details(); $(document).on('shown.bs.tab', '[data-toggle="tab"]', function() { refresh_lightbox(); }); // submit review form $("#review-form").submit(function(e) { e.preventDefault(); var formData = new FormData($(this)[0]); $.ajax({ url: $(this).attr("action"), processData: false, contentType: false, type: 'POST', data: formData, success: function(data) { var obj = $.parseJSON(data); if (obj.success == '1') { location.reload(); } else { alert("Something going to wrong...."); } } }); }); $('.radio-group .radio_btn').click(function() { $(this).parent().find('.radio_btn').removeClass('selected'); $(this).addClass('selected'); var val = $(this).attr('data-value'); //alert(val); $(this).parent().find('input').val(val); get_variation_type_value_details(); }); $(".product_qty").blur(function(e) { if (parseInt($(this).val()) <= 0) { $(this).val(1); } /* // Commenting this because we are managing it through stock quantity else if(parseInt($(this).val()) > parseInt($(".max_unit_buy").val())){ alert("You cannot buy more than "+$(".max_unit_buy").val()+" items in single order !!!"); $(this).val($(".max_unit_buy").val()); } */ }); // changebyahsan\ // changeby ahsan $(".btn_remove_img").click(function(e) { e.preventDefault(); var _ele = $(this).parent(".review_img_holder"); href = '<?=base_url()?>Ecomm/remove_review_image'; if (confirm("Are sure to remove image?")) { $.ajax({ url: href, data: { "id": $(this).data("id") }, type: 'post', success: function(res) { var obj = $.parseJSON(res); if (obj.success == 1) { _ele.remove(); $('.notifyjs-corner').empty(); $.notify( obj.message, { position: "top right", className: obj.class } ); } else { alert("Something going wrong !!!"); } } }); } }); // Configure/customize these variables. var showChar = 500; // How many characters are shown by default var ellipsestext = "..."; var moretext = "Show more >>"; var lesstext = "<< Show less"; $('.more').each(function() { var content = $.trim($(this).text()); if (content.length > showChar) { var c = content.substr(0, showChar); var h = content.substr(showChar, content.length - showChar); var html = c + '<span class="moreellipses">' + ellipsestext + ' </span><span class="morecontent"><span>' + h + '</span><a href="" class="morelink">' + moretext + '</a></span>'; $(this).html(html); } }); $(".morelink").click(function() { if ($(this).hasClass("less")) { $(this).removeClass("less"); $(this).html(moretext); } else { $(this).addClass("less"); $(this).html(lesstext); } $(this).parent().prev().toggle(); $(this).prev().toggle(); return false; }); // for cart form $("#cartForm").submit(function(event) { event.preventDefault(); $(".process_loader").show(); var formData = $(this).serialize(); var _form = $(this); $.ajax({ type: 'POST', url: $(this).attr('action'), data: formData }) .done(function(response) { var res = $.parseJSON(response); $(".process_loader").hide(); if (res.success == '1') { swal({ title: "Done!", text: res.msg, type: "success" }, function() { $.ajax({ type: 'POST', url: '<?php echo base_url().'Ecomm/get_cart'?>', data: { count: true }, success: function(response) { console.log(response); if (response > 0) { $('.add-cart-btn').find('.cart-add') .empty(); setTimeout(function() { $('.add-cart-btn').find( '.cart-add').append( response); }, 100); var html = `<a class="nav-link" href="<?php echo site_url('my-cart'); ?>"> <div class="add-cart-btn"><i class="fa fa-cart-arrow-down"></i><span class="cart-add"><?=$cartCount;?></span></div> </a>`; } else { var html = `<li class="cart-item text-center"> <h4 style="font-weight: 500">Cart is empty !!!</h4></li>`; } $('.cart_buttons').html(html) } }) }); } else if (res.success == '2') { swal({ title: "Failed!", text: res.msg, type: "warning" }, function() { location.reload(); }); } else if (res.success == '0') { window.location.href = '<?=base_url()?>login-register'; } }) .fail(function(response) { $(".process_loader").hide(); swal("Something gone wrong!", res); }); }); // for size chart modal open $(".size_chart").click(function(e) { e.preventDefault(); $(".size_chart_img").hide(); $(".no_data").hide(); if ($(this).data("img") == '') { $(".no_data").show(); } else { $(".size_chart_img").show(); $(".size_chart_img").attr("src", $(this).data("img")); } $("#size_chart").modal("show") }); }); </script> <?php if($this->session->flashdata('cart_msg')) { $message = $this->session->flashdata('cart_msg'); ?> <script type="text/javascript"> var _msg = "<?=$message['message']?>"; var _class = '<?=$message['class']?>'; $('.notifyjs-corner').empty(); $.notify( _msg, { position: "top right", className: _class } ); </script> <?php } ?> <?php if($this->session->flashdata('response_msg')) { $message = $this->session->flashdata('response_msg'); ?> <script type="text/javascript"> var _msg = "<?=$message['message']?>"; var _class = '<?=$message['class']?>'; $('.notifyjs-corner').empty(); $.notify( _msg, { position: "top right", className: _class } ); </script> <?php } ?> <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@accessible360/accessible-slick@1.0.1/slick/slick.min.js"></script> <script> $(document).ready(function() { /********************* Thumbnails slider *********************/ // Change the main image whenever a thumbnail button is activated $('.thumbnails-slider').on('init', function(e, slider) { $(slider.$slides.find('.thumbnail-button')).each(function(index) { $(this).on('click', function() { // Move aria-current="true" to this button $(slider.$slides.find('.thumbnail-button').removeAttr('aria-current')); $(this).attr('aria-current', true); // Change the main image to match this thumbnail button var index = $(this).closest('.slick-slide').data('slick-index'); $('.main-image-slider').slick('slickGoTo', index); }); }); }); // Initialize the slider $('.thumbnails-slider').slick({ vertical: true, slidesToShow: 4, infinite: false, instructionsText: 'This carousel contains a column of small thumbnails. Selecting a thumbnail will change the main image in the carousel that follows. Use the Previous and Next buttons to cycle through all the thumbnails, use Enter to select.', regionLabel: 'thumbnails carousel', responsive: [{ breakpoint: 768, settings: { infinite: false, vertical: false } }, { breakpoint: 668, settings: { infinite: false, slidesToShow: 3, vertical: false } }, ] }); /******************** Main image slider *********************/ $('.main-image-slider').slick({ slidesToShow: 1, draggable: false, instructionsText: 'This carousel shows one large product image at a time. Use the Previous and Next buttons to move between images, or use the preceding thumbnails carousel to select a specific image to display here.', regionLabel: 'main image carousel', }); // Update the thumbnail slider when the user changes the main slider directly. $('.main-image-slider').on('beforeChange', function(e, slider, currentSlide, nextSlide) { // Remove aria-current from the last selected thumbnail image button $('.thumbnails-slider .thumbnail-button[aria-current="true"]').removeAttr('aria-current'); // Select the thumbnail image button that goes with this main image. Most importantly, this updates Slick's internal state to be consistent with the visual change. $('.thumbnails-slider').slick('slickGoTo', nextSlide); // Add aria-current="true" to the correct thumbnail image button to convey to screen readers that it's active. $('.thumbnails-slider .thumbnail-button:eq(' + nextSlide + ')').attr('aria-current', true); }); }); </script>