• Resolved bahram021

    (@bahram021)


    Hello and thank you for your unique and excellent plugin
    I used the product shortcode in the posts of the WordPress website, but I get such an error in the error file, please help me

    [31-Aug-2024 11:53:50 Asia/Tehran] PHP Notice: Function product_type was called incorrectly. Product properties should not be accessed directly. Backtrace: require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), include(‘/themes/jannah/single.php’), TIELABS_HELPER::get_template_part, include(‘/themes/jannah/templates/single-post/content.php’), the_content, apply_filters(‘the_content’), WP_Hook->apply_filters, do_shortcode, preg_replace_callback, do_shortcode_tag, WC_Shortcodes::products, WC_Shortcode_Products->get_content, WC_Shortcode_Products->product_loop, wc_get_template_part, load_template, require(‘/plugins/woocommerce/templates/content-product.php’), do_action(‘woocommerce_after_shop_loop_item_title’), WP_Hook->do_action, WP_Hook->apply_filters, woocommerce_template_loop_price, wc_get_template, include(‘/plugins/woocommerce/templates/loop/price.php’), WC_Product->get_price_html, apply_filters(‘woocommerce_get_price_html’), WP_Hook->apply_filters, lw_hid in /home2/…/domains/…./public_html/wp-includes/functions.php on line 6085
    [31-Aug-2024 11:55:06 Asia/Tehran] The WC_Abstract_Legacy_Order::get_product_from_item function is deprecated since version 4.4.0. Replace with $item->get_product().

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Shameem R. a11n

    (@shameemreza)

    Hi @bahram021

    From the error messages you’ve shared, it seems like your theme is trying to access product properties directly which is not the correct way. Instead of using product_type, you should use the method get_type().

    As for the second error, WC_Abstract_Legacy_Order::get_product_from_item function has been deprecated since version 4.4.0. You should replace it with $item->get_product().

    Since Jannah is a third-party theme, It would be best to reach out to the plugin developer for further assistance. Please note that, we don’t provide help & support for 3rd-party plugins or themes as they’re outside our support scope.

    I wish I could help more, but hopefully, this gets you going in the right direction to get the job done.

    Thread Starter bahram021

    (@bahram021)

    thank you

    Can I solve this problem through a hook?

    • This reply was modified 2 months, 3 weeks ago by bahram021.
    • This reply was modified 2 months, 3 weeks ago by bahram021.
    Plugin Support ckadenge (woo-hc)

    (@ckadenge)

    Hi @bahram021,

    Can I solve this problem through a hook?

    I would recommend reaching out to your theme developer/support team for further assistance with this since assistance with custom coding is out of our support scope.

    I hope this points you in the right direction.

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