Skip to main content

fc_before_substep_{substep_id}

Type: Action

Fires before a checkout substep.

The dynamic portion of the hook name, $substep_id, refers to the checkout substep ID. Additional hook names are created for substeps registered by other plugins. Possible hook names include:

  • fc_before_substep_contact
  • fc_before_substep_shipping_address
  • fc_before_substep_shipping_method
  • fc_before_substep_order_notes
  • fc_before_substep_billing_address
  • fc_before_substep_payment
  • fc_before_substep_coupon_codes

Signature​

do_action( 'fc_before_substep_{substep_id}', $step_id, $substep_id, $context );

Parameters​

NameTypeDescription
$step_idstringCheckout step ID.
$substep_idstringCheckout substep ID.
$contextstringContext in which the hook runs. Default checkout.

Since​

  • 1.2.9

Source: inc/checkout-steps.php

Examples​

In fc_before_substep_{substep_id}, shipping_methods replaces {substep_id}.

add_action( 'fc_before_substep_shipping_methods',
/**
* Add extra content before the sub-step contents.
*
* @param string $step_id Checkout step ID.
* @param string $substep_id Checkout substep ID.
* @param string $context Context in which the hook runs. Default checkout.
*/
function( $step_id, $substep_id, $context ) {
echo '<div>Custom content before sub-step.</div>';
},
10,
3
);