Created
April 3, 2025 13:11
-
-
Save xlplugins/5b66976c90041cb2755788a1992bd61d to your computer and use it in GitHub Desktop.
Funnelkit Checkout: Display field on the next step
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Class to handle fields that should be shown on the next step in WooFunnels AeroCheckout Page. | |
* This class allows specific fields to be displayed on the next step of the checkout process. | |
*/ | |
class WFACP_Show_On_Next_Step_Fields { | |
/** | |
* Constructor - Initializes the class and registers the action hook. | |
*/ | |
public function __construct() { | |
// Hook into WFACP's action for handling fields to be shown on next step | |
add_action('wfacp_show_on_next_step_fields', [$this, 'update_fields_next_step']); | |
} | |
/** | |
* Updates the fields configuration to show specific fields on next steps. | |
* | |
* @param array $fields The existing fields configuration array | |
* @return array The modified fields configuration array | |
*/ | |
public function update_fields_next_step($fields) { | |
/** | |
* For single step checkout layout: | |
* Add 'e_deliverydate' field to be shown on the next section | |
* The value "true" indicates the field should be shown | |
*/ | |
$fields['single_step']['e_deliverydate'] = "true"; | |
/** | |
* For two step checkout layout: | |
* Add 'e_deliverydate' field to be shown on the next step | |
* The value "true" indicates the field should be shown | |
*/ | |
$fields['two_step']['e_deliverydate'] = "true"; | |
// Return the modified fields array back to WFACP | |
return $fields; | |
} | |
} | |
// Instantiate the class to activate the functionality | |
new WFACP_Show_On_Next_Step_Fields(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment