彰化一整天的論壇

 找回密碼
 立即註冊
查看: 622|回復: 0

remove Order Notes from checkout field in Woocommerce

[複製鏈接]
發表於 2015-10-30 21:46:35 | 顯示全部樓層 |閱讀模式
  1. add_filter( 'woocommerce_checkout_fields' , 'alter_woocommerce_checkout_fields' );
  2. function alter_woocommerce_checkout_fields( $fields ) {
  3.      unset($fields['billing']['billing_first_name']); // remove the customer's First Name for billing
  4.      unset($fields['billing']['billing_last_name']); // remove the customer's last name for billing
  5.      unset($fields['billing']['billing_company']); // remove the option to enter in a company
  6.      unset($fields['billing']['billing_address_1']); // remove the first line of the address
  7.      unset($fields['billing']['billing_address_2']); // remove the second line of the address
  8.      unset($fields['billing']['billing_city']); // remove the billing city
  9.      unset($fields['billing']['billing_postcode']); // remove the ZIP / postal code field
  10.      unset($fields['billing']['billing_country']); // remove the billing country
  11.      unset($fields['billing']['billing_state']); // remove the billing state
  12.      unset($fields['billing']['billing_email']); // remove the billing email address - note that the customer may not get a receipt!
  13.      unset($fields['billing']['billing_phone']); // remove the option to enter in a billing phone number
  14.      unset($fields['shipping']['shipping_first_name']);
  15.      unset($fields['shipping']['shipping_last_name']);
  16.      unset($fields['shipping']['shipping_company']);
  17.      unset($fields['shipping']['shipping_address_1']);
  18.      unset($fields['shipping']['shipping_address_2']);
  19.      unset($fields['shipping']['shipping_city']);
  20.      unset($fields['shipping']['shipping_postcode']);
  21.      unset($fields['shipping']['shipping_country']);
  22.      unset($fields['shipping']['shipping_state']);
  23.      unset($fields['account']['account_username']); // removing this or the two fields below would prevent users from creating an account, which you can do via normal WordPress + Woocommerce capabilities anyway
  24.      unset($fields['account']['account_password']);
  25.      unset($fields['account']['account_password-2']);
  26.      unset($fields['order']['order_comments']); // removes the order comments / notes field
  27.      return $fields;
  28. }
複製代碼
http://clicknathan.com/web-design/remove-order-notes-woocommerce/
回復

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即註冊

本版積分規則

 ㄚ母滴雞湯
 員林香純滴雞精

Archiver|手機版|小黑屋|彰化一整天的論壇(Excel,Office)  

GMT+8, 2020-2-25 11:44 , Processed in 0.113902 second(s), 19 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表