Is this plugin compatible with Price Based on Country for WooCommerce plugin?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #93157
    Martin Majernik

    Hi support team,

    First of all, thank you for a great plugin. It works tromendously for our scenario. One question. We’re using CheckoutWC plugin together with Price Based on Country.

    We would like to force to refresh Min. error/notice message when customer changes Country / Region in Shipping Address field to reflect correct currency based on C/R.

    Unfortunately, an option “Refresh the notice if something changes at checkout form” doesn’t work for us.
    Is there any snippet we can use to force the refresh extra?



    Plugin Support

    Thanks ๐Ÿ™‚

    You could try to update totals if the country/region field changes. It’s supposed to do that by default but maybe there could be something disabling it. This is the code you’d need to do that:

    add_filter( 'woocommerce_checkout_fields', function ( $fields_sections ) {
       $fields_sections['billing']['billing_country']['class'][] = 'update_totals_on_change';
       return $fields_sections;
    }, PHP_INT_MAX );

    Anyway, the “Force refresh” option is using the woocommerce_review_order_after_order_total' hook and I just tested it here and it worked. I mean, when the country changes, the notice is refreshed.

    Maybe if it’s possible for you to test another hook as 'woocommerce_review_order_before_submit' you could have more luck.

    I’ll add a new option for you on the next version allowing to choose the hook.

    Plugin Support

    Hi again Martin,

    I created an option for you on version 4.1.2 I just released.
    Now it will be possible to choose the hook used on the “Force refresh” option. You can find it right below the “Force refresh” option.

    And I’m also adding the 'update_totals_on_change' class to some country and address fields.

    I hope it helps ๐Ÿ˜‰

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