79545674

Date: 2025-03-31 07:17:34
Score: 0.5
Natty:
Report link

I finally found the hook :

woocommerce_payment_complete

To retrieve the custom data :

$customer = WC()->customer;
$checkout_fields = Package::container()->get(CheckoutFields::class);
$optin = $checkout_fields->get_field_from_object('namespace/newsletter-opt-in', $customer);

$email = $customer->get_email();
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Jean R.