'); }, success: function(){ $.ajax({ type: 'get', url: '//www.sakhtemaan.com/module/shop_cart/callback', success: function(data){ $('html, body').animate({scrollTop:scrollTop_cart}, 'slow'); $('.wait').fadeOut(function(){ $(this).remove(); $('#module_cart .middle').html(data); }); cartProcess = false; } }); } });
return false; }
$(document).ready(function () { var productId = null; var categoryId = null;
// Remove OnClick Attribute $('#add_to_cart_button , .add_to_cart_button').attr('onclick',''); $('#add_to_cart_button , .add_to_cart_button').click(function () {
var qstr = ''; var errorQ = false;
productId = $(this).attr('rel'); categoryId = $(this).data('index');
productId = productId ? '_' + productId : null; categoryId = categoryId ? '_' + categoryId : null; postfix = productId + categoryId;
var image = $('#main_image_product' + postfix).offset();
if (cartProcess) return;
$('#add_to_card_form' + postfix +' :input').each(function(i) { if ($(this).attr('name')=='quantity') { if ($(this).val() شکیبا باشید...
'); }, success: function(data1){ if (data1 == 'error!') { $('#wait_product_' + postfix).fadeOut(function(){ $(this).remove(); alert('کالا با مشخصات و تعداد انتخاب شده در انبار موجود نمی باشد!'); }); cartProcess = false; } else { $.ajax({ type: 'get', url: '//www.sakhtemaan.com/module/shop_cart/callback', success: function(data) { $('html, body').animate({scrollTop:scrollTop_cart}, 'slow'); $('#wait_product_'+ postfix).fadeOut(function(){ $(this).remove(); $('body').before('');
params = { top : cart.top + 'px', right : (cart.left ) + 'px', opacity : 0.7, width : $('#module_cart').width(), heigth : $('#module_cart').height() };
$('#main_image_product_temp' + postfix).animate(params, 'slow', false, function () { $('#main_image_product_temp' + postfix).remove(); }); $('#module_cart .middle').html(data); }); cartProcess = false; } }); } } }); }); });