SHARE
TWEET

Untitled

a guest Dec 27th, 2012 164 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  add_action('woocommerce_after_add_to_cart_button', 'nme_wc_after_add_to_cart_button');
  2.     add_action('nme_wc_facebook_like_button', 'nme_wc_after_add_to_cart_button');
  3.  
  4.     function nme_wc_after_add_to_cart_button() {
  5.         echo '<div id="fb-root"></div>
  6.         <script>(function(d, s, id) {
  7.         var js, fjs = d.getElementsByTagName(s)[0];
  8.         if (d . getElementById(id))
  9.             return;
  10.         js = d . createElement(s);
  11.         js.id = id;
  12.         js.src = "//connect.facebook.net/en_US/all.js#xfbml=1";
  13.         fjs . parentNode . insertBefore(js, fjs);
  14.     }
  15.  
  16.         (document, "script", "facebook-jssdk"));</script>
  17.  
  18.     <div class="fb-like" style="float:left; margin-top:12px;" data-href="https://www.facebook.com/HotTotHaircare" data-send="false" data-width="250" data-show-faces="true"></div>';
  19.     }
  20.  
  21.     add_action('woocommerce_before_add_to_cart_button', 'nme_wc_before_add_to_cart_button');
  22.  
  23.     function nme_wc_before_add_to_cart_button() {
  24.         global $post;
  25.         echo '<p class="share-icons">
  26.         <span class="st_sharethis" st_title="' . get_the_title($post->ID) . '" st_url="' . get_permalink($post->ID) . '" displayText="ShareThis"></span>
  27.         </p>';
  28.         echo '<input type="hidden" name="add_to_cart" value="' . $post->ID . '">';
  29.     }
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