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
/** | |
* Hook: wfocu_offer_setup_completed | |
* | |
* Fires after the offer setup process is completed in FunnelKit One Click Upsells. | |
* | |
* This hook allows you to access and manipulate offer data, such as products, after the offer has been fully set up. | |
* You can use this hook to retrieve the product data for the current offer as shown below: | |
* | |
* Example: | |
* add_action( 'wfocu_offer_setup_completed', function() { |
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 WFACP_Custom_field_On_Myaccount { | |
public $wfacp_id = 100; // Add your checkout page ID here | |
public $display_custom_fields = ['age', 'sport1', 'sport2', 'sport3', 'sport4']; // Add your custom field IDs here | |
// Add custom labels for your fields | |
public $field_labels = [ | |
'age' => 'Age Range', | |
'sport1' => 'Primary Sport', | |
'sport2' => 'Secondary Sport', |
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
add_filter( 'wfacp_show_shipping_options', '__return_true' ); |
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 Custom_State_Field_Handler { | |
public function __construct() { | |
add_filter( 'wfacp_form_section', [ $this, 'inject_state_into_form_section' ], 10 ); | |
add_filter( 'wfacp_checkout_fields', [ $this, 'inject_state_into_checkout_fields' ], 10 ); | |
} | |
/** | |
* Injects state field into form section after country field if missing. | |
*/ |
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
add_filter( 'wfacp_form_section', function( $section ) { | |
$field_ids = wp_list_pluck( $section['fields'], 'id' ); | |
$field_pairs = [ | |
'billing_country' => 'billing_state', | |
'shipping_country' => 'shipping_state', | |
]; | |
foreach ( $field_pairs as $country_id => $state_id ) { | |
if ( in_array( $country_id, $field_ids ) && ! in_array( $state_id, $field_ids ) ) { | |
// Find country field data and its position | |
foreach ( $section['fields'] as $index => $field ) { |
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 FKCART_Order_Total_Row{ | |
public function __construct() { | |
add_action('fkcart_after_order_summary',[$this,'order_total_row']); | |
} | |
public function order_total_row($front) { | |
$total_amount=""; | |
if ( ! is_null( WC()->session ) && ! is_null( WC()->cart ) ) { | |
$total_amount = WC()->cart->get_total(); |
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 Temp_WFACP_Conditional_field { | |
private $conditional_field = []; | |
public function __construct() { | |
$this->conditional_field = [ | |
'shipping_country' => [ | |
[ | |
'value' => 'IE', | |
'fields' => [ 'custom_text' ], | |
'enable' => true, |
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
add_action('wsf_submit_post_complete', 'wffn_save_wsform_data_in_optin', 10, 1); | |
/** | |
* Handles WS Form submission and maps form fields to FunnelKit optin fields dynamically. | |
* | |
* This function hooks into the 'wsf_submit_post_complete' action provided by WS Form. It dynamically maps | |
* WS Form fields to logical optin fields (first name, last name, email, phone) by inspecting the form's | |
* structure and matching on field type and label. This approach is robust to field reordering and renaming. | |
* |
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 WCFAD_Dynamic_Pricing { | |
public function __construct() { | |
add_action( 'wfacp_before_process_checkout_template_loader', [ $this, 'remove_actions' ] ); | |
add_action( 'wfacp_after_checkout_page_found', [ $this, 'remove_actions' ] ); | |
} | |
public function remove_actions() { | |
remove_action( 'woocommerce_before_calculate_totals', 'wcfad_before_calculate_totals', 2, 1 ); | |
add_action( 'woocommerce_before_calculate_totals',[$this, 'wcfad_before_calculate_totals'],3 ); |
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
.woocommerce > form.checkout #billing_address_2_field label.screen-reader-text, .woocommerce > form.checkout #shipping_address_2_field label.screen-reader-text { | |
position: absolute !important; | |
clip-path: margin-box; | |
} | |
body #wfacp-sec-wrapper span.woocommerce-input-wrapper { | |
display: block; width: 100%; | |
} | |
body .wfacp_main_form.woocommerce #wfacp_checkout_form #shipping_country_field label.wfacp-form-control-label, | |
body .wfacp_main_form.woocommerce #wfacp_checkout_form #billing_country_field label.wfacp-form-control-label, |
NewerOlder