cart
- Breaking: Move all calculations to cart behaviour implementation
- By moving calculation responsibility, we enable different implementation possibilities for calculations like tax before or after discounts, tax on single item or sum and different tax rounding modes instead of having it hard-coded in the flamingo cart.
- All calculation functions on cart item, shipping item, delivery and cart are now public fields for which the values must be set by the cart behaviour implementation
- The
DefaultCartBehaviour
calculates all new fields accordingly - Removed
ItemBuilder
,DeliveryBuilder
andBuilder
since they didn't provide any meaningful functionality after removing the calculations. Please create structs directly. - Changed the GraphQL cart model accordingly.
- To help with the migration there are sed commands for the following fields in
cart/migration.sed
: runfind . -type f -iname '*.go' -exec gsed -i -f migration.sed "{}" +;
- Cart items
-
Old Function New Field RowPriceGrossWithDiscount() RowPriceGrossWithDiscount RowPriceGrossWithItemRelatedDiscount() RowPriceGrossWithItemRelatedDiscount RowPriceNetWithDiscount() RowPriceNetWithDiscount RowPriceNetWithItemRelatedDiscount() RowPriceNetWithItemRelatedDiscount TotalDiscountAmount() TotalDiscountAmount ItemRelatedDiscountAmount() ItemRelatedDiscountAmount NonItemRelatedDiscountAmount() NonItemRelatedDiscountAmount
-
- Shipping items
-
Old Function New Field TotalWithDiscountInclTax() PriceGrossWithDiscounts - PriceNetWithDiscounts
-
- Deliveries
-
Old Function New Field SubTotalGross() SubTotalGross SubTotalNet() SubTotalNet SumTotalDiscountAmount() TotalDiscountAmount SumSubTotalDiscountAmount() SubTotalDiscountAmount SumNonItemRelatedDiscountAmount() NonItemRelatedDiscountAmount SumItemRelatedDiscountAmount() ItemRelatedDiscountAmount SubTotalGrossWithDiscounts() SubTotalGrossWithDiscounts SubTotalNetWithDiscounts() SubTotalNetWithDiscounts GrandTotal() GrandTotal
-
- Cart
-
Old Function New Field GrandTotal() GrandTotal - GrandTotalNet SumShippingNet() ShippingNet SumShippingNetWithDiscounts() ShippingNetWithDiscounts SumShippingGross() ShippingGross SumShippingGrossWithDiscounts() ShippingGrossWithDiscounts SubTotalGross() SubTotalGross SubTotalNet() SubTotalNet SubTotalGrossWithDiscounts() SubTotalGrossWithDiscounts SubTotalNetWithDiscounts() SubTotalNetWithDiscounts SumTotalDiscountAmount() TotalDiscountAmount SumNonItemRelatedDiscountAmount() NonItemRelatedDiscountAmount SumItemRelatedDiscountAmount() ItemRelatedDiscountAmount SumAppliedGiftCards() TotalGiftCardAmount SumGrandTotalWithGiftCards() GrandTotalWithGiftCards - GrandTotalNetWithGiftCards
-
- Dispatch a
PreCartMergeEvent
before and aPostCartMergeEvent
after merging a guest and customer cart when logging in - Update payment selection on cart merge with the guest carts' payment selection after applying coupons and giftcards and only if customer cart has no items
- Add possibility to have additional data in
AddToCartNotAllowed
error - Deprecate
BuildAddRequest
in cart service (build your own add request) - Provide
BaseCartReceiver
for fetching carts withoutDecoratedCartFactory
dependency - Provide
Receiver
interface to be able to mock receiving a cart - GraphQL:
- Aggregate many input values to
Commerce_Cart_AddToCart
mutation inCommerce_Cart_AddToCartInput
- Add support for bundle and configurable products in
Commerce_Cart_AddToCart
mutation
- Aggregate many input values to
- Added support for AdditionalData on CartItem Level for the defaultCartBehaviour.
checkout
- Add possibility to have additional data in
PaymentFlowActionTriggerClientSDK
- Breaking: Disable auto canceling of orders during place order rollback, to restore old behaviour set
commerce.checkout.placeorder.states.placeorder.cancelOrdersDuringRollback: true
product
- Introduce
Labels()
function onAttribute
to handle translations for attributes with multiple values, will fallback toValues()
function if not translated. - Introduce
Stock
slice inBasicProductData
to store more accurate information about availability for each delivery code - Introduce new
BundleProduct
andBundleProductWithActiveChoices
types - GraphQL:
- Add
unitCode
toCommerce_Product_VariationSelection_Option
andCommerce_Product_ActiveVariationSelection
- Fix mapping of VariationSelections
- Introduce
Labels
for attributes here as well - Extend
Commerce_Product
query with non-mandatory bundle configuration argument - Add type
Commerce_Product_BundleProduct
that implementsCommerce_Product
interface and is used as bundle product graphql representation. - Change
variantionSelections
field in configurable products withvariantSelection
that handles all possible combinations of multi axis configurable.
- Add
- FakeService
- Add configuration option
commerce.product.fakeservice.defaultProducts
which toggles the delivery of default test products. - Add category facet functionality to the fake
SearchService
with default category facet items. - Add configuration option
commerce.product.fakeservice.jsonTestDataCategoryFacetItems
which can be used to provide your own category facet items. - Add new
Stock
field to returnedSimpleProduct
from service - Add configuration option for delivery codes
commerce.product.fakeservice.deliveryCodes
which can be used to provide different delivery codes for stock.
- Add configuration option