Developer forum

Forum » Integration » Cart is cleared when the session is expired

Cart is cleared when the session is expired

Anders Ebdrup
Reply

Hi Dynamicweb,

 

I have at problem where the cart is cleared after the session is expired. It is due to this code part in: Order.vb

            For Each orderLine As OrderLine In OrderLines
                If orderLine.Type = Base.ChkString(Base.ChkInteger(orderLine.OrderLineType.Product)) Then
                    If Not String.IsNullOrEmpty(orderLine.Product.ID) Then
                        ids.Add(orderLine.Product.ID)
                    End If
                    productLines.Add(orderLine)
                End If
            Next

            'Get the products that match the ids
            Dim productsFromDatabase As ProductCollection
            If ids.Count() = 0 Then
                productsFromDatabase = New ProductCollection()
            Else
                productsFromDatabase = Product.GetProductsByProductIDs(ids.ToArray(), False)

            End If

            If productsFromDatabase.Count() = 0 Then
                If Me.IsCart Then
                    Me.Delete()
                    Context.CartSession.Remove(Context.SessionCartKey)
                End If
            Else


All products is removed as the SetUnitPrice on the orderline sets the "Type" as "fixed" and then all products will be removed due this check:

If orderLine.Type = Base.ChkString(Base.ChkInteger(orderLine.OrderLineType.Product)) Then

 

Please help me to fix this problem as I get some other troubles when forcing the type back to "Product" after setting the unitprice.

 

Best regards, Anders


Replies

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply

Hi Anders,

I've implemented a fix that will be available with the next hotfox for 8.4.1.

- Jeppe

 
Kristian Kirkholt
Reply
This post has been marked as an answer

Hi Anders

The problem regarding Cart is cleared when the session is expired TFS#15366  has now been fixed in version 8.4.1.12

You are able to find this build in the download section:

http://developer.dynamicweb-cms.com/downloads/dynamicweb-8.aspx

Please contact Dynamicweb Support if you need any additional help regarding this.

Kind Regards

Dynamicweb Support

Kristian Kirkholt

Votes for this answer: 1

 

You must be logged in to post in the forum