SimplCommerce
SimplCommerce copied to clipboard
Shipping address shouldn't be always required (Parcel lockers)
Currently, in the checkout/shipping
view, you have to fill the form in order to select the shipping method. It doesn't always work like that. Different shipping providers require different types of addresses or no addresses at all and just a specific code unique to that provider.
https://github.com/simplcommerce/SimplCommerce/blob/9c797f7011d93c9391250138310dae1b09d81ee9/src/Modules/SimplCommerce.Module.Orders/Areas/Orders/Controllers/CheckoutController.cs#L76
The shipping provider should be able to specify if the address is required or not and be able to save a custom address format somewhere (like location id specific to that provider).
So maybe adding a property like IsShippingAddressRequired
to ShippingProvider
would suffice and validating only if the shipping address is required for the chosen method.
Then custom fields could be specified with some kind of JSON schema stored in another column like FormSchema
, see:
- https://stackoverflow.com/questions/20241059/how-to-create-a-form-from-a-json-schema
There's already AdditionalSettings
in ShippingProvider which is good.
Example of such shipping provider is https://inpost-solutions.com/ where you just select a locker location instead of an address.
More providers with parcel lockers (e.g. UPS access points too) https://www.ipc.be/services/markets-and-regulations/e-commerce-market-insights/e-commerce-articles/parcel-lockers
Ideas?
It seems ok, but I have a question. How the tax should be calculated in this case. That the moment, tax is calculated base on the shipping address: zipcode, or country/stateOrProvince
Shipping provider module that disables address could implement some interface that chooses how the tax is calculated maybe call it ITaxProvider. There are few shipping providers which have tax APIs. Maybe There's some better option