Developer forum

Forum » Integration » Session, cart-cookie and punchout

Session, cart-cookie and punchout

Kurt Moskjær Andersen
Kurt Moskjær Andersen
Reply

Hi,

I've recently upgraded a DW-solution from version 9.3 to version 9.7.

Previously the cart-cookie was name like Dynamicweb:Ecom:Cart{0}.'{1}', where {0} is the user-id and {1} is the session-id. After the upgrade, this cookie is named like Dynamicweb:Ecom:Cart{0}.

This result in the problem, that the cart is no longer separated per session, which I need in relation to a punchout-solution.

I know I can set DW to have separate carts per browser-session, but as stated in the documentation, I don't know if I would go down that way :)

Is there another way of achieving the same functionality as previous?

--

Best regards
Kurt Moskjaer Andersen


Replies

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

Hi Kurt,

There has been no change related to this functionality as far as I can tell. However, it is an order context id which is used in the cookie name - not a session id.

Maybe your configuration or implementation has changed with regards to use of order context?

See https://doc.dynamicweb.com/documentation-9/ecommerce/apps/shopping-cart#2955

Best regards,
Morten

 
Kurt Moskjær Andersen
Kurt Moskjær Andersen
Reply

Hi Morten,

Sorry, order context of course.

Well, it just seems like the naming of the cookie has changed, but it haven't as far as I understand?

--
Best regards
Kurt

 
Kurt Moskjær Andersen
Kurt Moskjær Andersen
Reply

What happens, if no shop is selected in the order context?

Does it apply for all shops then or none?

/Kurt

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

An order context does not apply to any shop by default, but you can still select it by querystring or in the shopping cart settings.

The order context needs to be made available to a shop in order to select it as the default cart context in shop settings.
Only the order contexts which are enabled for the current shop is rendered in the template loop "OrderContexts".

If  you want to use order contexts then you need to specify which context to use.
This can be done either by querystring, shopping cart setting or by selecting a default context on the shop.

/Morten  

 
Kurt Moskjær Andersen
Kurt Moskjær Andersen
Reply

Previously we have made order contexts on-the-fly, by using custom tokens. Afterwards could we select them and use them from within our punchout-module and get a hold of the cart by using a combination of order context ids and user id.

Do you know if the handling of order contexts have been changed from 9.3 to 9.7 ?

/Kurt

 
Kurt Moskjær Andersen
Kurt Moskjær Andersen
Reply

It seems that I cannot retrieve a cart anymore, by using the context-id as parameter.

Has this been changed from 9.3.13 to 9.7.2 ?

/Kurt

 
Nicolai Pedersen
Reply

Can you ellaborate - what do you do in your request - what parameters?

 
Kurt Moskjær Andersen
Kurt Moskjær Andersen
Reply

Yes, of course.

Previously I was able to get the cart of the current user, by calling Order.GetOrderById(cartOrderId), where the value of the cartOrderId is like: IZTL6ZYls20pYunryj4fww%3D%3D. This was the ID of an automatically created cart-context.

I know this is not normal order- or cart-ID, but it has been working previously on DW 9.3.13 and it doesn't change anything, if I use the OrderService instead.

/Kurt

 
Nicolai Pedersen
Reply

Hi Kurt

That sounds really weird that that should have been possible. Just checked the old code, and it does not make sense to me...

Can I see your entire code related to this. Where do you get the IZTL6ZYls20pYunryj4fww%3D%3D id from?

 

You must be logged in to post in the forum