Developer forum

Forum » Development » Appropriate way to abort order

Appropriate way to abort order

Lars Sørensen
Reply

Hi,

I want to review some parameters in the ERP related to the customer before submitting the final order. It the parameters are not approved, the order must remain as a cart and display some additional information.

What is the most appropriate way to acheive this? I can't find a notification subscriber that lets me hook in on the correct spot, so I'm guessing I have to create a custom gateway provider for this (there's no other payment on the solution)?

BR.

Lars


Replies

 
Vladimir
Reply
This post has been marked as an answer

Hi Lars,

It is possible to do with provider, but it seems to complicated :)

As I think, the best way is to use field validation + notification "Notifications.eCommerce.Cart.AfterCustomFieldValueIsChanged"

So scenario could be:

  1. You create a custom field - e.g. erpResult
  2. Create 2 validation groups(or even 1)
    •    first is for parameters required for ERP
    •    second for checking erpResult field
  3.  And create AfterCustomFieldValueIsChanged notification handler where you can make all what you want with your ERP (the most important - don't forget to fill erpResult field after that)

Hope it helps

Best regards,

Vladimir

Votes for this answer: 1

 

You must be logged in to post in the forum