Categories

有特色的模板

WooCommerce. 如何删除结帐字段

Guillaume杜马斯 2015年9月28日
Rating: 5.0/5. From 5 votes.
Please wait...

本教程向您展示如何删除 checkout 字段在WooCommerce商店.

WooCommerce. 如何删除结帐字段

默认WooCommerce checkout 表单附带了几个字段,供客户输入他们的账单详细信息. 但在某些情况下,您可能希望隐藏其中一些字段. For example, 如果你只销售虚拟产品, 你可以去掉账单地址这样的字段:

WooCommerce._How_to_remove_checkout_fields-1

为了去除 checkout 字段,需要执行以下操作:

  1. Open up the wp-content /主题/ themeXXXXX /包括/自定义-function.php file. 您可能需要将其下载到本地系统,如果您正在使用 FTP,也可以直接通过 hosting file manager.

  2. 向下滚动到文件的最后,并在那里添加以下代码:

    
    
  3. 选择要从下面的列表中删除的字段,并将相应的代码插入到 custom_override_checkout_fields function before the return statement.

    设置字段($[“账单”][' billing_first_name ']);
    设置字段($[“账单”][' billing_last_name ']);
    设置字段($[“账单”][' billing_company ']);
    设置字段($[“账单”][' billing_address_1 ']);
    设置字段($[“账单”][' billing_address_2 ']);
    设置字段($[“账单”][' billing_city ']);
    设置字段($[“账单”][' billing_postcode ']);
    设置字段($[“账单”][' billing_country ']);
    设置字段($[“账单”][' billing_state ']);
    设置字段($[“账单”][' billing_phone ']);
    设置字段($(“订单”)[' order_comments ']);
    设置字段($[“账单”][' billing_email ']);
    设置字段($(“帐户”)[' account_username ']);
    设置字段($(“帐户”)[' account_password ']);
    设置字段($(“帐户”)[' account_password-2 ']);
    
    WooCommerce._How_to_remove_checkout_fields-2
  4. 将更改保存在 wp-content /主题/ themeXXXXX /包括/自定义-function.php 文件并将其上传到服务器. 重新加载页面. 选择要取消设置的字段将从 checkout page:

    WooCommerce._How_to_remove_checkout_fields-3

请随时查看下面的详细视频教程:

WooCommerce. 如何删除结帐字段
这个条目被张贴了出来 WooCommerce教程 and tagged checkout, field, WooCommerce. Bookmark the permalink.

提交罚单

如果您仍然无法找到关于您的问题的足够的教程,请使用以下链接向我们的技术支持团队提交请求. 我们将在接下来的24小时内为您提供我们的帮助和协助: 提交罚单