• Resolved pimwick

    (@pimwick)


    Hello,

    We are another plugin developer that has encountered a conflict with your plugin. The core of the issue is the use of PHP_INT_MAX for the priority of the woocommerce_after_calculate_totals hook.

    Is it possible for you to change this to a defined constant so that it can be controlled via wp-config.php ?

    Or can you add a do_action() at the end of your calculations so that other plugins can still function with this plugin is installed? As it stands, our gift cards plugin breaks when your plugin is installed and I can’t find a way around it currently.

    We’re open to any suggestions on how to have your plugin play nice with ours!

Viewing 15 replies - 16 through 30 (of 31 total)
  • Thread Starter pimwick

    (@pimwick)

    Thank you for quickly providing a resolution! We just released an update to the PW WooCommerce Gift Cards plugin that takes advantage of the fix.

    Plugin Author algol.plus

    (@algolplus)

    you’re welcome

    I am in the process of evaluating the Gift Cards plugin running on a local staging server that has error messages being displayed. I am using the Advanced Dynamic Pricing plugin and unless I disable it I see the error message:

    “Notice: Undefined variable: redeem_hook_priority …htdocs\wp-content\plugins\pw-woocommerce-gift-cards\includes\pw-gift-cards-redeeming.php on line 41

    and the checkout hangs.

    I believe that you may have a mistake in your fix, shouldn’t:
    add_filter( ‘wdp_calculate_totals_hook_priority’, function( $priority ) { return $redeem_hook_priority – 1; });

    be:

    add_filter( ‘wdp_calculate_totals_hook_priority’, function( $priority ) { return $priority – 1; });

    Note: $priority not $redeem_hook_priority

    • This reply was modified 4 years, 5 months ago by brookerrj.
    Plugin Author algol.plus

    (@algolplus)

    Hello

    I think they missed “use($redeem_hook_priority)”.

    Thread Starter pimwick

    (@pimwick)

    We just released v1.132 which fixes this warning message. To get the update:

    1. Log into your WordPress Admin area.
    2. Click on Plugins -> Installed plugins.
    3. Scroll down to PW WooCommerce Gift Cards and click “Check for updates.”
    4. The page will refresh, then scroll back down and click on “Update.”

    Let us know if you have any other issues!

    Plugin Author algol.plus

    (@algolplus)

    Hello

    you have variable $redeem_hook_priority = 40; in file pw-gift-cards-redeeming.php

    so I think correct code should be

    add_filter( ‘wdp_calculate_totals_hook_priority’, function( $priority ) use($redeem_hook_priority) { return $redeem_hook_priority - 1; });

    • This reply was modified 4 years, 5 months ago by algol.plus.
    • This reply was modified 4 years, 5 months ago by algol.plus.
    Thread Starter pimwick

    (@pimwick)

    Ah, good catch! We have just verified the change and released an update.

    My evaluation is continuing now, the issue appears to be resolved with the latest Version 1.134. Many thanks.

    Plugin Author algol.plus

    (@algolplus)

    you’re welcome

    Thread Starter pimwick

    (@pimwick)

    It seems this hook is gone in v3.0.1 and is causing problems again, can you check?

    Plugin Author algol.plus

    (@algolplus)

    ops, we’ll re-add it asap

    Plugin Author algol.plus

    (@algolplus)

    hi @pimwick

    Could you install development version and check if the bug was fixed?

    Visit https://www.ads-software.com/plugins/advanced-dynamic-pricing-for-woocommerce/advanced/ , scroll to bottom and download it.

    Thread Starter pimwick

    (@pimwick)

    I just confiremd that the development version (3.0.2) does work, thanks

    Plugin Author algol.plus

    (@algolplus)

    ok, thank you for testing

    Plugin Author algol.plus

    (@algolplus)

    this problem has been fixed in version 3.0.2

Viewing 15 replies - 16 through 30 (of 31 total)
  • The topic ‘Priority PHP_INT_MAX for woocommerce_after_calculate_totals’ is closed to new replies.