Magento has a static setting sitewide that we can either select to commercial or residential How can I make it dynamic depending on addresses, since addresses are mixed commercial and residential so I want to check destination type dynamically and add shipping rate? Shipping rates I have already set.
1 Answer
You can approach you need to add customer address eav attribute, even after that logically speaking.
if you change site wide setting per customer is not logical ( imagine multiple customers having different adrdess type changing that setting at same time, still if you want that approach you can do it like this:
— Logically speaking write plugin around sales_order_address_save_after event and check for address and do necessary steps (i.e. change the setting based on the address ).
Hope this helps.