title: How do i link my "add to cart" button to a specific on page tab and scroll to it when clicked?
body: <p><a href="https://stackoverflow.com/questions/34742552/how-to-change-woocommerce-add-to-cart-button-based-on-availability">Previously</a> I was trying to create and alternate "add to cart" button on the single-product-page of a Woocommerce website.  Now, I would like that button to link to a tab on the same page, have the page scroll down and switch to that tab when the button is clicked. </p>
  
  <p><a href="http://jsfiddle.net/Pr9hj/" rel="nofollow noreferrer">This</a> is exactly what I need to happen but I do no know how to implement it in the wordpress setting. </p>
  
  <p>So I settled for creating a js script by suggestion of this <a href="https://wordpress.org/support/topic/how-to-link-to-a-product-tab?replies=18" rel="nofollow noreferrer">place</a></p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      if ( location.href.match(/#tab-reviews/g) !== null ) {
          jQuery( '#tab-reviews' ).show();
          jQuery( 'li.reviews_tab a' ).trigger('click');
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>Then I called it into word press through the funtion.php file with this, but its not working.</p>
  
  <pre><code>function tab_scroll() {
  wp_enqueue_script('custom-script', 
      get_stylesheet_directory_uri() . '/tab_scroll.js', 
      array( 'jquery' ));
  }
  add_action( 'wp_enqueue_scripts', 'tab_scroll' );
  </code></pre>
  
  <p>I dont know if its the way i called the script or just that the script is not written to suit my needs or even written properly</p>
  
  <p>What I would like is some help/suggestions on making the <a href="http://jsfiddle.net/Pr9hj/" rel="nofollow noreferrer">first</a> script work for me. And help on bringing into wordpress.</p>