HEX
Server: nginx/1.27.1
System: Linux in-3 5.15.0-161-generic #171-Ubuntu SMP Sat Oct 11 08:17:01 UTC 2025 x86_64
User: ivenus-clone (3297)
PHP: 7.4.33
Disabled: exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
Upload Files
File: /storage/v4513/ivenusin/public_html/wp-content/themes/ivenus/assets/js/product-main.js
(function ($) {
  "use strict";
  if ($("#checkEmiOffers").length > 0) {
	$('#checkEmiOffers').removeAttr('disabled');
	// $("#checkEmiOffers").detach().insertAfter('.single_add_to_cart_button');
  }
  if ($("#find_store").length > 0) {
	$("#find_store").detach().insertAfter('.single_add_to_cart_button');
	$("#find_store").show();
  }
  
  if ($("#pickup_store").length > 0) {
	$("#pickup_store").detach().insertAfter('.single_add_to_cart_button');
	$("#pickup_store").show();
  }
  
  if ($("#pickup_store").length > 0 || $("#find_store").length > 0) {
	   $("<div class='clearfix'></div>").insertAfter(".quantity");
  }
  
  $('#find_store').click(function() {
	window.location.href = $(this).data('changeurl');
	return false;
  });
  
  $('#pickup_store').click(function(e) {
	e.preventDefault();
	var carturl = $(this).data('carturl') + '?pickup=' + $(this).data('productid');

	if($('.single_add_to_cart_button').hasClass('disabled')) {
		$('.single_add_to_cart_button').trigger( "click" );
	} else {
		$('form.cart').attr('action', carturl);
		$('#pickup_store_loader').show();
		$('#pickup_store').attr('disabled','disabled');
		$('.single_add_to_cart_button').trigger( "click" );
		$('.single_add_to_cart_button').addClass('disabled');
		
	}
	return false;
  });


  $('#checkEmiOffers').click(function(e){
		//To avoid unnecessary ajax calls
		if( $(this).data('lastsku') === $(".sku").text() )
			return true;
		
		$(this).data('lastsku', $(".sku").text());
	
		$("#emiOffersData").html('');
		$("#emiOffersMsg").html('');
		$("#emiOffersMsg").hide();
		$('#checkEmiOffersLoader').children().show();
		$('.emiOffersDismiss').attr('disabled', 'disabled');
		
		$.ajax({
				url: iVenusAjax.Ajax_Url,
				type: 'POST',
				dataType : 'json',
				data: (
						{
							action : 'emi_calculator',
							sku : $(".sku").text()
						}
					),
				success: function(response) {
						if( response.status == 1 ){
							var html_str = '<ul class="nav nav-tabs">';
							var table_str = '';
							var tabClass = 'active';
							var tableClass = 'active';
							jQuery.each( response.emiOffers, function( key, val ) {
								
								html_str += '<li class="nav-item"><a class="nav-link '+ tabClass +'" data-toggle="tab" href="#'+ key +'">'+ val.name +'</a></li>';
								
								table_str += '<div id="'+ key +'" class="tab-pane container '+ tableClass +'"><br/><table class="table table-bordered"><thead><tr class="table-secondary"><th class="text-center" scope="col">Monthly Installment</th><th class="text-center" scope="col">Months</th><th class="text-center" scope="col">Cost To Customer</th></tr></thead><tbody>';
								
								jQuery.each( val.scheme, function( ind, schemeObj ) {
									table_str += '<tr><td class="text-center"><i class="fa fa-inr"></i> '+ schemeObj.MONTHLY_INSTALLMENT +'</td><td class="text-center">'+ schemeObj.TENURE_IN_MONTHS +'</td><td class="text-center"><i class="fa fa-inr"></i> '+ schemeObj.OVERALL_COST +'</td></tr>';
								});
								
								tabClass = '';
								tableClass = 'fade';
								table_str += '</tbody></table></div>';
							});
							
							html_str += '</ul><div class="tab-content">' + table_str + '</div>';	
							$("#emiOffersData").html(html_str);
						} else {
							$("#emiOffersMsg").html(response.msg);
							$("#emiOffersMsg").show();
						}
					},
				failure : function(err){
						alert(err);
					},
				complete: function(){
					$('#checkEmiOffersLoader').children().hide();
					$('.emiOffersDismiss').removeAttr('disabled');
				}
		});
  });
})(jQuery);