Quantcast
Channel: Developer to developer
Viewing all articles
Browse latest Browse all 9076

Deleted variant still in cart? [12.8]

$
0
0

Hi!

If I place a variant in my shopping cart and the delete the variant from the catalog the variant is still loaded into the cart.  Even if I restart everything the variant is still loaded.

This code gives me the deleted variant:

var lineItems = cart.GetAllLineItems();
var variantReferences = _referenceConverter.GetContentLinks(lineItems.Select(l => l.Code))
                .Select(c => c.Value).Where(c => !ContentReference.IsNullOrEmpty(c));
var variants = _contentLoader.GetItems(variantReferences,_preferredCulture).OfType().ToList();

These validations are run:

cart.ValidateOrRemoveLineItems((item, issue) => issues.AddValidationIssues(item, issue), _lineItemValidator);
cart.UpdateInventoryOrRemoveLineItems((item, issue) => issues.AddValidationIssues(item, issue), _inventoryProcessor);
cart.ApplyDiscounts(_promotionEngine, new PromotionEngineSettings());
cart.UpdateInventoryOrRemoveLineItems((item, issue) => { }, _inventoryProcessor);       

I get all information about the variant even though it is deleted, but I can't get an url to the item which I guess is how it is supposed to be.

Is this Episerver standard or maybe I'm missing something here?

/Kristoffer


Viewing all articles
Browse latest Browse all 9076

Trending Articles