問題描述
有誰知道 Woocommerce 插件文件中原始結賬字段設置在哪里?例如原始字段標簽和占位符等?
does anyone know where the original checkout field settings are, within the Woocommerce plugin files? E.g The original field labels and placeholders etc?
推薦答案
Woocommerce 中沒有結帳字段設置...
但是您可以自定義它們:
- 用于自定義結帳的 Woocommerce 開發人員文檔參考字段
- 或任何可用的插件,其中大多數是商業插件.
But you can customize them using:
- The Woocommerce Developer Documentation reference to customize checkout fields
- or any of the availaible plugins which most of them are commercial.
1) 結帳字段主要由 ??3 個 Woocommerce 類管理:
- WC_Checkout
使用 get_checkout_fields()
方法(和 get_value()
方法)
- WC_Countries
使用 get_default_address_fields()
方法和 get_address_fields()
方法
- WC_Customer
使用的類也適用于我的帳戶地址字段.
1) Checkout fields are managed essentially by 3 Woocommerce classes:
- WC_Checkout
Class using get_checkout_fields()
method (and get_value()
method)
- WC_Countries
Class using get_default_address_fields()
method and get_address_fields()
method
- WC_Customer
Class used also for My account Address fields.
并使用 woocommerce_form_field()
模板函數,其中定義了不同的字段類型.
And uses woocommerce_form_field()
template function where the different field types are defined.
2) 自定義涉及的主要鉤子是:
- woocommerce_default_address_fields
過濾器hook 和 StackOverFlow 相關線程
- woocommerce_checkout_fields
過濾器hook 和 StackOverFlow 相關線程
- woocommerce_billing_fields
過濾器hook 和 StackOverFlow 相關線程
- woocommerce_shipping_fields
過濾器hook 和 StackOverFlow 相關線程
- woocommerce_form_field_{$args[type]}
過濾鉤子和StackOverFlow 相關線程
3) 涉及的主要相關模板 可以覆蓋通過主題是:
- checkout/form-checkout.php
- checkout/form-b??illing.php
- checkout/form-shipping.php
- checkout/form-loging.php
3) The main related templates involved that can be overridden through via the theme are:
- checkout/form-checkout.php
- checkout/form-billing.php
- checkout/form-shipping.php
- checkout/form-loging.php
相關: 模板結構&通過主題覆蓋模板
這篇關于WooCommerce Checkout 字段設置和自定義掛鉤的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!