WordPress.org

Forums

WooCommerce - excelling eCommerce
Fatal error when using shortcode (5 posts)

  1. marcsoler
    Member
    Posted 1 year ago #

    When I insert the [product_category] shortcode, I get the following error on saving the content:

    Fatal error: Call to a member function get_cart() on a non-object in (...) /framework/woo-config.php on line 425

    The page is saved but the shortcode itself is displayed in a bad grid format.

    https://wordpress.org/plugins/woocommerce/

  2. marcsoler
    Member
    Posted 1 year ago #

    I'm using the Avada theme but this file isn't an overridden file

  3. terrytsang
    Member
    Posted 1 year ago #

    There are two product category shortcodes:

    1. Show multiple products in a category by slug (example: gift).

    [product_category category="gift"]

    2. Display product categories loop

    [product_categories number="12" parent="0"]

    * Set the parent paramater to 0 to only display top level categories.

  4. marcsoler
    Member
    Posted 1 year ago #

    I know... but the error appears on any WooCommerce shortcode I use the moment I save the page...

  5. terrytsang
    Member
    Posted 1 year ago #

    Hi, i think Avada child theme has some code in there, or a template override, which has broken it. I would suggest you change to other theme and have a try again.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce - excelling eCommerce
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic