Please enable JavaScript.
Coggle requires JavaScript to display documents.
Bài 24:Xử lý thông tin thanh toán theo ý muốn bằng filter (Xử lý…
Bài 24:Xử lý thông tin thanh toán theo ý muốn bằng
filter
Nhắc lại cấu trúc hàm
add_filter(tên hook, hàm text thực hiện)
link tham khảo của woocommerce:
https://docs.woocommerce.com/document/introduction-to-hooks-actions-and-filters/
Tên hook hệ thống của woocommerce
woocommerce_checkout_fields
Đây là một cái hook có sẵn được đưa ra bởi woocommerce
Sửa mọi thứ thông qua cái hook này
add_filter('woocommerce_checkout_fields','hàm thực hiện là hàm nào')
Xử lý thông tin thanh toán
Level 1
:Sửa và xoá cái có sẵn
Ví dụ 1
:Bỏ
chế độ required
(bắt buộc điền) thế nào
Ví dụ 2
: Sửa lại tên của trường thế nào
Ví dụ 3
:Xoá một trường đi thế nào
Xử lý thông tin thanh toán
Level 2
:Thêm mới
Ví dụ 4
: Thêm một trường text thế nào
Ví dụ 5
:Thêm một trường danh sách thế nào
Nội dung mặc định của Woocommerce cung cấp
Nội dung mặc định của woocommerce cung cấp
Billing
Billing
Billing_first_name
type-Kiểu(text, textarea, password, select)
label(tên nhãn)
placeholder(thông tin gợi ý trước)
class(CSS cho phần tử HTML)
required-Bắt buộc điền hay không?
label_class( CSS cho phần tử HTML nhãn)
option (key=>value pairs)
giatri|=>_('Tên giá tri hiển thị','woocommerce')
billing_last_name
billing_company
billing_address_1
billing_address_2
billing_city
billing_postcode
billing_country
billing_state
billing_email
billing_phone
Shipping
Account
Order
Hoặc xem ở đây
https://docs.woocommerce.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/