Support » Plugin: WooCommerce » Critical error on product overview page

  • Resolved tomhndrx

    (@tomhndrx)


    I don’t know what happened, but suddenly my shop overview page displays a critical error. Product detail pages still work, but the overview seems to be broken.

    Any suggestions?

    Thanks!

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

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Senff – a11n

    (@senff)

    Hey @tomhndrx

    The first thing I would check is your most recent fatal error log files (under WooCommerce → Status → Logs) for error messages that may point you in the right direction.

    If that doesn’t help, I’d recommend the conflict-testing steps here to isolate the source of the issue: https://docs.woocommerce.com/document/how-to-test-for-conflicts/

    The best way to determine if the issue is being caused by a theme and/or plugin is to do the following:
    – Temporarily switch your theme back to a default theme, such as Storefront.
    – Disable all plugins except for WooCommerce.
    – Test to see if the issue has been resolved.

    If that resolves the issue, then one-by-one you can switch back your theme and re-enable your plugins, testing in between, until the problem appears again. This will then give you an idea about which plugin is the one causing the conflict.

    Hope this points you in the right direction!

    Thread Starter tomhndrx

    (@tomhndrx)

    Thanks! Apparently the issue was caused by the Gutentor plugin. I can’t disable it, because my theme heavily uses it.

    I narrowed the issue to a part of the code and just disabled that part. Everything *seems* to be fine now. But i have no idea what i disabled…

    This is the piece of code i disabled:

    * Modify cart html if gutentor-attributes set
    *
    * @static
    * @access public
    * @since 2.1.9
    * @return string
    */
    //public function alter_cart_link( $output, $product, $args ) {
    // $attributes = isset( $args[‘gutentor-attributes’] ) ? $args[‘gutentor-attributes’] : false;
    // if ( ! $attributes ) {
    // return $output;
    // }
    // $icon = ”;
    // $btnClass = isset( $attributes[‘pBtnCName’] ) ? $attributes[‘pBtnCName’] : ”;
    // $default_class = gutentor_concat_space( ‘gutentor-button’, ‘gutentor-post-button’, $btnClass );
    // $woo_class = esc_attr( isset( $args[‘class’] ) ? $args[‘class’] : ‘button’ );
    // $icon_options = ( isset( $attributes[‘pBtnIconOpt’] ) ) ? $attributes[‘pBtnIconOpt’] : ”;
    // $icon_post_options = isset( $icon_options[‘position’] ) ? $icon_options[‘position’] : ”;
    // if ( $icon_post_options == ‘before’ || $icon_post_options == ‘after’ ) {
    // $icon = ( isset( $attributes[‘pBtnIcon’] ) && $attributes[‘pBtnIcon’][‘value’] ) ? ‘<i class=”gutentor-button-icon ‘ . $attributes[‘pBtnIcon’][‘value’] . ‘” ></i>’ : ‘<i class=”gutentor-button-icon fas fa-book” ></i>’;
    // }
    // $output = ‘add_to_cart_url() ) . ‘” data-quantity=”‘ . esc_attr( isset( $args[‘quantity’] ) ? $args[‘quantity’] : 1 ) . ‘”
    // class=”‘ . gutentor_concat_space( $default_class, $woo_class, GutentorButtonOptionsClasses( $icon_options ) ) . ‘” ‘ . ( isset( $args[‘attributes’] ) ? wc_implode_html_attributes( $args[‘attributes’] ) : ” ) . ‘>
    // ‘ . $icon . ‘<span>’ . esc_html( $product->add_to_cart_text() ) . ‘</span>
    ‘;
    // return $output;

    //}

    This is the error message in the Woocommerce log:

    2020-12-29T00:49:38+00:00 CRITICAL Uncaught ArgumentCountError: Too few arguments to function Gutentor_Extend_Api::alter_cart_link(), 2 passed in /wordpress/core/5.6/wp-includes/class-wp-hook.php on line 287 and exactly 3 expected in /srv/htdocs/wp-content/plugins/gutentor/includes/tools/class-gutentor-extend-api.php:266
    Stack trace:
    #0 /wordpress/core/5.6/wp-includes/class-wp-hook.php(287): Gutentor_Extend_Api->alter_cart_link(‘<a rel=”nofollo…’, Object(WC_Product_Simple))
    #1 /wordpress/core/5.6/wp-includes/plugin.php(212): WP_Hook->apply_filters(‘<a rel=”nofollo…’, Array)
    #2 /srv/htdocs/wp-content/themes/novo/woocommerce/content-product.php(70): apply_filters(‘woocommerce_loo…’, ‘<a rel=”nofollo…’, Object(WC_Product_Simple))
    #3 /wordpress/core/5.6/wp-includes/template.php(732): require(‘/srv/htdocs/wp-…’)
    #4 /srv/htdocs/wp-content/plugins/woocommerce/includes/wc-core-functions.php(284): load_template(‘/srv/htdocs/wp-…’, false)
    #5 /srv/htdocs/wp-content/themes/novo/woocommerce/single-product/related.php(40): wc_get_template_part(‘content’, ‘product’)
    #6 /srv/htdocs/wp-content/plugins/woocommerce/includes/wc-core-functions.php(345): include(‘/srv/htdocs/wp-…’)
    #7 /srv/htdocs/wp-content/plugins/woocommerce/includes/wc-template-functions.php(1973): wc_get_template(‘single-product/…’, Array)
    #8 /srv/htdocs/wp-content/plugins/woocommerce/includes/wc-template-functions.php(1936): woocommerce_related_products(Array)
    #9 /wordpress/core/5.6/wp-includes/class-wp-hook.php(287): woocommerce_output_related_products(”)
    #10 /wordpress/core/5.6/wp-includes/class-wp-hook.php(311): WP_Hook->apply_filters(NULL, Array)
    #11 /wordpress/core/5.6/wp-includes/plugin.php(484): WP_Hook->do_action(Array)
    #12 /srv/htdocs/wp-content/themes/novo/woocommerce/content-single-product.php(108): do_action(‘woocommerce_aft…’)
    #13 /wordpress/core/5.6/wp-includes/template.php(732): require(‘/srv/htdocs/wp-…’)
    #14 /srv/htdocs/wp-content/plugins/woocommerce/includes/wc-core-functions.php(284): load_template(‘/srv/htdocs/wp-…’, false)
    #15 /srv/htdocs/wp-content/themes/novo/woocommerce/single-product.php(37): wc_get_template_part(‘content’, ‘single-product’)
    #16 /wordpress/core/5.6/wp-includes/template-loader.php(106): include(‘/srv/htdocs/wp-…’)
    #17 /wordpress/core/5.6/wp-blog-header.php(19): require_once(‘/wordpress/core…’)
    #18 /wordpress/core/5.6/index.php(17): require(‘/wordpress/core…’)
    #19 {main}
    thrown in /srv/htdocs/wp-content/plugins/gutentor/includes/tools/class-gutentor-extend-api.php on line 266

    Plugin Support Senff – a11n

    (@senff)

    Hey @tomhndrx

    If the Gutentor plugin is the cause of the errors, it’s best to reach out to the plugin’s own support team.

    While we’re experts on our own products, third party plugins are best supported by their own resp. developers (and more importantly, I’d rather not give you any incorrect information).

    It looks like that plugin’s info and support page can be found here:
    https://wordpress.org/support/plugin/gutentor/

    Thread Starter tomhndrx

    (@tomhndrx)

    Ok thanks!

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