WooCommerce Checkout For Digital Products: Remove Unwanted Fields Without Plugins
Автор: fetchprofits
Загружено: 2025-03-17
Просмотров: 126
Описание:
📌 Get Divi to manage WordPress, Design Pages, & more 👉🏼 https://fetchprofits.com/divi
🔥 Free for life: Turn Email Into a Monster Revenue Generator. Get access to freebies, my Ultimate Email Resource Kit & eCommerce OS Newsletter 👉🏼 https://fetchprofits.com/ecommerce-os/
🔥 Need help with Email marketing strategy, automations, campaigns, copy, design, opt-in forms, and more? Get on a 15-min free call: https://fetchprofits.com/call
______
Want to remove extra fields such as billing address and shipping address on WooCommerce checkout (especially for selling digital products) without a plugin? This video tutorial is for you.
📌 The official Blog Post For WooCommerce for understanding how this method works 👉🏼 https://buff.ly/EWXxhR9
⚡️ The code you should Tweak and add to functions.php file
/**
Remove all possible fields
**/
function wc_remove_checkout_fields( $fields ) {
// Billing fields
unset( $fields['billing']['billing_company'] );
unset( $fields['billing']['billing_email'] );
unset( $fields['billing']['billing_phone'] );
unset( $fields['billing']['billing_state'] );
unset( $fields['billing']['billing_first_name'] );
unset( $fields['billing']['billing_last_name'] );
unset( $fields['billing']['billing_address_1'] );
unset( $fields['billing']['billing_address_2'] );
unset( $fields['billing']['billing_city'] );
unset( $fields['billing']['billing_postcode'] );
// Shipping fields
unset( $fields['shipping']['shipping_company'] );
unset( $fields['shipping']['shipping_phone'] );
unset( $fields['shipping']['shipping_state'] );
unset( $fields['shipping']['shipping_first_name'] );
unset( $fields['shipping']['shipping_last_name'] );
unset( $fields['shipping']['shipping_address_1'] );
unset( $fields['shipping']['shipping_address_2'] );
unset( $fields['shipping']['shipping_city'] );
unset( $fields['shipping']['shipping_postcode'] );
// Order fields
unset( $fields['order']['order_comments'] );
return $fields;
}
add_filter( 'woocommerce_checkout_fields', 'wc_remove_checkout_fields' );
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: