Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 104Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 108Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 111Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 162Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 163Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 104Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 108Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 111Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 162Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 163Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 104Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 108Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 111Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 162Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 163Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 104Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 108Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 111Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 162Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 163Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 104Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 108Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 111Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 162Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 163Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 104Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 108Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 111Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 162Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 163Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 104Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 108Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 111Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 162Notice: Trying to access array offset on value of type bool in /home/mtlcp/storage/modification/catalog/model/extension/module/options_combinations.php on line 163Notice: Trying to access array offset on value of type bool in /home/mtlcp/public_html/catalog/controller/extension/module/options_combinations.php on line 18Notice: Trying to access array offset on value of type bool in /home/mtlcp/public_html/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(); var self = this; self.add_combined_option_images(original_images); }; DefaultCombinationEngine.prototype.add_combined_option_images = function (images) { if (images.length){ $('.mousetrap').remove(); var owl = $('.additional-images'); owl.trigger("destroy.owl.carousel"); $(owl).children().remove(); var image_template = '
\n' + '[image_alt]
'; var html = ''; var zoom_items = []; images.forEach(function (item, index) { zoom_items.push({src: item.image_popup}); if(index == 0){ initial_main_image.find('img').attr('src',item.image_thumb); initial_main_image.attr('href',item.image_popup); } var image = image_template.replace('[image_popup]',item.image_popup) .replace('[image_src]',item.image_popup) .replace('[image_thumb]',item.image_thumb) .replace('[image_title]',item.image_title) .replace('[image_title2]',item.image_title) .replace('[image_alt]',item.image_title) .replace('[pos]', index + 1) .replace('[index]', index +1); html += image; }); $(owl).append(html); var _this = this; $('.product-zoom-image').unbind('click'); $('.product-zoom-image').on('click', function (e) { var pos = $('#light-box-position').val(); _this.oczoom.openLightBox(pos, images); }); $('.sub-image').on('click', function () { var pos = $(this).data('pos'); $('#light-box-position').val(pos); $('.additional-images .owl-item .item').removeClass('img-active'); $(this).closest('.item').addClass('img-active'); }); $('.cloud-zoom, .cloud-zoom-gallery').CloudZoom(); owl.owlCarousel({ loop: false, margin: 10, nav: true, dots: false, responsive:{ 0: { items: 2 }, 480: { items: 3 }, 768: { items: 3 }, 992: { items: 3 }, 1200: { items: 4 } } }); owl.trigger('refresh.owl.carousel'); } }; DefaultCombinationEngine.prototype.remove_combined_option_images = function () { $(images_selector).html(''); }; DefaultCombinationEngine.prototype.reset_data = function (reset_image=true) { $(prices_group_selector).html(initial_product_price); $(orig_elements_selector).remove(); $(elements_placeholder_selector).after(orig_elements); 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 data_element = $(''); if (product.manufacturer){ data_element.append('
  • Fabricant : '+product.manufacturer+'
  • '); } if (this.get_tax(variant)){ data_element.append('
  • H.T : '+this.get_tax(variant)+'
  • '); } if(variant.option_discount.length){ data_element.append('

  • '); variant.option_discount.forEach(function (discount) { data_element.append('
  • '+discount.quantity+' ou plus '+discount.price_formatted+'
  • '); }); } if (this.get_model(variant)) { data_element.append('
  • Modèle : ' + this.get_model(variant) + '
  • '); } if (this.get_upc(variant)){ data_element.append('
  • UPC: ' + this.get_upc(variant) + '
  • '); } if (this.get_reward_points(variant)){ data_element.append('
  • Points de fidelité : ' + this.get_reward_points(variant) + '
  • '); } data_element.append('
  • Disponibilité : ' + 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)+'
  • '); } if($("div#quickview-bg-block").is(":visible")) var price_element = $("div#quickview-content").find('.price-box'); else var price_element = $('.price-box'); price_element.html(''); if (variant.option_special){ price_element.append('

    '+ this.get_price(variant) +'

    ','

    '+ this.get_old_price(variant) +'

    '); } else { price_element.append('

    '+ this.get_price(variant) +'

    ') } if (product.points && product.points != "0"){ price_element.append('
  • Prix en points de fidelité : '+product.points+'
  • '); } $(elements_placeholder_selector).after(data_element); } else { this.reset_data(reset_image=false); } }; DefaultCombinationEngine.prototype.oczoom = { 'initAdditionalImagesOwl' : function () { $('.additional-images').owlCarousel({ loop: false, margin: 10, nav: true, dots: false, responsive:{ 0: { items: 2 }, 480: { items: 3 }, 768: { items: 3 }, 992: { items: 3 }, 1200: { items: 4 } } }); }, 'openLightBox' : function (position, images) { var product_id = $('#product-identify').val(); var flag = false; $( window ).resize(function() { var screenheight = $( window ).height(); $('.mySlides img').css('max-height', screenheight); }); var screenheight = $( window ).height(); $('.mySlides img').css('max-height', screenheight); var html = ''; $('.lightbox-container').html(html).show(500); oczoom.showSlides(position); }, 'showSlides' : function (position) { var i; var slides = $(".mySlides"); if (position > slides.length) {position = 1} if (position < 1) {position = slides.length} $('#light-box-position').val(position); for (i = 0; i < slides.length; i++) { slides[i].style.display = "none"; } slides[position-1].style.display = "inline-block"; }, 'plusSlides' : function (n) { var position = parseInt($('#light-box-position').val()); oczoom.showSlides(position += n); }, 'closeLightBox': function () { $('.lightbox-container').hide().html(''); $('body').css('overflow',''); }, 'closeCloudZoomBig': function () { $('#cloud-zoom-big').hide().html(''); } }; 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( null, function (event, xhr, settings, json, call_url) { var scroll = function () { $([document.documentElement, document.body]).animate({ scrollTop: $(".options-combinations-error").offset().top - 85 }, 500); }; if(call_url && call_url.includes(settings.url) && json && json.error){ if(json.error.quantity){ scroll(); } else if (json.error.require_combination){ scroll(); } else if (json.error.invalid_combination) { scroll(); } } } ); $(document).off('change', '.product-options input[type="radio"], .product-options input[type="checkbox"], .product-options select, #product-quantity'); $(document).on('change', '.product-options input[type="radio"], .product-options input[type="checkbox"], .product-options select, #product-quantity', function (e) { e.stopImmediatePropagation(); }); /* add quantity from url parameter */ var getUrlParameter = function getUrlParameter(sParam) { var sPageURL = window.location.search.substring(1), sURLVariables = sPageURL.split('&'), sParameterName, i; for (i = 0; i < sURLVariables.length; i++) { sParameterName = sURLVariables[i].split('='); if (sParameterName[0] === sParam) { return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]); } } }; var product_quantity = getUrlParameter('product_quantity'); if ($.isNumeric(product_quantity)){ $('#product-quantity').val(product_quantity); } }); /**/