WooCommerce Checkout fields settings and customization hooks(WooCommerce Checkout 字段设置和自定义挂钩)
问题描述
有谁知道 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-billing.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 字段设置和自定义挂钩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:WooCommerce Checkout 字段设置和自定义挂钩
基础教程推荐
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 如何替换eregi() 2022-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
