WooCommerce Checkout 字段设置和自定义挂钩 [英] WooCommerce Checkout fields settings and customization hooks

查看:22
本文介绍了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-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 字段设置和自定义挂钩的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆