Tax Rate Based On Purchaser's Location

Hi Guys,

First off, thanks for all of the efforts on Marketpress. It's looking to have been well worth the wait!

There is only one thing that I need to sort out before I go live with my new store. The current shopping cart that I am using ( http://beanstream.com ) adjusts tax rates based on purchaser's location.

My understanding is ( anyone feel free correct me if this is wrong ), according to Canadian tax law, online businesses in Canada need to apply tax rates based on purchaser's location. So if the purchaser lives in BC and our business is in AB, the purchaser would be required to pay BC tax rates.

If this is true, is there any way to configure Marketpress to apply tax rates according to purchaser location?

I don't mind doing some coding ( I've already built a payment gateway plugin for Beanstream ), so just looking for some guidance/suggestions.

Shaun

• brentjohner

I found the mp code that already has tax logic split out by country.

The case statement for Canada does not seem correct. It assumes a constant tax rate regardless of purchaser's province.

Does it make sense to change the tax logic for Canada in the core of marketpress to accurately reflect Canadian tax law? If so, a simple change something like this would do:

REPLACE

``````case 'CA':
//Canada tax is for all orders in country. We're assuming the rate is a combination of GST/PST/etc.
if (\$country == 'CA')
\$price = round(\$total * \$settings['tax']['rate'], 2);
break;``````

WITH

``````case 'CA':
//Canada tax is for all orders in country. We're assuming the rate is a combination of GST/PST/etc. * MAYBE WE SHOULD ASSUME THE RATE IS JUST GST?
if (\$country == 'CA')
{
\$taxRate = \$settings['tax']['rate']; //GST
if (\$state == 'SK')
{
\$taxRate += 0.05;
}
else if (\$state == 'BC' || \$state == 'MB')
{
\$taxRate += 0.07;
}
else if (\$state == 'NB' || \$state == 'NL' || \$state == 'ON')
{
\$taxRate += 0.08;
}
else if (\$state == 'QC')
{
\$taxRate += 0.08925;
}
else if (\$state == 'NS')
{
\$taxRate += 0.10;
}
else if (\$state == 'PE')
{
\$taxRate += 0.105;
}

\$price = round(\$total * \$taxRate, 2);
}
break;``````

If not a change to the core, is there some way for me to override the default implementation with this one without affecting my ability to upgrade mp?

Shaun

• brentjohner

I noticed shipping_price() has the following:

``````//shipping plugins tie into this to calculate their shipping cost
\$price = apply_filters( 'mp_calculate_shipping', 0, \$total, \$cart, \$address1, \$address2, \$city, \$state, \$zip, \$country );``````

I wonder if it would be appropriate to do the same for tax_price() in order to introduce options for customization? For example, tax-exemptions by product will be important for many I suspect.

• Mason

Hiya Shaun,

I'm gonna ask the MarketPress developers to respond to the issue with Canada and taxation as I'm honestly not sure.

We'll help ya get it sorted.

Thanks!

• goliant

Has this issue been resolved? I am looking at using this plugin and will have to follow Canadian Tax Laws where there is a different tax rate charged based on what province the customer is receiving the product in.

Thank!
Brian