Home / Archive / MemberPress: Tax Only UK
Duplicate Snippet

Embed Snippet on Your Site

MemberPress: Tax Only UK

This code snippet will apply taxes only for UK customers when Taxes are enabled in MemberPress Settings. This code snippet will check the country entered at checkout, and apply taxes if the country code matches GB. If the country code does not match Great Britain (GB), no tax will be applied.

Code Preview
php
<?php
function mepr_cust_tax_only_uk( $tax_rate, $country, $state, $postcode, $city, $street, $user, $prd_id ) {
  if ( $country != 'GB' ) {
    $tax_rate->tax_rate = 0.0;
  }
  return $tax_rate;
}
add_filter( 'mepr_find_tax_rate', 'mepr_cust_tax_only_uk', 99, 8 );

Comments

Add a Comment