Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. remove_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart');
  2.  
  3. remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart');
  4.  
  5. add_filter('woocommerce_is_purchasable', 'prfx_is_product_purchasbale');
  6. function prfx_is_product_purchasbale($purchasable, $product) {
  7.  
  8. // you could check agains a meta option, or maybe if a shortcode exists in this product
  9. if ($product->id == 132) {
  10. $purchasable = false;
  11. }
  12.  
  13. return $purchasable;
  14. }
  15.  
  16. <a href="<insert your home-url>/product-inquiry/?product-title=<insert your product-title>&product-id=<insert your product-id>">Product Inquiry</a>
  17.  
  18. [getparam product-title][getparam product-id]
  19. <p>Inquiry for product: [showparam product-title] ([showparam product-id]) </p>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement