• Resolved amanda3ip

    (@amanda3ip)


    Hi,

    i’m working in a local environemnt. And when I install your plguin and go to product page, I wave this error:

    PHP Notice: id was called **incorrectly**. Product properties should not be accessed directly. Backtrace: require(‘C:\wamp64\www\agora-sanitaria-portal\web\wp-blog-header.php’), require_once(‘C:\wamp64\www\agora-sanitaria-portal\web\wp-includes\template-loader.php’), include(‘C:\wamp64\www\agora-sanitaria-portal\web\wp-content\themes\portalagora\woocommerce.php’), woocommerce_content, wc_get_template_part, load_template, require(‘C:\wamp64\www\agora-sanitaria-portal\web\wp-content\themes\portalagora\woocommerce\content-single-product.php’), do_action(‘woocommerce_after_single_product’), WP_Hook->do_action, WP_Hook->apply_filters, SWF_Favourites_Button::display_button, SWF_Favourites_Button::should_show, WC_Abstract_Legacy_Product->__get, wc_doing_it_wrong Please see [Debugging in WordPress](https://codex.www.ads-software.com/Debugging_in_WordPress) for more information. (This message was added in version 3.0.) in C:\wamp64\www\agora-sanitaria-portal\web\wp-includes\functions.php on line 4196

    Do you have any solution?

    Thanks in advance

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jon Boss

    (@jonboss)

    Hi Amanda,

    Thanks for using the plugin! This is a notice you’re seeing and not an error. It is correct though – there is a line in the plugin that shouldn’t be accessing a property directly – but through it’s ‘get’ function. I’ll be sure to update that with the next push. However for now – you may want to disable these types of notices from appearing on your site directly. The plugin will still work correctly – its just that you’re in debug mode and printing notices out on the page.

    To avoid that, I would recommend:

    In your site’s wp-config.php file, you can update your settings for debug mode. Your probably have something like this:

    define( ‘WP_DEBUG’, true );
    define( ‘WP_DEBUG_DISPLAY’, true );

    What I normally do is log any errors to a debug file so I can see them easily, but they don’t print out on my page, like this:

    define( ‘WP_DEBUG’, true );
    define( ‘WP_DEBUG_DISPLAY’, false );
    define( ‘WP_DEBUG_LOG’, true );

    You’ll certainly want that for a production site anyway – if not your local environment! But again – perfectly legitimate notice, and I’ll make sure this gets updated.

    Jon

    Thread Starter amanda3ip

    (@amanda3ip)

    Ok,
    I change debbug options and now, doesn’t appear the warning.
    thanks in advance

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Error in product page’ is closed to new replies.