Skip to content

Instantly share code, notes, and snippets.

@nguyenvanduocit
Created October 31, 2014 08:39
Show Gist options
  • Save nguyenvanduocit/d0025eb8c9afb47c56d4 to your computer and use it in GitHub Desktop.
Save nguyenvanduocit/d0025eb8c9afb47c56d4 to your computer and use it in GitHub Desktop.
[Woocommerce] Thêm Custom field vào trang checkout
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