';
return html;
}
function cartModalBindButtons(step) {
$('.js-show-step').off('click');
$('.js-show-step').on('click', function () {
var has_error = 0;
var step = $(this).data('step');
if (step == 'payment-method') {
$('.js-delivery-address input').each(function () {
if (!this.checkValidity()) {
mw.notification.warning('Proszę wypełnić wymagane pola ');
// ..alert($(this).prop('name') + ' is not valid');
$(this).addClass('error');
has_error = 1;
} else {
$(this).removeClass('error');
}
});
if (has_error) {
step = 'delivery-address'
}
}
$('.js-show-step').removeClass('active');
$('[data-step]').removeClass('active');
$('[data-step="' + step + '"]').addClass('active').parent().removeClass('muted');
step1 = '.js-' + step;
$('.js-step-content').hide();
$(step1).show();
$(this).addClass('active');
});
}
$(document).ready(function () {
mw.on('mw.cart.add', function (event, data) {
$("#shoppingCartModal").modal();
$("#js-ajax-cart-checkout-process").reload_module()
});
});