Để xóa bớt một field trong phần thanh toán, bạn chèn code này vào file functions.php của thư mục theme bạn đang dùng.
Đó là đoạn code mẫu nếu như bạn muốn xóa field nhập Post Code khi thanh toán. Nếu bạn muốn xóa thêm một field khác chỉ cần viết thêm một đoạn unset () nữa là được. Ví dụ
add_filter( 'woocommerce_checkout_fields' , 'custom_override_checkout_fields' ); function custom_override_checkout_fields( $fields ) { unset($fields['billing']['billing_postcode']); unset($fields['billing']['billing_state']); unset($fields['billing']['billing_address_2']); unset($fields['billing']['billing_company']); unset($fields['billing']['billing_last_name']); unset($fields['billing']['billing_city']); unset($fields['billing']['billing_country']); unset($fields['order']['order_comments']); return $fields; }
Cách làm placeholder các dòng input
function custom_woocommerce_checkout_fields( $fields ) { $fields['billing']['billing_first_name']['placeholder'] = 'Họ tên'; $fields['billing']['billing_address_1']['placeholder'] = 'Địa chỉ'; $fields['billing']['billing_phone']['placeholder'] = 'Điện thoại'; $fields['billing']['billing_email']['placeholder'] = 'Email'; return $fields; }
Vậy nếu bạn cần xóa thêm bất cứ field nào mà trong bài này mình không đề cập thì sao? Trước tiên bạn hãy quan sát một dòng unset() của mình như sau
unset($fields['billing']['billing_address_2']);
Bạn thấy giá trị billing và billing_address_2 chứ? Bây giờ bằng cách dựa vào danh sách các giá trị dưới đây, bạn có thể thay bằng một giá trị tương ứng với field bạn cần xóa
- billing
- billing_first_name
- billing_last_name
- billing_company
- billing_address_1
- billing_address_2
- billing_city
- billing_postcode
- billing_country
- billing_state
- billing_email
- billing_phone
- shipping
- shipping_first_name
- shipping_last_name
- shipping_company
- shipping_address_1
- shipping_address_2
- shipping_city
- shipping_postcode
- shipping_country
- shipping_state
- account
- account_username
- account_password
- account_password-2
- order
- order_comments
I believe this site has very great indited content blog posts.
Побеждайте вместе с друзьями в онлайн казино Беларусь на платформе с высокими оценками
онлайн казино Беларусь [url=https://sayokay.by/]онлайн казино Беларусь[/url] .
Как выбрать надежное онлайн казино
[url=http://ru-gps.ru/bitrix/click.php?goto=https://spgk.kz/]казино[/url]
Воєнторг
8. Специальное снаряжение для боевых действий
тактичні рукавиці купити [url=https://voentorgklyp.kiev.ua/odyag/rukavychky/]https://voentorgklyp.kiev.ua/odyag/rukavychky/[/url] .
tintucnamdinh24h.com
그는 교체된 붕대를 문질러야 했고, 문지른 후에는 알코올을 발라야 했습니다.
sandyterrace.com
Zhang Xin이 올려다 보았습니다. 오, 천체 지리학자입니다.
Cash Winning Games to Play in Kenya
best online casino games kenya [url=https://levine.co.ke/best-online-games-that-pay-real-money-in-kenya]best online casino games kenya[/url] .
bmipas.com
実用性が高く、具体的なアドバイスが役に立ちました。
Narin ve tatlı, aynı zamanda escort sakarya sakarya arkadaş canlısı ve eğlenceyi seven bir insanım. Her zaman gülümseyen ve çok açık fikirli güzel bir hanımefendiyim. Doğal bir vücudum var, inanılmaz deneyim arayışında iseniz o halde ne arzuladığınızı bana iletebilirsiniz.
Escort Sakarya Bayan Birbirinden güzel kadınlarla alakadar ne ararsanız bulabileceğiniz Bayan arkadaş arama sayfası sizin için 24 saat hizmet sunar.
hello!,I really like your writing so a lot! share we keep up a correspondence extra approximately your post on AOL? I need an expert in this house to unravel my problem. May be that is you! Taking a look ahead to see you.