atiquratik
atiquratik

Reputation: 1300

Enforce certain tax rule if user select Store pick up in Prestashop 1.7

I would like to apply tax on a product if a user selects "Store Pickup" as a shipping carrier. Here is my scenario:

State A: Tax 5%

State B: Tax 3%

Rest of the state: 0%.

Now, if someone's delivery address is within "State A" then a 5% tax will be applied. It's working fine. Similarly, it's working fine for other states too.

The issue is, if someone's delivery address is within State C, D, or E (where tax is 0%) and he/she chooses "Store Pickup" as the shipping carrier then I would like to apply a tax of 5% because this store is within "State A" (where tax is 5%). Is it possible to enforce a 5% tax if the user selects "Store Pickup"? Or forcefully change the delivery address to the Store address (because Prestashop uses the delivery address to calculate Tax) if the customer selects "Store Pickup"?

Looking forward to some ideas on how to achieve this. Thanks!

Upvotes: 0

Views: 94

Answers (1)

gennaris
gennaris

Reputation: 1612

I guess this is not doable natively, I achieved something similar in the past by overriding the constructor of TaxCalculator

Try checking the current State and Carrier in the context object, then edit the array of taxes according to your desired logic.

Upvotes: 1

Related Questions