Advertisement
Guest User

Untitled

a guest
Mar 19th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $('.ct-variable-carousel').each(function(){
  2.     var $this = $(this);
  3.  
  4.     $this.on('slid.bs.carousel', function(){
  5.        var $this = $(this);
  6.        var $activeSlide = $this.find('.active');
  7.        var $id = $activeSlide.attr('data-variation-id');
  8.        var $price = $activeSlide.attr('data-regular-price');
  9.        
  10.        if($id){
  11.            $this.parent().find('a.variable_data_button').attr('href', '/?add-to-cart=' + $id);
  12.            $this.parent().find('span.woocommerce-Price-amount.amount').text($price);
  13.        }
  14.     });
  15.    
  16. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement