Need a unique gift idea?
A Pastebin account makes a great Christmas gift
SHARE
TWEET

Untitled

a guest Dec 6th, 2018 52 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. $(document).ready(function() {
  2.   thumbnails = $('img[src*="/products/"]');
  3.   if (thumbnails.length > 1) {
  4.     thumbnails.bind('click', function() {
  5.       var arrImage = $(this).attr('src').split('?')[0].split('.');
  6.       var strExtention = arrImage.pop();
  7.       var strRemaining = arrImage.pop().replace(/_[a-zA-Z0-9@]+$/,'');
  8.       var strNewImage = arrImage.join('.')+"."+strRemaining+"."+strExtention;
  9.       if (typeof variantImages[strNewImage] !== 'undefined') {
  10.           productOptions.forEach(function (value, i) {
  11.            optionValue = variantImages[strNewImage]['option-'+i];
  12.            if (optionValue !== null && $('.single-option-selector:eq('+i+') option').filter(function() { return $(this).text().trim() === optionValue }).length) {
  13.              $('.single-option-selector:eq('+i+')').val(optionValue).trigger('change');
  14.            }
  15.         });
  16.       }
  17.     });
  18.   }
  19. });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top