I was testing, and if I change the code of wp-content/plugins/product-expiry-for-woocommerce/product-expiry-for-woocommerce.php (Around lines 526) to this:
if($savedSettings['display'] == 'enable'){
$product = wc_get_product();
/** $expiryDate = $product->get_meta('woo_expiry_date'); **/
if ($product && is_object($product)) {
$expiryDate = $product->get_meta('woo_expiry_date');
} else {
$expiryDate = null; // O establece un valor predeterminado adecuado
}
/** $expiryNote = $product->get_meta('woo_expiry_note'); **/
if ($product && is_object($product)) {
$expiryNote = $product->get_meta('woo_expiry_note');
} else {
$expiryNote = null; // O un valor predeterminado que tenga sentido para tu caso
}
if($expiryNote != ''){
echo '<p class="woope-notice">'.$expiryNote.'</p>';
} elseif ($expiryDate != '') {
$dateFormat = $savedSettings['date_format'];
$formattedDate = date($dateFormat, strtotime($expiryDate));
$text = str_replace("%date%", $formattedDate, $savedSettings['markup']);
$text = apply_filters('wpml_translate_single_string', $text, 'product-expiry-for-woocommerce', 'date-markup' );
echo '<p class="woope-notice">'.$text.'</p>';
}
/** if ($product->is_type('variable')) {
echo '<p class="woope-variable-notice"></p>';
} **/
if ($product && is_object($product) && $product->is_type('variable')) {
echo '<p class="woope-variable-notice"></p>';
}
It works fine (I have to more test).
Thank you