Unhooking VAT field (no payment needed)

Top WooCommerce & WordPress Plugins Forums EU/UK VAT Manager for WooCommerce Unhooking VAT field (no payment needed)

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #105160
    Thomas Huxley
    Participant

    Hi! I have a version of my checkout that removes a lot of fields if payment isn’t required. Trying to unhook the VAT field in this instance, and using

    if(function_exists(‘alg_wc_eu_vat’)) {
    remove_filter(‘woocommerce_checkout_fields’,array(alg_wc_eu_vat(),’add_eu_vat_checkout_field_to_frontend’),PHP_INT_MAX);
    }

    But can’t seem to make it work. Any suggestions on how I can achieve this? Thanks!

    • This topic was modified 11 months ago by Omar Dabbas.
    #105161
    WPWhale
    Moderator

    Hello Thomas,
    If you’re trying to remove the field totally, I suggest you try unset instead of remove_filter, check this WC example for reference.
    Let me know how it goes.
    Omar

    #105162
    WPWhale
    Moderator

    If that didn’t work, please try your code, with this edit:

    remove_filter( 'woocommerce_checkout_fields', array( alg_wc_eu_vat()->core, 'add_eu_vat_checkout_field_to_frontend' ), PHP_INT_MAX );

    Omar

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