surprisehighway / craft-avatax

Calculate and add sales tax to an order's base tax using Avalara's AvaTax service with Craft Commerce 5.
MIT License
7 stars 11 forks source link

Use Craft Autosuggest fields to support env-based config #11

Closed abryrath closed 3 years ago

imagehat commented 4 years ago

Thanks for all your work on this @abryrath! I don't think we're going to merge in the autosuggest env stuff for a couple reasons.

It's possible already to use ENV variables by just setting a config file value to an ENV variable, e.g. 'accountId' => getenv('AVATAX_ACCOUNT_ID').

But the big thing to me is the UI in the settings page seems confusing. If a value is set by the config file it should be locked but the autosuggest field allows you set a value that then won't be saved because it's overridden by the config file anyway. I can't find a native control panel setting or a plugin setting example that allows both a config override and an ENV autosuggest field for the same setting. I'm totally open to adding this in the future, maybe even just replacing the config file for allowing ENV autosuggest values in the settings but I'm hesitant to abandon the existing config overrides.