tommyosheawebdesign

WooCommerce Add Price On Application

Aug 3rd, 2021 (edited)
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1. // Change empty (not zeroed) prices to "Price on application"
  2. add_filter('woocommerce_empty_price_html', 'noprice_callout');
  3.  
  4. function noprice_callout() {
  5.     if ( is_product() ) {
  6.         // return a link ONLY when viewing the product page
  7.         return '<a href="contactus.php">Contact Us for the price</a>';
  8.     } else {
  9.         // otherwise return some standard text
  10.         return 'Price on application';
  11.     }
  12. }
  13.  
Add Comment
Please, Sign In to add comment