-
-
Save mikejolley/1597957 to your computer and use it in GitHub Desktop.
/** | |
* This code should be added to functions.php of your theme | |
**/ | |
add_filter('woocommerce_empty_price_html', 'custom_call_for_price'); | |
function custom_call_for_price() { | |
return 'Call for price'; | |
} |
um but they can still add it to cart... and buy it for free...
I am using the code for showing SOLD products. How could I create "Request a price" when setting price to 0?
This works great except for products with variations.
How can we make this work for the variants as well?
Thanks!! It worked for me, WC 3.4.4, 'Request for price' is more professional but anyway, thank you!
Good! thank, work for me
Good men! thanks
Hi,
can you advice how to create the same if you use WPML and need to have the text translated in 3 languages?
Works! Really Thanks/
For variable product use woocommerce_variable_empty_price_html //woocommerce/includes/class-wc-product-variable.php
for grouped products use woocommerce_grouped_empty_price_html //woocommerce/includes/class-wc-product-grouped.php
Thanks Mike for your code. It really works!!!
For variable product use woocommerce_variable_empty_price_html.
for variation product use woocommerce_variation_empty_price_html
I don't think that's clear. There is no variable vs variation product.
To clarify, it's either a variable product or a variation of a product (a variation is not a product).
Works great, thank you!
Reverts to 0.00 when currency changed.
Is there a fix for this?
Works for Nitro theme
hi Micheal, your code works for me. Thank you. Can you help me if i want to add "href=tel:xxxxxxx" option on Call for price? how can i add it in this code...? will appreciate your help
Thank you! Works perfectly with Enfold v3.5.4 & WooCommerce v2.5.5.