• Resolved clairedelune

    (@clairedelune)


    Help please ~ I am not a developer so have no idea how to fix this…

    I have been noticing a persistent Fatal Error in the WC error logs using a snippet from Woocommerce in the Code Snippets plugin: Allow shortcodes in product excerpts.

    I have checked and rechecked that the code has been saved correctly with no success in resolving the error. The full error report is displayed below.

    Scratching my head: how do I resolve this?

    With many, many thanks in advance.

    2022-08-09T15:36:05+00:00 CRITICAL Uncaught ArgumentCountError: Too few arguments to function woocommerce_template_single_excerpt(), 0 passed in /home/mysite/public_html/wp-content/plugins/woocommerce/includes/class-wc-embed.php on line 81 and exactly 1 expected in /home/mysite/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(484) : eval()'d code:2
    Stack trace:
    #0 /home/mysite/public_html/wp-content/plugins/woocommerce/includes/class-wc-embed.php(81): woocommerce_template_single_excerpt()
    #1 /home/mysite/public_html/wp-includes/class-wp-hook.php(307): WC_Embed::the_excerpt()
    #2 /home/mysite/public_html/wp-includes/plugin.php(191): WP_Hook->apply_filters()
    #3 /home/mysite/public_html/wp-includes/embed.php(1017): apply_filters()
    #4 /home/mysite/public_html/wp-includes/theme-compat/embed-content.php(101): the_excerpt_embed()
    #5 /home/mysite/public_html/wp-includes/template.php(772): require('/home/mysite...')
    #6 /home/mysite/public_html/wp-includes/template.php(716): load_template()
    #7 /home/mysite/public_html/wp-includes/general-template.php(204): locate_template()
    #8 /home/mysite/public_html/wp-includes/theme-compat/embed.php(18): get_template_part()
    #9 /home/mysite/public_html/wp-includes/template-loader.php(106): include('/home/mysite...')
    #10 /home/mysite/public_html/wp-blog-header.php(19): require_once('/home/mysite...')
    #11 /home/mysite/public_html/index.php(17): require('/home/mysite...')
    #12 {main}
      thrown in /home/mysite/public_html/wp-content/plugins/code-snippets/php/snippet-ops.php(484) : eval()'d code on line 2

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi @clairedelune

    Thanks for sharing the error logs – there seems to be some template overriding issues. In order for us to get a better idea of your setup, could you please share a copy of your site’s System Status? You can find it via WooCommerce > Status. Select “Get system report” and then “Copy for support”. Once you’ve done that, paste it here in your response.

    Just to confirm – are you getting the error only from that particular snippet? I mean if you remove or disable the snippet then the error no longer occurs? If so, then that snippet may need to be looked into. You can share it on https://gist.github.com/ or https://pastebin.com/ and post the link to that in this thread. Although support for custom coding is beyond the scope of support we are able to provide in this forum, we will take a preliminary look to see if it can be resolved.

    Thread Starter clairedelune

    (@clairedelune)

    Thank you @margaretwporg, I will test disabling the snippet tomorrow and see whether or not the errors are still generating.

    Thread Starter clairedelune

    (@clairedelune)

    Two things:

    1. Deactivating the snippet stopped the errors from generating; and
    2. The theme installed on my site does not support product excerpts so I am thinking that was the source of the problem?
    3. What do you think of point 2.?

      Many thanks in advance.

    Mirko P.

    (@rainfallnixfig)

    Hi there!

    What do you think of point 2.?

    You might want to try switching the theme to one of the default themes like Storefront or Twenty Twenty-Two and check if the error is no longer shown.

    If so, it’s an issue related to the theme and the theme author may assist you with a fix.

    Cheers.

    Thread Starter clairedelune

    (@clairedelune)

    Thank you for the feedback @rainfallnixfig.

    I will try changing the theme and see monitor and see if that fixes the problems.

    Many thanks again.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Fatal error using snippet > Allow shortcodes in product excerpts’ is closed to new replies.