Existing Basket after Customer Signin

Hi, I have a strange issue with the Basket when a customer signs in and it’s not empty.
The Basket contents are preserved but the “ItemCache” table is not updated. The Basket is recreated in memory (I have checked that the item keys are newly generated, they are not the same with the pre-signing in keys).

As soon as I make a Basket Table update (change a quantity or add a new item), the items are again recreated (I have a new 3rd unique item key, so a 3rd version of the Basket) which then are written to the “ItemCache” table.

What it does is it creates the 3rd version of the Basket guid’s by copying the 1st version and inserting only the newly added items. All changes (quantity updates) on the 2nd version are dropped.

I’m playing by copying code from Bazaar into a custom implementation and I faced an error of “no parameter-less constructor available” for the:

UmbracoViewPage<MyBasketModel>

So I ignored that inheriting from UmbracoTemplatePage, and what I did was a bit silly but I still think it should work:

@Html.Partial("ShopBasketTable", new MyBasketTableModel(Model.Content))

which creates a similar to BasketTable model from “CurrentCustomer.Basket” which is newly referenced in MyBasketTableModel constructor:

this.CurrentCustomer = new CustomerContext(Umbraco.Web.UmbracoContext.Current).CurrentCustomer;

And I’m guessing something is going terribly wrong among these lines :frowning: because my signin code is basically identical to Bazaar’s.


This is a companion discussion topic for the original entry at https://our.umbraco.com/forum/66694-existing-basket-after-customer-signin