修改收件欄位為地址或自填超商
檔案:wp-content/plugins/woocommerce/includes/class-wc-countries.php
定義語法區塊:
public function get_default_address_fields()
隱藏公司名稱和城市名:(語法最前加雙斜線以變更為備註說明)
// 'company' => array(
// 'label' => __( 'Company Name', 'woocommerce' ),
// 'class' => array( 'form-row-wide' ),
// ),
// 'city' => array(
// 'label' => __( 'Town / City', 'woocommerce' ),
// 'required' => true,
// 'class' => array( 'form-row-wide', 'address-field' )
// ),
設定必填與非必填:(true為必填/false為非必填項目,二擇一)
'required' => true/false
地址欄位增加說明「地址 (非超商取貨請務必填寫完整地址)」:
'placeholder' => _x( '地址 (非超商取貨請務必填寫完整地址)', 'placeholder', 'woocommerce' ),
地址2欄位變更為超取資訊、該欄位設定為選填:
'address_2' => array(
'label' => __( '超商門市名稱+門市服務代碼', 'woocommerce' ),
'placeholder' => _x( '超商取貨門市資訊 (超商取貨請務必填寫)', 'placeholder', 'woocommerce' ),
'class' => array( 'form-row-wide', 'address-field' ),
'required' => false