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
| <?php | |
| add_action( 'woocommerce_before_checkout_form', 'skyverge_add_checkout_success', 9 ); | |
| function skyverge_add_checkout_success() { | |
| wc_print_notice( __( 'Voici un message important!', 'woocommerce' ), 'success' ); | |
| } |
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
| <?php | |
| add_action( 'woocommerce_before_checkout_form', 'skyverge_add_checkout_notice', 11 ); | |
| function skyverge_add_checkout_notice() { | |
| wc_print_notice( __( 'A notice message instead.', 'woocommerce' ), 'notice' ); | |
| } |
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
| <?php | |
| add_filter( 'woocommerce_checkout_fields', 'popcorn_remove_fields', 9999 ); | |
| function popcorn_remove_fields( $woo_checkout_fields_array ) { | |
| // she wanted me to leave these fields in checkout | |
| // unset( $woo_checkout_fields_array['billing']['billing_first_name'] ); | |
| // unset( $woo_checkout_fields_array['billing']['billing_last_name'] ); | |
| // unset( $woo_checkout_fields_array['billing']['billing_phone'] ); |
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
| <?php | |
| add_filter( 'woocommerce_checkout_fields' , 'popcorn_not_required_fields', 9999 ); | |
| function popcorn_not_required_fields( $f ) { | |
| unset( $f['billing']['billing_last_name']['required'] ); // that's it | |
| unset( $f['billing']['billing_phone']['requiredd'] ); | |
| // the same way you can make any field required, example: |
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
| <?php | |
| add_filter( 'woocommerce_checkout_fields' , 'popcorn_labels_placeholders', 9999 ); | |
| function popcorn_labels_placeholders( $f ) { | |
| // first name can be changed with woocommerce_default_address_fields as well | |
| $f['billing']['billing_first_name']['label'] = 'Quel est ton nom de famille?'; | |
| $f['order']['order_comments']['placeholder'] = 'Ton surnom?'; | |
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
| <?php | |
| // add fields | |
| add_action( 'woocommerce_after_checkout_billing_form', 'misha_select_field' ); | |
| add_action( 'woocommerce_after_order_notes', 'misha_subscribe_checkbox' ); | |
| // save fields to order meta | |
| add_action( 'woocommerce_checkout_update_order_meta', 'misha_save_what_we_added' ); | |
| // select |
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
| <?php | |
| add_filter( 'woocommerce_billing_fields', 'bbloomer_move_checkout_email_field' ); | |
| function bbloomer_move_checkout_email_field( $address_fields ) { | |
| $address_fields['billing_email']['priority'] = 1; | |
| return $address_fields; | |
| } |
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
| <?php | |
| // 1. Hide default notes | |
| add_filter( 'woocommerce_enable_order_notes_field', '__return_false' ); | |
| // 2. Create new billing field | |
| add_filter( 'woocommerce_checkout_fields' , 'bbloomer_custom_order_notes' ); | |
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
| <?php | |
| add_filter( 'woocommerce_default_address_fields' , 'popcorn_rename_city_field', 9999 ); | |
| function popcorn_rename_city_field( $fields ) { | |
| $fields['city']['label'] = 'Ta ville'; //ici tu mets le champs que tu souhaites modifier, entre les crochets | |
| return $fields; | |
| } |