Yahoo! I managed to get it to what I want, as shown here, with the following codes.
// Extra Shipping fields
function wc_extra_shipping_fields( $fields ) {
$fields['shipping_email'] = array(
'label' => __( 'Email Address', 'woocommerce' ),
'required' => true,
// 'placeholder' => _x( 'Email', 'placeholder', 'woocommerce' ),
'class' => array( 'form-row-first' ),
'validate' => array( 'email' )
);
$fields['shipping_phone'] = array(
'label' => __( 'Phone', 'woocommerce' ),
'required' => true,
// 'placeholder' => _x( 'Phone', 'placeholder', 'woocommerce' ),
'class' => array( 'form-row-last' ),
'validate' => array( 'phone' ),
'clear' => true
);
retu $fields;
}
add_filter( 'woocommerce_shipping_fields' , 'wc_extra_shipping_fields' );
// Extra Shipping fields in Admin Order Meta
function wc_extra_admin_shipping_fields( $fields ) {
global $theorder;
$fields['email'] = array(
'label' => __( 'Email', 'woocommerce' ),
'value' => get_post_meta( $theorder->id, '_shipping_email', true ),
'validate' => array( 'phone' ),
);
$fields['phone'] = array(
'label' => __( 'Phone', 'woocommerce' ),
'value' => get_post_meta( $theorder->id, '_shipping_phone', true ),
'validate' => array( 'phone' ),
'clear' => true
);
retu $fields;
}
add_filter( 'woocommerce_admin_shipping_fields', 'wc_extra_admin_shipping_fields' );
I just hope nothing is amiss ... (--)"
WordPress ...
ما را در سایت WordPress دنبال میکنید
برچسب:
نویسنده: استخدام کار
بازدید: 363
تاريخ: يکشنبه
17 مرداد
1395 ساعت: 3:48