【问题标题】:how to clear woocommerce checkout fields after place order? [duplicate]下订单后如何清除woocommerce结帐字段? [复制]
【发布时间】:2017-04-07 05:08:02
【问题描述】:

下单后如何清除woocommerce中的checkcout字段,以便注册客户下次下单时需要重新填写?

【问题讨论】:

    标签: wordpress woocommerce


    【解决方案1】:

    只需要在你的子主题的functions.php中添加这一行

    add_filter('woocommerce_checkout_get_value','__return_empty_string',10);
    

    【讨论】:

      【解决方案2】:

      您可以使用woocommerce_checkout_get_value 过滤器清除字段,但这会在每次加载页面时清除它们。

      function clear_checkout_fields($input){
          return '';
      }
      add_filter( 'woocommerce_checkout_get_value' , 'clear_checkout_fields' );
      

      【讨论】:

        猜你喜欢
        • 2021-11-15
        • 2017-03-27
        • 2021-03-26
        • 1970-01-01
        • 2017-05-28
        • 2018-11-20
        • 1970-01-01
        • 1970-01-01
        • 2016-02-10
        相关资源
        最近更新 更多