Notice: Trying to access array offset on value of type bool in /home/boutiqueblush/public_html/storage/modification/catalog/controller/extension/module/options_combinations.php on line 18Notice: Trying to access array offset on value of type bool in /home/boutiqueblush/public_html/storage/modification/catalog/controller/extension/module/options_combinations.php on line 19/**/
function DefaultCombinationEngine(){
CombinationEngine.call(this);
}
DefaultCombinationEngine.prototype = Object.create(CombinationEngine.prototype);
DefaultCombinationEngine.prototype.reset_combined_option_images = function () {
this.remove_combined_option_images();
this.add_combined_option_images(original_images);
};
DefaultCombinationEngine.prototype.add_combined_option_images = function (images) {
$(document).ready(function() {
if (images.length){
$(images_selector).children().remove();
var image_template = ` ` ;
var html = '';
images.forEach(function (item, index) {
var image = image_template.replace(/\[image_popup\]/g,item.image_popup)
.replace('[image_src]',item.image_popup)
.replace('[image_thumb]',item.image_thumb)
.replace('[image_title]',item.image_title)
.replace('[image_alt]',item.image_alt);
html += image;
});
$(images_selector).prepend(html);
lightSliderObj.refresh();
$('.cloud-zoom').CloudZoom();
}
});
};
DefaultCombinationEngine.prototype.remove_combined_option_images = function () {
// $(images_selector).html('');
};
DefaultCombinationEngine.prototype.reset_data = function (reset_image=true) {
$(orig_elements_selector).remove();
$(price_selector).html('');
$(elements_placeholder_selector).after(orig_elements);
$(price_selector).html(orig_price.html());
if (reset_image){
this.reset_combined_option_images();
}
};
DefaultCombinationEngine.prototype.use_variant_data = function (selected_options) {
var variant = this.get_combination_by_options(selected_options);
if (variant){
var current_elements = $(orig_elements_selector);
current_elements.remove();
var price_element = $('.product-info-details p.price');
price_element.html('');
if (variant.option_special){
price_element.append(''+ this.get_price(variant) +' '+ this.get_old_price(variant) +'');
}
else {
price_element.html(this.get_price(variant))
}
if (product.points && product.points != "0"){
price_element.append('Precio en Puntos de recompensa: '+product.points+'');
}
var data_element = $('');
if (product.manufacturer){
data_element.append('Marca: '+product.manufacturer+'');
}
if (this.get_tax(variant)){
data_element.append('Sin Iva: '+this.get_tax(variant)+'');
}
if(variant.option_discount.length){
data_element.append('
');
variant.option_discount.forEach(function (discount) {
data_element.append(''+discount.quantity+' o más '+discount.price_formatted+'');
});
}
if (this.get_model(variant)) {
data_element.append('Referencia: ' + this.get_model(variant) + '');
}
if (this.get_sku(variant)){
data_element.append('SKU: ' + this.get_sku(variant) + '');
}
if (this.get_upc(variant)){
data_element.append('UPC: ' + this.get_upc(variant) + '');
}
if (this.get_reward_points(variant)){
data_element.append('Puntos Recompensa: ' + this.get_reward_points(variant) + '');
}
data_element.append('Disponibilidad: ' + this.get_stock(variant) + '');
if (this.get_dimensions(variant)){
data_element.append(''+this.get_dimensions(variant)+'');
}
if (this.get_extra_text(variant)){
data_element.append(''+this.get_extra_text(variant)+'');
}
$(elements_placeholder_selector).after(data_element);
} else {
this.reset_data(false);
}
};
var default_combination_engine = new DefaultCombinationEngine();
default_combination_engine.include_styles();
default_combination_engine.include_error_wrapper();
default_combination_engine.include_imagepicker();
default_combination_engine.show_options();
default_combination_engine.register_on_input_change();
default_combination_engine.register_reset_options();
default_combination_engine.reset_options();
default_combination_engine.register_add_cart_call();
});
/**/