Next code will do the job:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | add_filter('woocommerce_get_price_html', 'fbs_woocommerce_get_price_html', 100, 2); function fbs_woocommerce_get_price_html($price, $product) { if ($product->price <= 0) { //remove_action('woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10); //remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30); return 'Call for Price'; } else { return $price; } } |
