Developer forum

Forum » Development » OrderTemplateExtender : only execute at a certain cart step

OrderTemplateExtender : only execute at a certain cart step

Gaëtan Di Caro
Reply

Hello,

 

I have some code in an OrderTemplateExtender that I need to execute at a certain custom step in the cart and only there, because it is resource-intensive. However I can't find out how to do that. Order.CartV2StepIndex always returns 0.

How do I do this ?

 

Thank you


Replies

 
Nicolai Pedersen
Reply
This post has been marked as an answer

Can you use the Order.StepNum property: https://doc.dynamicweb.com/api/html/af59d580-678f-1670-9415-60921ee2934b.htm?

Alternatively in the step before the expensive step add a hidden field with a value - and check if that values is in the post?

BR Nicolai

Votes for this answer: 1
 
Gaëtan Di Caro
Reply

StepNum didn't work, it's always 0 too. I think this might be a bug ?

Putting a value in the post did work though, so thanks !

 

You must be logged in to post in the forum