Developer forum

Forum » Ecommerce - Standard features » Getting Cart ID or Order ID outside of Cart V2 module

Getting Cart ID or Order ID outside of Cart V2 module

Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi Guys,

I need to display a confirmation that a Quote was sucessfuly added to cart. SInce the default implementation does not render a success message after adding a quote to cart (or at least I could not find one), I was thinking about comparing the recently added quote to the Cart ID and if they are equal, display a notification.

All seems fine in the logic except the way I can access the Cart ID  (or order ID) outside of the CartV2 module. I tried Ecom:Order.ID but it does not render  anything.

Anyone knows a global tag or a pageview tag with this value? Or an API call?

Thanks,

Adrian 


Replies

 
Anders Ebdrup
Anders Ebdrup
Reply
This post has been marked as an answer

Hi Adrian,

 

If you are using DW9 you should be able to get the id of the current cart by: Dynamicweb.Ecommerce.Common.Context.Cart.Id

 

Best regards, Anders

Votes for this answer: 1
 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Thank you Anders.

It worked like a charm :)

Adrian

 

You must be logged in to post in the forum