Created
October 31, 2014 08:39
-
-
Save nguyenvanduocit/d0025eb8c9afb47c56d4 to your computer and use it in GitHub Desktop.
[Woocommerce] Thêm Custom field vào trang checkout
This file contains 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('init', 'ae_woocommerce_before_checkout_form'); | |
function ae_woocommerce_before_checkout_form(){ | |
add_filter( 'woocommerce_checkout_fields', 'ae_woocommerce_checkout_fields' ); | |
} | |
function ae_woocommerce_checkout_fields($checkout_fields){ | |
$checkout_fields['order']["new_comment"] = array( | |
'type' => 'textarea', | |
'class' => array('notes'), | |
'label' => __( 'Order Notes', 'woocommerce' ), | |
'placeholder' => _x('Notes about your order, e.g. special notes for delivery.', 'placeholder', 'woocommerce') | |
); | |
return $checkout_fields; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment