• Hi,

    I get this error when trying to re-send an email order and it points back to OceanWP Child:

    Fatal error: Uncaught Error: method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given
    in?/home/customer/www/foxfashioncyprus.com/public_html/wp-content/themes/oceanwp-child-theme-master/functions.php?on line?124

    SCR https://ibb.co/4j0sJsJ

    https://ibb.co/3M5fKB9

    Line 124:

        if ( method_exists( $item['product'], 'get_description' ) ) {

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello @mgz069,

    Thank you for reaching out,
    And sorry to hear you have been experiencing problems, but this is unrelated to OceanWP or OceanWP child theme usage.

    You are having problems with custom code added into the child theme, which potentially involves WooCommerce or some other eCommerce plugin? Of course, the problem is related to incorrect PHP usage.

    I would recommend seeking guidance from the code source / plugin author, depending on what you’re actually trying to achieve.

    Check this topic on reference how you can modify the code to function properly: https://www.ads-software.com/support/topic/fix-argument-1-object_or_class-must-be-of-type-objectstring/

    Example:
    from:
    if ( method_exists( $cart_item, 'get_product' ) )
    to:
    if ( is_object( $cart_item ) && method_exists( $cart_item, 'get_product' ) )

    I hope it helps.
    Best Regards

    Thread Starter Johny English

    (@mgz069)

    Ok will try that

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