Jump to content

Eco tax charge


Recommended Posts

Hi, I'm trying to add fixed amount tax to products that are sold within a certain province.

Essentially, if someone from Quebec(not the other province) orders a tire I need to add a 3$ Eco tax. The tax is not a percentage but a flat 3$ per tire.

 

Any way of getting that done?

 

Regards
Steve

Link to comment
Share on other sites

  • 3 weeks later...

I'm still looking for a solution to my problem. But for now I'm trying to edit the file tax.php. (I do not know php but only some basic c++) In the section on ecotax i want the ecotax to only be charged when the customer id state is the id of Quebec (87) and for the rest of customer it will be to 0$.

I thought adding a line of code in kind

public static function getProductEcotaxRate($id_address = null)
	{
		$address = Address::initialize($id_address);

		$tax_manager = TaxManagerFactory::getManager($address, (int)Configuration::get('PS_ECOTAX_TAX_RULES_GROUP_ID'));
		$tax_calculator = $tax_manager->getTaxCalculator();

             if $id_state == 87
                    return $tax_calculator->getTotalRate();
             else return $tax_calculator->0();
	}

I change the last three lines. I wonder if it could be functional. If not can someone help me modify my lines to make it work

Thanks
Steve

Edited by Stunt333 (see edit history)
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...