• Resolved ucsendre

    (@ucsendre)


    Hello,

    I got the following server-side fatal error after updating site theme:

    PHP Fatal error: Cannot redeclare function get_product_name() (previously declared in /wp-content/themes/consulting/admin/admin-notifications-popup/admin-notification-popup.php:14) in /wp-content/plugins/woocommerce-delivery-notes/includes/wcdn-template-functions.php on line 894

    I have checked the wcdn-template-functions.php file and found that almost every function name begins with ‘wcdn_‘ except the last ones. I have added the ‘wcdn_‘ prefix to those function names, changed all occurences in your plugin’s files and now everything works fine.
    Plesae find the list of changes I have made and include it in the next update release:

    \includes\wcdn-template-functions.php file:

    line 894
    get_product_name -> wcdn_get_product_name
    (used at: all files in \includes\admin\views\Preview_template folder, all files in subfolders of \templates folder)

    line 996
    get_adjusted_quantity -> wcdn_get_adjusted_quantity

    (used at: all files in \includes\admin\views\Preview_template folder, all files in subfolders of \templates folder)

    line 1010
    add_guest_access_token_to_order -> wcdn_add_guest_access_token_to_order

    (used at: wcdn-template-hooks.php line 35)

    line 1021
    add_guest_access_token_to_order_blocks -> wcdn_add_guest_access_token_to_order_blocks

    (used at: wcdn-template-hooks.php line 36)

    line 1032
    add_guest_access_token -> wcdn_add_guest_access_token

    (used at: lines 1012 and 1023)

    Thank you!

    Best regards,
    Endre

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author priyankajagtap

    (@priyankajagtap)

    Hi @ucsendre,

    Thank you for reaching out and for providing detailed information about the issue.

    We appreciate your initiative in resolving the conflict by prefixing the functions with wcdn_. To ensure that this change is incorporated into an official update, we will review your modifications and consider including these updates in the next release of our plugin.

    In the meantime, you may continue using your patched version of the plugin. However, please note that custom modifications may be overwritten during future updates, so we recommend keeping a record of your changes. We will inform you once we have released these changes in our plugin update.

    Do let us know if you have any queries.

    Thread Starter ucsendre

    (@ucsendre)

    Hi @priyankajagtap

    Thank you for the positive response.
    Yes, I am aware of the drawbacks of custom code modifications. That is why I asking you to include those in the official release if it is possible.

    Best regards,
    Endre

    Plugin Author priyankajagtap

    (@priyankajagtap)

    Hi @ucsendre,

    Yes, I can understand your concern. We will include this suggested patch in the next update of our plugin, and we will inform you once it is released.

    Feel free to reach out if you have any further questions.

    Plugin Author priyankajagtap

    (@priyankajagtap)

    Hi @ucsendre,

    Could you please send us an email at ‘support at tychesoftwares dot com’ with a copy of your active theme? So when we include these changes in our plugin, we can do thorough testing before the update is released.

    We look forward to your response.

    Thread Starter ucsendre

    (@ucsendre)

    Hi @priyankajagtap

    I have sent the theme to your email.
    I had to use wetransfer as gmail did not allow this kind of files to be attached.

    Thank you!

    Best regards,
    Endre

    Plugin Author priyankajagtap

    (@priyankajagtap)

    Hi @ucsendre,

    Thank you for sharing the theme copy with us.

    We will test our plugin with it once before releasing an update.

    Do let us know if you have any further queries.

    Plugin Author priyankajagtap

    (@priyankajagtap)

    Hi @ucsendre,

    I’m pleased to inform you that we’ve released version 5.6.0 of our Print Invoice & Delivery Notes for WooCommerce plugin. This update includes the patch you mentioned. Kindly update the plugin to the latest version (v5.6.0) at your earliest convenience, and feel free to reach out if you have any further questions or need assistance.

    Thread Starter ucsendre

    (@ucsendre)

    Hello @priyankajagtap

    I have updated the plugin on all sites we are using it and I can confirm it works all fine.

    Thank you!

    Best regards,
    Endre

    Plugin Author priyankajagtap

    (@priyankajagtap)

    Hi @ucsendre,

    Thank you for the update and for confirming that everything is working smoothly.

    If you have any further questions or need assistance with anything, feel free to reach out.

    If you like our plugin and our service, then it would be great if you could give us a review here. That would help us immensely.

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

The topic ‘function name conflict with theme – solution included’ is closed to new replies.