Closed notrab closed 3 years ago
This would be great.
@luis-cruzt can you tell me a bit more about your use case?
I'm thinking addItem
takes a type
as mentioned above that is either SKU
, TAX
, or SHIPPING
, and updates the correct totals.
SKU
would be the default. I think this is a fairly basic implementation that stays very agnostic to the implementation.
Thinking about this some more, TAX
will most likely need to be added to the Item
type, as items can have their own tax amounts.
Shipping would also be a new type that doesn't have a quantity, but you can add multiple shipping items with different IDs.
Actually the way you are describing it's correct, as for some items sometimes they have their own tax amount, I think is a nice approach.
In my use case is very basic, because my client already included the tax amount per item (don't know why).
Why is this being closed?
Similar to CartQL, it would be helpful to group cart items based on their type.
For example,
SKU
,TAX
,SHIPPING
would permit newsubTotal
,taxTotal
,grandTotal
, andshippingTotal
values.