Developer forum

Forum » Development » Split orderlines in cart

Split orderlines in cart

Kurt Moskjær Andersen
Kurt Moskjær Andersen
Reply

Hi,

I've got a solution with Rapido 3.4.2 and DW 9.9.8. On the cart page, it is possible to to choose between full delivery or partial delivery. This setting is saved in a custom orderfield.

If the customer chooses partial delivery, I would like to iterate through the orderlines and if the requested quantity exceeds stock quantity, a new orderline is created programmatically, with the rest and an estimated delivery date.

Do you know if there is a notification I can subscribe to, which is triggered when the orderlines are rendered on the cart page? I've tried to use the Cart.Loaded, but this doesn't seem to get fired when the cart form is submitted.

--
Best regards
Kurt Moskjaer Andersen


Replies

 
Kurt Moskjær Andersen
Kurt Moskjær Andersen
Reply

Anyone?

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
This post has been marked as an answer

Wouldn't it make more sense to this when the shipping method is changed? Then you only have to do it once. There should be something like Cart.AfterShippingMethodChanged. Alternatively, you could try Ecommerce.Notifications.Ecommerce.Cart.OrderValuesSaved  which runs after all kind of other updates to the cart have been made.

Imar

Votes for this answer: 1
 
Kurt Moskjær Andersen
Kurt Moskjær Andersen
Reply

Hi Imar,

Yes, it would make sense to use the shipping method changing, but the customer only has one shipping option, so it's not possible to use right away.

I've looked into the OrderValuesSaved, but it doesn't seem to get fired. I will look into it again.

Thank you for your feedback.

/Kurt

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

And what about AfterCustomFieldValueIsSet?

 
Kurt Moskjær Andersen
Kurt Moskjær Andersen
Reply

Tried that one also :)

 
Kurt Moskjær Andersen
Kurt Moskjær Andersen
Reply

Well, I've looked into it once again, at now the OrderValuesSaved is fired as it should :)

Thank you, Imar.

/Kurt

 

You must be logged in to post in the forum