Support » Plugin: Woo Mercado Pago Module Oficial » WooCommerce 3.0 – Notice: Product properties should not be accessed directly

  • Resolved naahuel

    (@naahuel)


    After upgrading to WooCommerce 3.0 today, the whole store is filled with notice errors:

    Notice: id was called incorrectly. Product properties should not be accessed directly. Please see Debugging in WordPress for more information. (This message was added in version 3.0.)
    
    Notice: post was called incorrectly. Product properties should not be accessed directly. Please see Debugging in WordPress for more information. (This message was added in version 3.0.)

    Disabling the plugin (Woo Mercado Pago Module Oficial) stops the errors.

    $product->id is used a lot in the code of this plugin. This is incorrect and should be fixed.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Lo mismo por mi lado, con otras propiedades además del id, ejemplo:
    length was called incorrectly. No se debería acceder a las propiedades del producto directamente.. This message was added in version 3.0.
    width was called incorrectly. No se debería acceder a las propiedades del producto directamente.. This message was added in version 3.0.
    height was called incorrectly. No se debería acceder a las propiedades del producto directamente.. This message was added in version 3.0.
    id was called incorrectly. No se debería acceder a las propiedades del producto directamente.. This message was added in version 3.0.

    Hello, I have the same issues.

    But I think I found the error: under WooCommerce 3.0 you shouldn’t be calling to $product->id , but $product->get_id() instead. And this is happenning on several lines at file woo-mercado-pago-module\mercadopago\class-wc-product-mp_recurrent.php.

    I’m using PHP 7.0 when seeing these errors.
    Fix please.

    Yes, that is well known. I’ve submitted a very small pull request to fix the ones that were more visible:
    https://github.com/mercadopago/cart-woocommerce/pull/46

    They closed it because they were already working on it. They’ve fixed all this in their dev branch:
    https://github.com/mercadopago/cart-woocommerce/tree/dev

    I suppose they’ll be releasing it soon. In the meantime I fixed the errors myself until they release the update.

    Great. I have it deployed in dozens of sites, so I need a release really soon because I have no time to patch them manually…
    Thank you for replying.

    Is there any update to this issue, I have the problem on several sites, and am unable to find which plugin is causing the issue.

    This is fixed now.

    Plugin Author Mercado Pago

    (@mercadopago)

    Guys,

    This problem was related to supports on the new WooCommerce 3.x.
    I think that v2.2.1 onwards fixes it. Any problems, please notify us.

    Regards!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘WooCommerce 3.0 – Notice: Product properties should not be accessed directly’ is closed to new replies.