I am working on replacing our payment system from D7/DC1 to D8/DC2 and the original code makes use of hooks. I have replaced some of them with events but I cannot find any information on the DC2 versions of:
mymodule_form_commerce_checkout_form_checkout_alter()
mymodule_form_commerce_checkout_form_review_alter()
mymodule_form_commerce_checkout_complete()
mymodule_form_commerce_cart_add_to_cart_form_alter()
Are they still the same or much like the former cart (add, update, remove) hooks, these are also events but I can't locate documentation on them. Anyone know the equivalent events or where to find the docs on these (or their replacements)
/* Small Update */
I found OrderEvents and I think I need ORDER_PAID to replace mymodule_form_commerce_checkout_complete()
Does this look correct?
I added OrderEvents::ORDER_PAID => 'orderPaid' to my getSubscribedEvents(){} array and have:
public function orderPaid(OrderEvent $event){
$order = $event->getEntity();
//Some internal logic here
$order->save();
}
//Updated Tried a hook form alter and ran through my checkout process and nothing is showing in the logs
function srs_hook_form_alter(&$form, $form_state, $form_id){
\Drupal::logger('hook_form_alter fires')->info('<pre><code>' . print_r($form_id, TRUE) . '</code></pre>');
}
kint($form_id);
to find the ID of those forms.