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+IDx1bD48L3VsPjwvZGl2Pgo8Zm9ybSBhY3Rpb249Ii90aWVuZGEvY2Fycml0by8jd3BjZjctZjI2NjItbzEiIG1ldGhvZD0icG9zdCIgY2xhc3M9IndwY2Y3LWZvcm0gaW5pdCBtYWlsY2hpbXAtZXh0LTAuNS43MiIgYXJpYS1sYWJlbD0iRm9ybXVsYXJpbyBkZSBjb250YWN0byIgbm92YWxpZGF0ZT0ibm92YWxpZGF0ZSIgZGF0YS1zdGF0dXM9ImluaXQiPgo8ZGl2IHN0eWxlPSJkaXNwbGF5OiBub25lOyI+CjxpbnB1dCB0eX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