... Skip to main content

Action Hooks for Customizing the Gift Card Form

  1. Home
  2. Docs
  3. Gift Card for WooCommerce
  4. Custom hooks
  5. Action Hooks
  6. Action Hooks for Customizing the Gift Card Form

Action Hooks for Customizing the Gift Card Form

The Gift Card for WooCommerce plugin provides three powerful action hooks within the gift card form template. These hooks give developers full control to extend or modify the form by injecting custom fields or content without editing the core plugin files.

🧩 Available Actions


1. wodgc_before_receiver_details_fields

Location:
Inside the main form block, before the “Receiver Name” field.

Purpose:
Use this hook to insert additional form fields or content before the predefined receiver details (e.g., adding a gift occasion dropdown, delivery date picker, etc.).

Hook Registration:

phpCopyEditadd_action( 'wodgc_before_receiver_details_fields', 'wodgc_before_receiver_details_fields_callback' );

Function Example:

phpCopyEditfunction wodgc_before_receiver_details_fields_callback() {
    // Add your custom field logic here
}

2. wodgc_after_receiver_email_field

Location:
After the “Receiver Email” field, just before the “Greeting Message” textarea.

Purpose:
Use this hook to include informational content or extra form fields related to the receiver’s details (e.g., phone number, company name, etc.).

Hook Registration:

phpCopyEditadd_action( 'wodgc_after_receiver_email_field', 'wodgc_after_receiver_email_field_callback' );

Function Example:

phpCopyEditfunction wodgc_after_receiver_email_field_callback() {
    // Add your custom field logic here
}

3. wodgc_schedule_giftcard_email

Location:
After the “Greeting Message” textarea field, just before the “Sender Name” field.

Purpose:
Use this hook to schedule the gift card email for future delivery or modify the logic that controls when and how the gift card email is sent (e.g., scheduling for a selected delivery date).

Hook Registration:

phpCopyEditadd_action( 'wodgc_schedule_giftcard_email', 'wodgc_schedule_giftcard_email_callback' );

Function Example:

phpCopyEditfunction wodgc_schedule_giftcard_email_callback() {
    // Add your custom field logic here
}

How can we help?