var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; };
if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } }
{
let window = _____WB$wombat$assign$function_____("window");
let self = _____WB$wombat$assign$function_____("self");
let document = _____WB$wombat$assign$function_____("document");
let location = _____WB$wombat$assign$function_____("location");
let top = _____WB$wombat$assign$function_____("top");
let parent = _____WB$wombat$assign$function_____("parent");
let frames = _____WB$wombat$assign$function_____("frames");
let opener = _____WB$wombat$assign$function_____("opener");
// Array includes polyfill
if (!Array.prototype.includes) {
Object.defineProperty(Array.prototype, 'includes', {
value: function (searchElement, fromIndex) {
if (this == null) {
throw new TypeError('"this" is null or not defined');
}
// 1. Let O be ? ToObject(this value).
var o = Object(this);
// 2. Let len be ? ToLength(? Get(O, "length")).
var len = o.length >>> 0;
// 3. If len is 0, return false.
if (len === 0) {
return false;
}
// 4. Let n be ? ToInteger(fromIndex).
// (If fromIndex is undefined, this step produces the value 0.)
var n = fromIndex | 0;
// 5. If n ≥ 0, then
// a. Let k be n.
// 6. Else n < 0,
// a. Let k be len + n.
// b. If k < 0, let k be 0.
var k = Math.max(n >= 0 ? n : len - Math.abs(n), 0);
function sameValueZero(x, y) {
return x === y || (typeof x === 'number' && typeof y === 'number' && isNaN(x) && isNaN(y));
}
// 7. Repeat, while k < len
while (k < len) {
// a. Let elementK be the result of ? Get(O, ! ToString(k)).
// b. If SameValueZero(searchElement, elementK) is true, return true.
if (sameValueZero(o[k], searchElement)) {
return true;
}
// c. Increase k by 1.
k++;
}
// 8. Return false
return false;
}
});
}
$(function () {
// Currency
$('#form-currency .currency-select').unbind().on('click', function (e) {
e.preventDefault();
$('#form-currency input[name=\'code\']').val($(this).data('name'));
$('#form-currency').submit();
});
// Language
$('#form-language .language-select').unbind().on('click', function (e) {
e.preventDefault();
$('#form-language input[name=\'code\']').val($(this).data('name'));
$('#form-language').submit();
});
});
window['cart'].add = function (product_id, quantity, quick_buy) {
quantity = quantity || 1;
$.ajax({
url: 'index.php?route=checkout/cart/add',
type: 'post',
data: 'product_id=' + product_id + '&quantity=' + quantity,
dataType: 'json',
beforeSend: function () {
$('[data-toggle="tooltip"]').tooltip('hide');
$('[onclick*="cart.add(\'' + product_id + '\'"]').button('loading');
},
complete: function () {
$('[onclick*="cart.add(\'' + product_id + '\'"]').button('reset');
},
success: function (json) {
$('.alert, .text-danger').remove();
if (json['redirect']) {
if (json['options_popup']) {
if ($('html').hasClass('iphone') || $('html').hasClass('ipad')) {
iNoBounce.enable();
}
var html = '';
html += '
';
html += '
';
html += ' ';
html += '
';
html += '
';
html += '
';
html += ' ';
html += '
';
html += '
';
html += '
';
html += ' ';
html += '
';
// show modal
$('.popup-wrapper').remove();
$('body').append(html);
setTimeout(function () {
$('html').addClass('popup-open popup-center');
}, 10);
} else {
location = json['redirect'];
}
}
if (json['success']) {
if (json['options_popup']) {
if ($('html').hasClass('iphone') || $('html').hasClass('ipad')) {
iNoBounce.enable();
}
var html = '';
html += '