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+IDx1bD48L3VsPjwvZGl2Pgo8Zm9ybSBhY3Rpb249Ii90aWVuZGEvY2F0ZWdvcmlhLXByb2R1Y3RvL3B1YmxpY2FjaW9uZXMvY2llbnRpZmljby1kaXZ1bGdhdGl2YXMvP2ZiY2xpZD1Jd1pYaDBiZ05oWlcwQ01URUFBUjE0ZUtnMkZ3NENfSm9OS0hMaXZLZVFrOGtjUEptVUEtYnJ0U3g3ZWJ4RldnczA3QWN3Z0VQM29KUV9hZW1fbE5rNS1ZcGxmOWhOVDFQQ0puVDctdyN3cGNmNy1mMjY2Mi1vMSIgbWV0aG9kP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