").addClass("shipping-title").append($("").addClass("shipping-price-title").text("الشحن:")).append($("").addClass("shipping-loading"));$("#open-estimate-shipping-popup-38").html(n)}},success:function(){var t=n.getActiveShippingOption();n.selectShippingOption(t);u=!0;n.settings.handlers.success=undefined},error:function(){n.selectShippingOption()},selectedOption:function(t){var i;if(t&&t.provider&&t.price&&n.validateAddress(t.address)){var r=$("#open-estimate-shipping-popup-38"),u=$("
").addClass("shipping-title").append($("").attr("src","images/shipping.jpg").attr("alt","Shipping Icon").attr("class","shipping-img")).append($("").addClass("shipping-price-title").text("الشحن:")).append($("").addClass("shipping-price").text(t.price));r.html(u);i=$("").addClass("estimated-delivery").append($("").addClass("shipping-address").append($("").text("إلى "+t.address.countryName+", "+(t.address.stateProvinceName?t.address.stateProvinceName+", ":"")+(n.settings.useCity?t.address.city:t.address.zipPostalCode)+" عن طريق "+t.provider)).append($("").addClass("arrow-down")));t.deliveryDate&&t.deliveryDate!=="-"&&i.append($("").addClass("shipping-date").text("تاريخ التسليم المقدر "+t.deliveryDate));r.append(i)}else $("#open-estimate-shipping-popup-38").html($("").text("الرجاء تحديد العنوان الذي تريد شحنه إلى")).append($("").addClass("arrow-down"))}}},i,r;n=createEstimateShippingPopUp(f);n.init();i=function(){var t=n.getShippingAddress();n.validateAddress(t)?n.getShippingOptions(t):n.selectShippingOption()};i();r=function(r){var o=r.changedData.productId,f,e;o===38&&(n.params.selectedShippingOption?(f=n.params.selectedShippingOption.address,e=n.getShippingAddress(),n.addressesAreEqual(f,e)||(t=!0),n.getShippingOptions(f)):u?t=!0:i())};setTimeout(function(){$(document).on("product_attributes_changed",r)},500);$(document).on("product_quantity_changed",r)})