• Resolved WeDev.Africa

    (@mad2kx)


    Hello, I am trying to hide the Tax Line item from PDF if they are outside of my store’s country. I tried the following but it does not work

    function hide_subtotal_for_non_za_customers() {
    if (is_admin()) {
    return; // Only apply on the front-end
    }

    $billing_country = WC()->customer->get_billing_country();

    if ($billing_country !== ‘ZA’) {
    add_filter(‘wpo_wcpdf_order_subtotal’, ‘__return_false’);
    }
    }
    add_action(‘template_redirect’, ‘hide_subtotal_for_non_za_customers’);

    • This topic was modified 1 year, 9 months ago by WeDev.Africa.
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Hide Tax and subtotal for customers outside of store billing country’ is closed to new replies.