add_filter('woocommerce_get_price_html', 'ocultar_precio_sin_existencias', 10, 2);
function ocultar_precio_sin_existencias($price, $product) {
if (!$product->is_in_stock()) {
return '';
}
return $price;
}
hola
Cgk8ZGl2IGNsYXNzPSJmb290ZXJfc3VzY3JpYmV0ZSIgc3R5bGU9IiI+CgkJPHAgc3R5bGU9ImNvbG9yOiMwMDA7IGZvbnQtd2VpZ2h0OjYwMDsgbGluZS1oZWlnaHQ6IDEuMjVyZW07IG1hcmdpbjogMDsiPlF1aWVybyByZWNpYmlyIGxhIHByb2dyYW1hY2nDs24gZGUgbGEgRnVuZGFjacOzbiBDYW5hbDwvcD4KCQk8cCBzdHlsZT0iY29sb3I6IzAwMDsgbWFyZ2luLWJvdHRvbToxMHB4OyI+KEFydGUsIGN1bHR1cmEsIG1lZGlvIGFtYmllbnRlIGUgaW5ub3ZhY2nDs24pPC9wPgoJCTxkaXYgY2xhc3M9ImZvb3Rlcl9mb3JtdWxhcmlvIj4KCQkJCjxkaXYgY2xhc3M9IndwY2Y3IG5vLWpzIiBpZD0id3BjZjctZjI2NjItbzEiIGxhbmc9ImVzLUVTIiBkaXI9Imx0ciI+CjxkaXYgY2xhc3M9InNjcmVlbi1yZWFkZXItcmVzcG9uc2UiPjxwIHJvbGU9InN0YXR1cyIgYXJpYS1saXZlPSJwb2xpdGUiIGFyaWEtYXRvbWljPSJ0cnVlIj48L3A+IDx1bD48L3VsPjwvZGl2Pgo8Zm9ybSBhY3Rpb249Ii90aWVuZGEvP21heF9wcmljZT01MCYjMDM4O21pbl9wcmljZT0wJiMwMzg7b3JkZXJieT1tZW51X29yZGVyI3dwY2Y3LWYyNjYyLW8xIiBtZXRob2Q9InBvc3QiIGNsYXNzPSJ3cGNmNy1mb3JtIGluaXQgbWFpbGNoaW1wLWV4dC0wLjUuNzIiIGFyaWEtbGFiZWw9IkZvcm11bGFyaW8gZGUgY29udGFjdG8iIG5vdmFsaWRhdGU9Im5vdmFsaWRhdGUiIGRhdGEtc3RhdHVzPSJ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