Hi Lorro, I am still trying to remove the ‘Free!’ from the product page when I add ‘0.00’ to either my variable or single product regular price conditions.
The code you supplied above will replace the text, but then the ‘add to cart button’ does not appear, so the product cannot be added to cart.
The variable price field has to be completed by default and when 0.00 is added the text Free! appears under the product description. I need to be able to change this to something more appropriate.
I think I have found the source php code here: and I changed the condition ‘Free!’ to ‘Select’ but this does not display in the page.
Editing woocommerce/includes/class-wc-product-variation.php (inactive)
/**
* Get variation price HTML. Prices are not inherited from parents.
*
* @return string containing the formatted price
*/
public function get_price_html( $price = '' ) {
$display_price = $this->get_display_price();
$display_regular_price = $this->get_display_price( $this->get_regular_price() );
$display_sale_price = $this->get_display_price( $this->get_sale_price() );
if ( $this->get_price() !== '' ) {
if ( $this->is_on_sale() ) {
$price = apply_filters( 'woocommerce_variation_sale_price_html', '<del>' . wc_price( $display_regular_price ) . '</del> <ins>' . wc_price( $display_sale_price ) . '</ins>' . $this->get_price_suffix(), $this );
} elseif ( $this->get_price() > 0 ) {
$price = apply_filters( 'woocommerce_variation_price_html', wc_price( $display_price ) . $this->get_price_suffix(), $this );
} else {
$price = apply_filters( 'woocommerce_variation_free_price_html', __( 'SELECT', 'woocommerce' ), $this );
}
} else {
$price = apply_filters( 'woocommerce_variation_empty_price_html', '', $this );
}
return apply_filters( 'woocommerce_get_variation_price_html', $price, $this );
}
Perhaps there is some more code relating to this.
I will leave the site accessible this evening.
https://www.thaikitcheninlakeland.co.uk/cedars/product/vegetable-tempura/
Thanks