I am creating an order programmatically in magento but tax is not applied on it. How can i apply tax on order based on address in my script only??
Any help would be appreciated.
To create an order programmatically in Magento, you need to create the quote first then you can create the order from the quote.
You need to set
setTotalsCollectedFlag(false) in the quote before you save the quote. This flag will allow Magento auto calculate the tax based on your shipping address.
This article will guide you do it https://jamersan.com/magento-setting-order-quotes-tax-rate-based-on-shipping/
I have found that tax works only when you set 'region_id' in shipping address, and not with just 'region'.