Can someone tell me how and if it's possible in the magento 1.9.2 (x) admin, where I can setup a way to charge my NY sales tax on an order IF a customer is in Canada AND they choose a specific shipping method (in this case, I'm offering local pickup - but if they do this, I have to charge sales tax if they are picking up the item where I'm located).


1 Answer 1


Unfortunately you cannot apply a tax rule to a specific shipping method out of the box with Magento. To accomplish this, you could create a custom extension to override the collect method inside Mage_Tax_Model_Sales_Total_Quote_Tax and get the shipping method using $address->getShippingMethod(). You could also determine if the customer is based in Canada by looking at their shipping address via $address->getCountry().

If the shipping method is local pickup and the customer is based in Canada, you can return parent::collect($address):

public function collect(Mage_Sales_Model_Quote_Address $address)
    if ($address->getShippingMethod() == 'flatrate_flatrate' && $address->getCountry() == 'CA') {
        return parent::collect($address);
    return $this;

Learn how to override core models in Magento and check out an example of overriding Mage_Tax_Model_Sales_Total_Quote_Tax.

From there, you'd just need to collect sales tax based on your NY shipping origin. Under System > Configuration > Tax you'd set Tax Calculation Based On to Shipping Origin. Set up a new tax rule with your NY tax rate.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.