• Resolved narmour

    (@narmour)


    I had added the code give in this post: https://ww.wp.xz.cn/support/topic/include-product-notes-in-admin-emails/#post-13925293 two weeks ago with no issues, until a week later. WordPress sent an email saying:

    Your Site is Experiencing a Technical Issue

    They said the error was caught on this page:
    wp-admin/admin-ajax.php

    Error Details
    =============
    An error of type E_PARSE was caused in line 781 of the file functions.php. Error message: syntax error, unexpected ‘&’

    Line 781 is this section of the code that was provided for adding the purchase notes to the admin emails:

    add_filter (‘woocommerce_email_order_items_args’, ‘send_purchase_note_to_everyone’);

    I haven’t seen any issues on the site, it seems to be working fine and the admin panel is working fine. Is there something I need to change with the code to fix this?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Nicola Mustone

    (@nicolamustone)

    Automattic Happiness Engineer

    Hello there,
    The error must be coming from something else as the code does not have any & in it.

    Checking the script from the link, it looks very straight forward and with no errors.

    Do you have other custom code on your site?

    Thread Starter narmour

    (@narmour)

    Yes, but there was never any error message till now. This was the only new thing added in several months.

    Why would their error message reference a specific line of code if it’s not where the issue is located?

    I don’t understand why it would even be a week go by with no error and then suddenly claim an error.

    Plugin Support Damianne P (a11n)

    (@drwpcom)

    Hi @narmour. Sorry that we missed your last post.

    Did you check line 781 of functions.php? You can also try adding the code snippet to the site using Code Snippets instead of adding it to functions.php.

    Plugin Support Damianne P (a11n)

    (@drwpcom)

    Hi @narmour. We haven’t heard from you in a while so I’m going to go ahead and mark this thread as resolved. If you still need help with this issue or have any other questions about the WooCommerce plugin, please start a new thread.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Syntax error, type E_PARSE’ is closed to new replies.