2016年5月26日 星期四

[wordpress]woocommerce自訂結帳欄位順序

function custom_override_checkout( $fields ) {
// billing address
$fields['billing']['billing_first_name']['class'] = array('form-row-last');
$fields['billing']['billing_last_name']['class'] = array('form-row-first');
$fields['billing']['billing_phone']['class'] = array('form-row-first');
$fields['billing']['billing_email']['class'] = array('form-row-wide');




// billing address order
$billing_order = array(
"billing_country",
"billing_last_name",
"billing_first_name",
"billing_company",
"billing_address_1",
"billing_address_2",
"billing_city",
"billing_state",
"billing_postcode",
"billing_email",
"billing_phone"
);


foreach($billing_order as $field)
{
$billing_ordered_fields[$field] = $fields["billing"][$field];
}

$fields["billing"] = $billing_ordered_fields;

return $fields;
}

add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout' );

沒有留言:

張貼留言

[Laravel]環境架設,使用docker + laradock

1.選擇使用docker + laradock在windows10的環境使用 先至 docker官方網站 下載 docker for windows   2.依照執行程式下載安裝 這邊我的電腦有遇到一些問題順便記錄下來, 在下載啟動docker時發生錯誤   Hardw...