function storequickorder_event_order_created() { //yaCounterXXXXXX.reachGoal('TARGET_NAME'); //return true; } function storequickorder_event_is_enabled_add2cart(but, parent_form){ if (!parent_form.find('.js-add2cart .js-submit-form').hasClass("disabled") && !parent_form.find('.add2cart [type="submit"]').is("[disabled]") || (parent_form.find('.add2cart [type="submit"]:enabled').length>0)) { return true; } else { return false; } } function storequickorder_event_dialog_show(response, dialog, p){ if (!window.storequickorder_cart_but_init) { window.storequickorder_cart_but_init = true; $('body').on('click', '#storequickorder [name="terms"]', function(){ storequickorderCheckTerms(); }) } dialog.appendTo('body'); dialog.show(); storequickorderCheckTerms(); var heightContent = (dialog.find(".dialog-content").length) ? parseInt(dialog.find(".dialog-content").outerHeight(true)) : 0; var heightBottom = (dialog.find(".dialog-buttons").length) ? parseInt(dialog.find(".dialog-buttons").outerHeight(true)) : 0; if(heightContent > 0 || heightBottom > 0){ dialog.find(".dialog-window").css("height", heightContent + heightBottom + "px"); } } $(function(){ $('body').on('change', '#product-cart .skus input:radio, #product-cart .services input[type=checkbox]', function (){ form = $(this).closest('form'); setTimeout(function() { $.storequickorder.checkStock(form.find('.storequickorder-button'), form); }, $.storequickorder.check_stock_delay); }); }); function storequickorderCheckTerms() { if (!$('#storequickorder form div.wa-form [name="terms"]').length) { $('#storequickorder form div.wa-form').append('') } if ($('#storequickorder [name="terms"]').length) { if ($('#storequickorder [name="terms"]').prop('checked')) { $('#storequickorder [type="submit"]').prop('disabled',false); } else { $('#storequickorder [type="submit"]').prop('disabled',true); } } } $('body').on('click', '#storequickorder [name="terms"]', function(){ storequickorderCheckTerms(); }) window.storequickorder_cart_but_init = false;