Advertisement
borkolivic

Use View product button instead of Add to cart in shop loop

Jan 2nd, 2017
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1. // Ukloni Add to Cart Button
  2. remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 );
  3.  
  4. // Dodaj View Product Button
  5. add_action( 'woocommerce_after_shop_loop_item', 'mx_view_product_button', 10);
  6.  
  7. function mx_view_product_button() {
  8. global $product;
  9. $link = $product->get_permalink();
  10. echo do_shortcode('<a href="'.$link.'" class="button addtocartbutton">View Product</a>');
  11. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement