Skip to content

Read custom checkbox value after order completed

I have a custom module which adds a checkbox after payment methods

I want to know how to react on that and if checkbox is ON I want to subscribe the user to newsletter, so I will need checkbox value, customer name and email (from address)

Note that I cannot use sales_model_service_quote_submit_success event as this step is after that, it’s the last step when the user fills payment information and completes the order

One idea I had was to observe for sales_model_service_quote_submit_success store name and email into session and on the last page add a JS function for the checkbox to call custom action and inside that custom action read the values from session, but this does not look optimal