Skip to content

Releases: VirtoCommerce/vc-module-experience-api

3.833.4

13 Sep 07:53
Compare
Choose a tag to compare

🐞 Bug fixes

  • pass Cart currency to Tax evaluation context

3.800.13

13 Sep 07:53
Compare
Choose a tag to compare

🐞 Bug fixes

  • pass Cart currency to Tax evaluation context

3.844.0

10 Sep 12:15
Compare
Choose a tag to compare

🎯 Development

  • search by localized content field

3.800.12

29 Aug 11:20
Compare
Choose a tag to compare

🎯 Development

  • don't resolve main FFC if in stock quantity = 0

3.833.3

23 Aug 11:09
Compare
Choose a tag to compare

🎯 Development

  • don't resolve main FFC if in stock quantity = 0

3.843.0

09 Aug 13:51
Compare
Choose a tag to compare

🎯 Development

  • (Adds a new FindExistingLineItemBeforeAdd method. It is responsible for finding an existing line item before adding a new one. If the method returns the line item, the new line item should be merged with the existing one.)

Use a Complex Key for Determining Line Item Uniqueness in the Cart

Overview

When adding new line items to the cart, especially when dealing with dynamic properties (e.g., service configurations, T-shirt prints), it's important to ensure that duplicate items are not added. By default, line items are identified by their product ID. However, this implementation requires checking both the product ID and dynamic properties to determine if the line item already exists.

Implementation Details

Steps to Use Dynamic Properties for Adding New Line Items:

  1. Create a Custom VC Module: Set up a new module and add a dependency on VirtoCommerce.XCart or relevant packages.
  2. Extend CartAggregate: Create a new class, CartAggregateEx, that extends the CartAggregate class.
  3. Override FindExistingLineItemBeforeAdd: Implement the custom logic to compare dynamic properties.
override protected LineItem FindExistingLineItemBeforeAdd(string newProductId, CartProduct newProduct, IList<DynamicPropertyValue> newDynamicProperties)
        {
            var newDynamicPropertiesKey = string.Join(",", newDynamicProperties?.Select(dp => $"{dp.Name}:{dp.Value}"));

            return LineItems.FirstOrDefault(
                x => x.ProductId == newProductId &&
                string.Join(",", x.DynamicProperties
                    .Select(dp => $"{dp.Name}:{dp?.Values?.FirstOrDefault()}")) == newDynamicPropertiesKey);
        }
  1. Register the Extension: Update the service registration to use the new CartAggregateEx class.
            services.AddTransient<CartAggregate, CartAggregateEx>();

3.842.0

30 Jul 13:59
Compare
Choose a tag to compare

🎯 Development

  • Update organization name on order create (#568)

3.833.2

24 Jul 10:53
Compare
Choose a tag to compare

🎯 Development

  • search by localized content field
  • Don't merge shipments/payments if there are already shipments/payments in the cart (#566)

3.800.11

24 Jul 10:50
Compare
Choose a tag to compare

🎯 Development

  • search by localized content field
  • Don't merge shipments/payments if there are already shipments/payments in the cart (#566)

3.841.0

17 Jul 12:13
Compare
Choose a tag to compare

🎯 Development

  • Don't merge shipments/payments if there are already shipments/payments in the cart (#566)
  • Add ability to get cart by Id (#565)