• Hi, thanks for your plugin, it’s really good. But for a few days now I have a problem when updating a product with the Divi editor, A window appears saying it couldn’t be saved, it has a retry button, if I retry, then it works.

    This is the log with the error:


    “PHP message: PHP Fatal error: Uncaught Error: Call to a member function get_meta() on false in …xxxx/wp-content/plugins/product-expiry-for-woocommerce/product-expiry-for-woocommerce.php:526
    If I

    Can you solve this?.

    Thank you

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter tlozano

    (@tlozano)

    Humm, I can see it was a conflic with Yoast Seo ver. 24. If I disable Yoast Seo it works fine. If I enable Yoast SEO and disable Product Expiry for WooCommerce it works fine too. If the product is not edited using Divi it works fine too…

    Thread Starter tlozano

    (@tlozano)

    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

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.