Tuesday, November 23, 2010

Product being added twice

I had some code to add a product to a basket like so-

Basket b = basketApi.GetDefaultBasket();
        b.AddProduct(productId, 1);

However, it was adding the product twice

result += "Count:" + b.Items.Count.ToString() + "<br />";
        foreach (BasketItem bi in b.Items)
         result += "Item " + bi.Id + ":" + bi.Quantity.ToString() + "<br />"; //product is listed twice

My first thought was that the page was being loaded twice (due to a postback bug or something). This was not the case.

The offending party turned out to be Ektron. Going into the Workarea, the product was showing up twice in the catalog (with different prices, but same title and id). Merely editing the product and saving was enough to collapse the waveform and destroy the evil twin. I'm not sure how this occurred - my money would be on eSync and L10n.

No comments:

Post a Comment