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+KEFydGUsIGN1bHR1cmEsIG1lZGlvIGFtYmllbnRlIGUgaW5ub3ZhY2nDs24pPC9wPgoJCTxkaXYgY2xhc3M9ImZvb3Rlcl9mb3JtdWxhcmlvIj4KCQkJCjxkaXYgY2xhc3M9IndwY2Y3IG5vLWpzIiBpZD0id3BjZjctZjI2NjItbzEiIGxhbmc9ImVzLUVTIiBkaXI9Imx0ciIgZGF0YS13cGNmNy1pZD0iMjY2MiI+CjxkaXYgY2xhc3M9InNjcmVlbi1yZWFkZXItcmVzcG9uc2UiPjxwIHJvbGU9InN0YXR1cyIgYXJpYS1saXZlPSJwb2xpdGUiIGFyaWEtYXRvbWljPSJ0cnVlIj48L3A+IDx1bD48L3VsPjwvZGl2Pgo8Zm9ybSBhY3Rpb249Ii90aWVuZGEvY2F0ZWdvcmlhLXByb2R1Y3RvL3B1YmxpY2FjaW9uZXMvb3RyYXMtcHVibGljYWNpb25lcy8jd3BjZjctZjI2NjItbzEiIG1ldGhvZD0icG9zdCIgY2xhc3M9IndwY2Y3LWZvcm0gaW5pdCBtYWlsY2hpbXAtZXh0LTAuNS43MiIgYXJpYS1sYWJlbD0iRm9ybXVsYXJpbyBkZSBjb250YWN0byIgbm92YWxpZGF0ZT0ibm92YW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