Developer forum

Forum » Development » What Cart V2 notification to use?

What Cart V2 notification to use?

Kasper Vesth
Reply
I have a webshop where I need to run some custom code on the Cart before it is rendered. The scenario is that a user will post some data while the Cart is showing, and I want to use this data to manipulate some values in the Cart.

Cart V1 had the notification "Dynamicweb.Notifications.eCommerce.Cart.BeforeRender" which fit my requirement quite well as I want to make sure it is always done before the Cart is rendered. But unfortunatly we are using Cart V2 which do not throw that notification. I have looked through the notifications in "Dynamicweb.Ecom7.Cart.Notifications" but I can't seem to find anyone that I can use. The closest is BeforeRenderEmptyCart, but that is not particularly useful in my situation.

So my question is in part two-fold:
Can anyone see a notification in the Cart V2 namespace that I can use?

Or failing that, is there another approach? I have some custom fields on the Order and OrderLine that I want to manipulate related to the information the user posts. I could use a custom module, but I want to be sure the code is always run before the cart is being rendered.


Replies

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply
This post has been marked as an answer

Hi Kasper

You can find all the available CartV2 notifications in this document: http://developer.dynamicweb-cms.com/Admin/Public/DWSDownload.aspx?File=Files%2fFiler%2fDocumentation%2fDevelopment%2feCommerce%2f(en-US)+Shopping+Cart+v2+Extensibility.pdf

But the specific one you're looking for is called BeforeRenderingNewStep.

Hope this helps :)

- Jeppe

Votes for this answer: 0
 
Kasper Vesth
Reply
I see :) It would seem you are correct. I mistakenly thought that it would only fire when you actually started rendering step you hadn't rendered before. Thank you for your answer.
 
Kasper Vesth
Reply

 

You must be logged in to post in the forum