Unknown: Creation of dynamic property Request::$request is deprecated in /home/qdomain/public_html/unbannable.com/ocdemo20/system/library/request.php on line 12Unknown: Creation of dynamic property Customer::$config is deprecated in /home/qdomain/public_html/unbannable.com/ocdemo20/vqmod/vqcache/vq2-system_library_customer.php on line 14Unknown: Creation of dynamic property Customer::$db is deprecated in /home/qdomain/public_html/unbannable.com/ocdemo20/vqmod/vqcache/vq2-system_library_customer.php on line 15Unknown: Creation of dynamic property Customer::$request is deprecated in /home/qdomain/public_html/unbannable.com/ocdemo20/vqmod/vqcache/vq2-system_library_customer.php on line 16Unknown: Creation of dynamic property Customer::$session is deprecated in /home/qdomain/public_html/unbannable.com/ocdemo20/vqmod/vqcache/vq2-system_library_customer.php on line 17Unknown: Creation of dynamic property Affiliate::$config is deprecated in /home/qdomain/public_html/unbannable.com/ocdemo20/system/library/affiliate.php on line 12Unknown: Creation of dynamic property Affiliate::$db is deprecated in /home/qdomain/public_html/unbannable.com/ocdemo20/system/library/affiliate.php on line 13Unknown: Creation of dynamic property Affiliate::$request is deprecated in /home/qdomain/public_html/unbannable.com/ocdemo20/system/library/affiliate.php on line 14Unknown: Creation of dynamic property Affiliate::$session is deprecated in /home/qdomain/public_html/unbannable.com/ocdemo20/system/library/affiliate.php on line 15Unknown: Creation of dynamic property Currency::$session is deprecated in /home/qdomain/public_html/unbannable.com/ocdemo20/vqmod/vqcache/vq2-system_library_currency.php on line 9Unknown: Creation of dynamic property Currency::$config is deprecated in /home/qdomain/public_html/unbannable.com/ocdemo20/vqmod/vqcache/vq2-system_library_currency.php on line 15Unknown: Creation of dynamic property Currency::$db is deprecated in /home/qdomain/public_html/unbannable.com/ocdemo20/vqmod/vqcache/vq2-system_library_currency.php on line 16Unknown: Creation of dynamic property Currency::$language is deprecated in /home/qdomain/public_html/unbannable.com/ocdemo20/vqmod/vqcache/vq2-system_library_currency.php on line 17Unknown: Creation of dynamic property Currency::$request is deprecated in /home/qdomain/public_html/unbannable.com/ocdemo20/vqmod/vqcache/vq2-system_library_currency.php on line 18Unknown: Creation of dynamic property Tax::$config is deprecated in /home/qdomain/public_html/unbannable.com/ocdemo20/vqmod/vqcache/vq2-system_library_tax.php on line 6Unknown: Creation of dynamic property Tax::$db is deprecated in /home/qdomain/public_html/unbannable.com/ocdemo20/vqmod/vqcache/vq2-system_library_tax.php on line 7Unknown: Creation of dynamic property Tax::$session is deprecated in /home/qdomain/public_html/unbannable.com/ocdemo20/vqmod/vqcache/vq2-system_library_tax.php on line 8Unknown: Creation of dynamic property Weight::$db is deprecated in /home/qdomain/public_html/unbannable.com/ocdemo20/system/library/weight.php on line 6Unknown: Creation of dynamic property Weight::$config is deprecated in /home/qdomain/public_html/unbannable.com/ocdemo20/system/library/weight.php on line 7Unknown: Creation of dynamic property Length::$db is deprecated in /home/qdomain/public_html/unbannable.com/ocdemo20/system/library/length.php on line 6Unknown: Creation of dynamic property Length::$config is deprecated in /home/qdomain/public_html/unbannable.com/ocdemo20/system/library/length.php on line 7Unknown: Creation of dynamic property Cart::$customer is deprecated in /home/qdomain/public_html/unbannable.com/ocdemo20/vqmod/vqcache/vq2-system_library_cart.php on line 9Unknown: Creation of dynamic property Cart::$session is deprecated in /home/qdomain/public_html/unbannable.com/ocdemo20/vqmod/vqcache/vq2-system_library_cart.php on line 10Unknown: Creation of dynamic property Cart::$tax is deprecated in /home/qdomain/public_html/unbannable.com/ocdemo20/vqmod/vqcache/vq2-system_library_cart.php on line 12Unknown: Creation of dynamic property Cart::$weight is deprecated in /home/qdomain/public_html/unbannable.com/ocdemo20/vqmod/vqcache/vq2-system_library_cart.php on line 13Unknown: Creation of dynamic property Openbay::$logger is deprecated in /home/qdomain/public_html/unbannable.com/ocdemo20/system/library/openbay.php on line 17Unknown: Creation of dynamic property Event::$registry is deprecated in /home/qdomain/public_html/unbannable.com/ocdemo20/system/engine/event.php on line 6Warning: Cannot modify header information - headers already sent by (output started at /home/qdomain/public_html/unbannable.com/ocdemo20/index.php:102) in /home/qdomain/public_html/unbannable.com/ocdemo20/vqmod/vqcache/vq2-catalog_controller_product_product.php on line 115 var img = 'img[uo_main_image_id=main_image]'; // The main image uo_main_image_id
var origSrc = '';
var origTitle = '';
var origAlt = '';
var origPopup = '';
// Additional option images:
//jQuery('img[uo_rel^=addl]').length
//var orig_thumb = [];
//var orig_popup = [];
//jQuery('img[uo_rel^=addl]').each(function(i,j){
// orig_thumb[i] = $(j).attr('src');
// orig_popup[i] = $(j).parent('a').attr('href');
//});
//if (!window.console) {var console = {};}
//if (!console.log) {console.log = function() {};}
jQuery(document).ready(function(){
console.log('Uber Options - Image: Initialized');
// Store original image source
origSrc = jQuery(img).attr('src');
origTitle = jQuery(img).attr('title');
origAlt = jQuery(img).attr('alt');
origPopup = jQuery(img).parent().attr('href');
if (jQuery(img).length == 0) {
console.log('img id "'+img+'" not found');
}
jQuery(':input[name^="option"], select[name^="option"]').change(function(){
//jQuery(':input[name^="option"][type=\'checkbox\'], :input[type=\'hidden\'], :input[name^="option"][type=\'radio\'], select[name^="option"], :input[name^="quantity"]').change(function(){
obUpdate(jQuery(this));
});
// Force a change on load to support mods like default product options and any "onload" adjustments
// use the bRefreshed flag to limit it to a single refresh regardless of how many elements exist
var bRefreshed = false;
if (jQuery('select[name^="option"] :selected').length && !bRefreshed) {
jQuery('select[name^="option"] :selected').change();
bRefreshed = true;
}
if (jQuery('input[name^="option"][type=radio]:checked').length && !bRefreshed) {
jQuery('input[name^="option"][type=radio]:checked').change();
bRefreshed = true;
}
if (jQuery('input[name^="option"][type=checkbox]:checked').length && !bRefreshed) {
jQuery('input[name^="option"][type=checkbox]:checked').change();
bRefreshed = true;
}
// Support for Options Text Price Per Char Pro. Always refresh for this, regardless of refreshed status
if (jQuery('input[type=text][name^=option],textarea[name^=option]').length) {
jQuery('input[type=text][name^=option],textarea[name^=option]').change();
}
//swatchPanel(jQuery('select[name="option[265]"]'));
//swatchPanel(jQuery(':input[name="option[268]"]'));
// Enable swatchpanel if any selects or radios have it set
jQuery('select[name^="option"]').each(function() {
if ($(this).attr('uo_image_swatch') != undefined && $(this).attr('uo_image_swatch') == '1') {
swatchPanel($(this));
}
});
});
function swatchPanel(el) {
// Build swatchpanel with image info. Use native javascript because it is much faster than jQuery
var swDiv = document.createElement("div");
// Hide Original Select Box
el.hide();
// Select handler
if (el.is('select')) {
var name = el.attr('name');
el.find('option').each(function(i,opt) {
if ($(opt).attr('uo_thumb') != undefined) {
var img = document.createElement('img');
img.src = $(opt).attr('uo_swatch');
img.setAttribute("uo_popup", $(opt).attr('uo_popup'));
img.setAttribute("uo_thumb", $(opt).attr('uo_thumb'));
img.setAttribute("uo_swatch", $(opt).attr('uo_swatch'));
img.style.padding = '2px';
img.setAttribute("idx", $(opt).val());
img.onclick = function() { $('select[name="'+name+'"]').val(img.getAttribute('idx')).change(); this.style.border = 'dashed 1px gray'; $(this).siblings('img').css('border', '0px'); };
swDiv.appendChild(img);
}
});
}
// Add the new div after the original form control
el.before($(swDiv));
}
function getCookie(name) {
name += '=';
var parts = document.cookie.split(/;\s*/);
for (var i = 0; i < parts.length; i++) {
var part = parts[i];
if (part.indexOf(name) == 0) {
return part.substring(name.length)
}
}
return null;
}
function obUpdate(el) {
console.log('Uber Options - Image: ImgUpdate Called by ' + jQuery(el).attr('name'));
// Set variables...
var option_id = el.attr('id');
var option_name = el.attr('name');
var option_val = el.val();
// Remove existing option info
jQuery('#option_info').remove();
jQuery('.uo_ajax_error').remove();
if (getCookie('isMijoshop') == '1') {
var ajaxurl = 'index.php?option=com_mijoshop&format=raw&tmpl=component&route=product/product/uo_mainimageswap';
} else {
var ajaxurl = 'index.php?route=product/product/uo_mainimageswap';
}
// ajax lookup
jQuery.ajax({
type: 'post',
url: ajaxurl,
dataType: 'json',
data: jQuery(':input[name^="option"][type=\'checkbox\']:checked, :input[type=\'hidden\'], :input[name=\'quantity\'], :input[name^="option"][type=\'radio\']:checked, select[name^="option"]').serialize() + '&option_value_id='+option_val,
//data: jQuery(':input[name^="option"][type=\'checkbox\']:checked').serialize() +'&'+ jQuery(':input[type=\'hidden\']').serialize() +'&'+ jQuery(':input[name=\'quantity\']').serialize() +'&'+ jQuery(':input[name^="option"][type=\'radio\']:checked').serialize() +'&'+ jQuery('select[name^="option"]').serialize() +'&'+ jQuery('input[name^="option"][type=\'text\']').serialize() + '&option_value_id='+option_val + '&ppc_current_price='+ppc_current_price,
beforeSend: function() {
if (getCookie('isMijoshop') == '1') {
el.after('
');
} else {
el.after('
');
}
},
success: function (data) {
jQuery.each(data, function(key, val) {
console.log(key+':'+val);
});
// Update the main image with the new image.
var swatch = data.uo_swatch;
var thumb = data.uo_thumb;
var popup = data.uo_popup;
var name = data.name;
var swap = data.uo_image_swap_product;
// Swap Image if exists...
if (thumb && swap) {
jQuery(img).attr('src', thumb);
jQuery(img).attr('title', name);
jQuery(img).attr('alt', name);
jQuery(img).parent().attr('href', popup);
jQuery('.zm-viewer img').attr('src', popup); // cloudzoom journal
//var czattr = jQuery('img.cloudzoom').attr('data-cloudzoom').replace(/\'(.*?)\'/, '\''+popup+'\'');
//jQuery('img.cloudzoom').attr('data-cloudzoom', czattr);
//jQuery('.cloudzoom-zoom-inside > img').attr('src', popup);
} else if (parseInt(swap)) { //revert back to main if image not exists
jQuery(img).attr('src', origSrc);
jQuery(img).attr('title', origTitle);
jQuery(img).attr('title', origAlt);
jQuery(img).parent().attr('href', origPopup);
jQuery('.zm-viewer img').attr('src', origPopup); // cloudzoom journal
//var czattr = jQuery('img.cloudzoom').attr('data-cloudzoom').replace(/\'(.*?)\'/, '\''+origPopup+'\'');
//jQuery('img.cloudzoom').attr('data-cloudzoom', czattr);
//jQuery('.cloudzoom-zoom-inside > img').attr('src', origPopup);
}
//$('#uo_info_div').remove();
//if (data.uo_info) {
// jQuery(img).after(''+data.uo_info+'
');
//}
},
error: function(xhr, ajaxOptions, thrownError) {
console.log('Uber Options - Main Image Swap: Ajax Lookup Error. Please try again.');
},
complete: function() {
jQuery('.uo_loading').remove();
}
});
// Get Type for determining checked/unchecked for checkbox
var bChecked = true;
if (el.is('input:checkbox') && !el.is(':checked')) {
bChecked = false;
}
if (!option_val || bChecked == false) {
jQuery(img).attr('src', origSrc);
jQuery(img).attr('title', origTitle);
jQuery(img).attr('title', origAlt);
jQuery(img).parent().attr('href', origPopup);
}
}