SHARE
TWEET

Untitled

a guest Jun 18th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. document.trigger = false;
  2.  
  3. var shippingMethod = function(element){
  4.  
  5.     if(!document.trigger){
  6.  
  7.         document.trigger = true;
  8.  
  9.         var currentIndex = element.closest('div.radio').index();
  10.  
  11.         $(document).find('div.shopping-store-shipping input').attr('checked', false);
  12.  
  13.         $(document).find('div.shopping-store-shipping').each(function(){
  14.  
  15.             $(this).find('div.shipping-estimate div.radio').each(function(){
  16.  
  17.                 if($(this).index() === currentIndex){
  18.  
  19.                     $(this).find('label')[0].click();
  20.  
  21.                 }
  22.  
  23.             });
  24.  
  25.         });
  26.  
  27.         document.trigger = false;
  28.  
  29.     }
  30.  
  31. };
  32.  
  33. $(document).find('.shipping-method').on('change', function(){
  34.  
  35.     new shippingMethod($(this));
  36.  
  37. });
  38.  
  39. $(document).find('div.shipping-estimate div.radio label').on('click', function(){
  40.  
  41.     new shippingMethod($(this));
  42.  
  43. });
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top