You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Currently we represent the Shipping method & costs of an order as 3 properties on the Order entity:
It makes it impossible to use more than 1 ShippingMethod per Order. Though uncommon, this may be a requirement, e.g. to enable certain items to be sent via one method, and a single item to be drop-shipped. I expect such things to mainly be handled later at the Fulfillment stage, but I can also foresee that it might also be required at the ShippingMethod stage e.g. in order to separate the charges more distinctly.
Shipping promotions (e.g. free shipping) are hacky right now - you need to just do a OrderPromotionAction and subtract the
shipping amount from the Order. Tax-wise this is not really correct, since you would then be reducing the (prorated) price of every OrderItem, even though it is actually only the shipping being discounted.
Describe the solution you'd like
Create a new ShippingLine entity which looks like this:
and then an Order entity has reference to one or more of these:
exportclassOrder{shippingLines: ShippingLine[];}
Then we need to introduce a new type of PromotionAction: PromotionShippingAction which allows us to add discounts to the ShippingLine.adjustments array.
Describe alternatives you've considered
Just keeping it as-is. Since we're already doing pretty big breaking changes to the Order model in v0.18.0, we might as well get it all right now and have it done with.
The text was updated successfully, but these errors were encountered:
Relates to #580. This commit changes the data model & API of the Order type so that
shipping is stored as multiple ShippingLine entities. For the time being, we assume a
single ShippingLine per order, but in future we can add the ability to deal with multiple
shipping lines per order.
BREAKING CHANGE: The way shipping charges on Orders are represented has been changed - an Order
now contains multiple ShippingLine entities, each of which has a reference to a ShippingMethod.
This will require a database migration with manual queries to preserve existing order data. See
release blog post for details.
Relates to #580. This commit introduces the new PromotionShippingAction, allowing the creation
of promotions which discount the shipping price specifically.
Relates to #580, Relates to #573.
BREAKING CHANGE: The return object of the ShippingCalculator class has changed:
```ts
// before
return {
price: 500,
priceWithTax: 600,
};
// after
return {
price: 500,
taxRate: 20,
priceIncludesTax: false,
};
```
This change will require you to update any custom ShippingCalculator implementations, and also
to update any ShippingMethods by removing and re-selecting the ShippingCalculator.
Is your feature request related to a problem? Please describe.
Currently we represent the Shipping method & costs of an order as 3 properties on the Order entity:
There are a couple of issues with this:
It makes it impossible to use more than 1 ShippingMethod per Order. Though uncommon, this may be a requirement, e.g. to enable certain items to be sent via one method, and a single item to be drop-shipped. I expect such things to mainly be handled later at the Fulfillment stage, but I can also foresee that it might also be required at the ShippingMethod stage e.g. in order to separate the charges more distinctly.
Shipping promotions (e.g. free shipping) are hacky right now - you need to just do a OrderPromotionAction and subtract the
shipping amount from the Order. Tax-wise this is not really correct, since you would then be reducing the (prorated) price of every OrderItem, even though it is actually only the shipping being discounted.
Describe the solution you'd like
Create a new
ShippingLine
entity which looks like this:and then an Order entity has reference to one or more of these:
Then we need to introduce a new type of PromotionAction:
PromotionShippingAction
which allows us to add discounts to theShippingLine.adjustments
array.Describe alternatives you've considered
Just keeping it as-is. Since we're already doing pretty big breaking changes to the Order model in v0.18.0, we might as well get it all right now and have it done with.
The text was updated successfully, but these errors were encountered: