Skip to content

Instantly share code, notes, and snippets.

@stephenscaff
Last active December 31, 2015 00:59
Show Gist options
  • Save stephenscaff/7911451 to your computer and use it in GitHub Desktop.
Save stephenscaff/7911451 to your computer and use it in GitHub Desktop.
Filter / function for the Woo Commerce plugin (wordpress). If no price is set, let's output a custom Call For Price (or whatevers). Goes in /woocommerce/woocommerce-hooks.php, but should also work out in your functions.php. Saw that a few peeps created plugins for this idea, but that's kinda retardery, since it's such a simple and tiny solution.
/* Call for price filter */
add_filter('woocommerce_empty_price_html', 'custom_call_for_price');
function custom_call_for_price() {
return 'Call for price: 1-800-your-mum';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment