Jump to content

Configuring wholesaler group with specific tax


SublimeVizion

Recommended Posts

Hi all. I've set up a "wholesale" customer group with its own .5% sales tax. I've noticed that sometimes paypal will not include the tax. It's funny but it's usually when there are 3 items in the shopping cart. When i have 2 or 4 items paypal will show and include the tax. It only happens with my customers under the wholesale group, paypal works fine with the regular customers tax. This is the code i used and put the Tax.php file into override/classes/tax...

 
public static function getProductTaxRate($id_product, $id_address = null, Context $context = null)
{
  if ($context == null)
    $context = Context::getContext();
 
$address = Address::initialize($id_address);
$groups = Customer::getGroupsStatic((int)($address->id_customer));
$taxratenew = null;
foreach ($groups as $g) {
if ($g == 5) {           
$taxratenew = .5; 
[spam-filter]
  if (!$taxratenew) {
  $id_tax_rules = (int)Product::getIdTaxRulesGroupByIdProduct($id_product, $context);
  $tax_manager = TaxManagerFactory::getManager($address, $id_tax_rules);
  $tax_calculator = $tax_manager->getTaxCalculator();
  $taxratenew = $tax_calculator->getTotalRate();
}
  return $taxratenew;
}
 
 
Anybody know why paypal sometimes excludes the tax for wholesalers??? Thanks in advance.
 
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...