Remove fields from checkout block
-
Hi,
I dont need some fields especially state or country fields since our sevice is in one country , no stated here.
So tell me solution of removing fields. Dig in editing of blocks but noting there, probably custom CSS is needed, if so please provide.
Thanks
-
Hi there,
Thanks for reaching out.
This is something that needs to be done by using a PHP script or plugin. Can you please check the following documentation to remove those fields, by using a PHP snippet:
You can also use the following extension to do that:
https://woocommerce.com/products/woocommerce-checkout-field-editor/
I hope it helps!
Best,
Tried all cases and options but these codes not overcome your blocks and fields in form:
// Hook in
add_filter( ‘woocommerce_default_address_fields’ , ‘custom_override_default_address_fields’ );// Our hooked in function – $address_fields is passed via the filter!
function custom_override_default_address_fields( $address_fields ) {
unset($address_fields[‘state’][‘state’]);return $address_fields;
}Trying remove state field but no luck.
Let me kno solution for this one.
Moreover, pasted simple codes from your provided link, either its nemae of label, or setting field as not required, codes not making impact on checkout block forms
Hi @byweris,
I understand you’re looking to remove the billing country field since you sell to one country.
The downside with that is that some payment gateways require the country’s input for payment verification, so it might not be a great idea.
As an alternative, have you considered setting your store’s “Selling location(s)” to the country you sell to? That’ll ensure the country is automatically selected on the checkout (So no country selection is required from customers and the country can also be used for billing verification).
If that’ll work for your use case, you can do this in WooCommerce > Settings > General options (Section). If you’re also selling only to the state your store is based in, you can set the “default customer location” to “shop/country region” to ensure the customer’s state on the checkout defaults to your shop state/region too.
This screenshot shows the required settings: https://d.pr/i/HubAQM
If that won’t work for your use case, let us know so we can help further.
hi, thanks for fast reply.
I sell production currently in one country and Im looking to remove STATE field not country.
Even if follo your steps and setting one country without states, states field remains. Yes, the code also still there in function file no helping tho.
Let me know how to remove that STATE field.
Hi @byweris !
Can you please also share your site’ System Status Report?
You can get it by navigating to the WooCommerce / Status section of your site. Once there, click on the Get system report button and then copy it by clicking on the Copy for support button, then paste it here.I am asking because it will help us try and replicate the same behavior on one of our testing sites.
Please feel free to redact any information from your System Status Report that you think should not be shared publicly. ??
Thank you!
Sure, here it is :
### WordPress Environment ### WordPress address (URL): https://kanapiu.lt Site address (URL): https://kanapiu.lt WC Version: 6.4.1 REST API Version: ? 6.4.1 WC Blocks Version: ? 7.6.0 Action Scheduler Version: ? 3.4.0 WC Admin Version: ? 3.3.2 Log Directory Writable: ? WP Version: ? 5.9.3 - There is a newer version of WordPress available (6.0) WP Multisite: – WP Memory Limit: 256 MB WP Debug Mode: – WP Cron: ? Language: en_US External object cache: – ### Server Environment ### Server Info: Apache PHP Version: 7.4.29 PHP Post Max Size: 64 MB PHP Time Limit: 300 PHP Max Input Vars: 10000 cURL Version: 7.83.1 OpenSSL/1.1.1o SUHOSIN Installed: – MySQL Version: 5.5.5-10.3.27-MariaDB-log Max Upload Size: 64 MB Default Timezone is UTC: ? fsockopen/cURL: ? SoapClient: ? DOMDocument: ? GZip: ? Multibyte String: ? Remote Post: ? Remote Get: ? ### Database ### WC Database Version: 6.4.1 WC Database Prefix: udfx_ Total Database Size: 14.51MB Database Data Size: 12.29MB Database Index Size: 2.22MB udfx_woocommerce_sessions: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_woocommerce_api_keys: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_woocommerce_attribute_taxonomies: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_woocommerce_downloadable_product_permissions: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_woocommerce_order_items: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_woocommerce_order_itemmeta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_woocommerce_tax_rates: Data: 0.00MB + Index: 0.01MB + Engine MyISAM udfx_woocommerce_tax_rate_locations: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_woocommerce_shipping_zones: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_woocommerce_shipping_zone_locations: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_woocommerce_shipping_zone_methods: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_woocommerce_payment_tokens: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_woocommerce_payment_tokenmeta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_woocommerce_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_actionscheduler_actions: Data: 0.04MB + Index: 0.03MB + Engine MyISAM udfx_actionscheduler_claims: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_actionscheduler_groups: Data: 0.00MB + Index: 0.01MB + Engine MyISAM udfx_actionscheduler_logs: Data: 0.03MB + Index: 0.03MB + Engine MyISAM udfx_commentmeta: Data: 0.00MB + Index: 0.01MB + Engine MyISAM udfx_comments: Data: 0.00MB + Index: 0.01MB + Engine MyISAM udfx_e_events: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_e_submissions: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_e_submissions_actions_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_e_submissions_values: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_links: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_options: Data: 4.04MB + Index: 0.06MB + Engine MyISAM udfx_postmeta: Data: 4.62MB + Index: 0.29MB + Engine MyISAM udfx_posts: Data: 2.51MB + Index: 0.07MB + Engine MyISAM udfx_revslider_css: Data: 0.09MB + Index: 0.01MB + Engine MyISAM udfx_revslider_css_bkp: Data: 0.01MB + Index: 0.00MB + Engine MyISAM udfx_revslider_layer_animations: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_revslider_layer_animations_bkp: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_revslider_navigations: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_revslider_navigations_bkp: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_revslider_sliders: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_revslider_sliders_bkp: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_revslider_slides: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_revslider_slides_bkp: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_revslider_static_slides: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_revslider_static_slides_bkp: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_termmeta: Data: 0.02MB + Index: 0.02MB + Engine MyISAM udfx_terms: Data: 0.00MB + Index: 0.01MB + Engine MyISAM udfx_term_relationships: Data: 0.01MB + Index: 0.01MB + Engine MyISAM udfx_term_taxonomy: Data: 0.00MB + Index: 0.01MB + Engine MyISAM udfx_trp_dictionary_en_us_lt_lt: Data: 0.03MB + Index: 0.06MB + Engine MyISAM udfx_trp_dictionary_en_us_lt_lt2: Data: 0.03MB + Index: 0.06MB + Engine MyISAM udfx_trp_dictionary_lt_lt_en_us: Data: 0.04MB + Index: 0.08MB + Engine MyISAM udfx_trp_dictionary_lt_lt_en_us2: Data: 0.03MB + Index: 0.06MB + Engine MyISAM udfx_trp_gettext_en_us: Data: 0.25MB + Index: 0.43MB + Engine MyISAM udfx_trp_gettext_lt_lt: Data: 0.42MB + Index: 0.79MB + Engine MyISAM udfx_trp_original_meta: Data: 0.01MB + Index: 0.03MB + Engine MyISAM udfx_trp_original_strings: Data: 0.05MB + Index: 0.05MB + Engine MyISAM udfx_usermeta: Data: 0.01MB + Index: 0.01MB + Engine MyISAM udfx_users: Data: 0.00MB + Index: 0.01MB + Engine MyISAM udfx_wc_admin_notes: Data: 0.02MB + Index: 0.00MB + Engine MyISAM udfx_wc_admin_note_actions: Data: 0.01MB + Index: 0.00MB + Engine MyISAM udfx_wc_category_lookup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_wc_customer_lookup: Data: 0.00MB + Index: 0.01MB + Engine MyISAM udfx_wc_download_log: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_wc_order_coupon_lookup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_wc_order_product_lookup: Data: 0.00MB + Index: 0.01MB + Engine MyISAM udfx_wc_order_stats: Data: 0.00MB + Index: 0.01MB + Engine MyISAM udfx_wc_order_tax_lookup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_wc_product_attributes_lookup: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_wc_product_meta_lookup: Data: 0.00MB + Index: 0.01MB + Engine MyISAM udfx_wc_rate_limits: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_wc_reserved_stock: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_wc_tax_rate_classes: Data: 0.00MB + Index: 0.01MB + Engine MyISAM udfx_wc_webhooks: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_wdr_order_discounts: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_wdr_order_item_discounts: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_wdr_rules: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_wpmailsmtp_debug_events: Data: 0.02MB + Index: 0.00MB + Engine InnoDB udfx_wpmailsmtp_tasks_meta: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_yith_wcwl: Data: 0.00MB + Index: 0.00MB + Engine MyISAM udfx_yith_wcwl_lists: Data: 0.00MB + Index: 0.01MB + Engine MyISAM ### Post Type Counts ### attachment: 223 awdp_pt_rules: 1 cartflows_flow: 1 cartflows_step: 2 custom_css: 1 customize_changeset: 25 elementor_library: 26 g5core_content: 6 g5core_vc_template: 85 g5core_xmenu_mega: 10 language_switcher: 4 mc4wp-form: 1 nav_menu_item: 13 page: 53 post: 16 product: 16 product_variation: 10 revision: 219 shop_order: 1 ube_content: 1 wp_global_styles: 1 wpcf7_contact_form: 2 ### Security ### Secure connection (HTTPS): ? Hide errors from visitors: ? ### Active Plugins (29) ### Acowebs Woocommerce Dynamic Pricing: by Acowebs – 4.1.3 Ajax Cart AutoUpdate for WooCommerce: by taisho – 1.5.5 Contact Form 7: by Takayuki Miyoshi – 5.5.6 Duplicate Page: by mndpsingh287 – 4.4.8 Elementor Pro: by Elementor.com – 3.5.2 Elementor: by Elementor.com – 3.6.5 Envato Market: by Envato – 2.0.7 Facebook Chat Plugin - Live Chat Plugin for WordPress: by Meta – 2.4 G5 Blog: by G5 – 1.1.2 G5 Core: by G5 – 1.4.5 G5 Element: by G5 – 1.2.0 G5 Install Demo: by G5 – 1.0.6 G5 Shop: by G5 – 1.2.3 Glowing Addons: by G5 – 1.0.0 WPZOOM Instagram Widget: by WPZOOM – 1.9.5 WPBakery Page Builder: by Michael M - WPBakery.com – 6.8.0 Limit Login Attempts Reloaded: by Limit Login Attempts Reloaded – 2.25.2 MC4WP: Mailchimp for WordPress: by ibericode – 4.8.7 Real-Time Find and Replace: by Marios Alexandrou – 4.0.2 Slider Revolution: by ThemePunch – 6.5.14 TranslatePress - Multilingual: by Cozmoslabs Razvan Mocanu Madalin Ungureanu Cristophor Hurduban – 2.2.7 Ultimate Bootstrap Elements for Elementor: by G5Theme – 1.1.20 Checkout Field Editor for WooCommerce: by ThemeHigh – 1.6.1 WooCommerce Blocks: by Automattic – 7.6.0 WooCommerce Stripe Gateway: by WooCommerce – 6.4.0 WooCommerce: by Automattic – 6.4.1 (update to version 6.5.1 is available) WP Mail SMTP: by WPForms – 3.4.0 YITH WooCommerce Compare: by YITH – 2.14.0 YITH WooCommerce Wishlist: by YITH – 3.9.0 ### Inactive Plugins (4) ### Akismet Anti-Spam: by Automattic – 4.2.3 Hello Dolly: by Matt Mullenweg – 1.7.2 Show Stock Status for WooCommerce: by Bright Plugins – 1.0.3 Woo Discount Rules: by Flycart – 2.4.0 ### Must Use Plugins (1) ### WordPress automation by Installatron: by – ### Settings ### API Enabled: – Force SSL: – Currency: EUR (€) Currency Position: right_space Thousand Separator: Decimal Separator: , Number of Decimals: 2 Taxonomies: Product Types: external (external) grouped (grouped) simple (simple) variable (variable) Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog) exclude-from-search (exclude-from-search) featured (featured) outofstock (outofstock) rated-1 (rated-1) rated-2 (rated-2) rated-3 (rated-3) rated-4 (rated-4) rated-5 (rated-5) Connected to WooCommerce.com: – ### WC Pages ### Shop base: #6 - /shop/ Cart: #7 - /cart/ Checkout: #8 - /checkout/ My account: #9 - /my-account/ Terms and conditions: ? Page not set ### Theme ### Name: Glowing Version: 1.0.2 Author URL: https://themeforest.net/user/g5theme Child Theme: ? – If you are modifying WooCommerce on a parent theme that you did not build personally we recommend using a child theme. See: How to create a child theme WooCommerce Support: ? ### Templates ### Overrides: /home/brhere/domains/kanapiu.lt/public_html/wp-content/plugins/g5-shop/woocommerce/archive-product.php /home/brhere/domains/kanapiu.lt/public_html/wp-content/plugins/g5-shop/woocommerce/cart/cross-sells.php /home/brhere/domains/kanapiu.lt/public_html/wp-content/plugins/g5-shop/woocommerce/content-product.php /home/brhere/domains/kanapiu.lt/public_html/wp-content/plugins/g5-shop/woocommerce/content-single-product.php /home/brhere/domains/kanapiu.lt/public_html/wp-content/plugins/g5-shop/woocommerce/global/quantity-input.php /home/brhere/domains/kanapiu.lt/public_html/wp-content/plugins/g5-shop/woocommerce/global/wrapper-end.php /home/brhere/domains/kanapiu.lt/public_html/wp-content/plugins/g5-shop/woocommerce/global/wrapper-start.php /home/brhere/domains/kanapiu.lt/public_html/wp-content/plugins/g5-shop/woocommerce/loop/loop-end.php /home/brhere/domains/kanapiu.lt/public_html/wp-content/plugins/g5-shop/woocommerce/loop/loop-start.php /home/brhere/domains/kanapiu.lt/public_html/wp-content/plugins/g5-shop/woocommerce/single-product/meta.php /home/brhere/domains/kanapiu.lt/public_html/wp-content/plugins/g5-shop/woocommerce/single-product/related.php /home/brhere/domains/kanapiu.lt/public_html/wp-content/plugins/g5-shop/woocommerce/single-product/tabs/tabs.php /home/brhere/domains/kanapiu.lt/public_html/wp-content/plugins/g5-shop/woocommerce/single-product/up-sells.php glowing/woocommerce/content-product_cat.php ### Action Scheduler ### Complete: 173 Oldest: 2022-05-09 08:16:40 +0000 Newest: 2022-05-25 16:44:41 +0000 Pending: 2 Oldest: 2022-05-26 16:44:41 +0000 Newest: 2022-05-30 15:15:33 +0000 ### Status report information ### Generated at: 2022-05-26 11:25:21 +03:00
any help here ?
Hey @byweris,
My apologies for the delay in getting back to you. The cart and checkout blocks are still considered to be in development. That’s why they aren’t part of the WooCommerce core just yet. They’re not complete replacements for the cart and checkout shortcodes.
One of the limitations is customizing the form fields. That’s currently not supported.
https://woocommerce.com/document/cart-checkout-blocks-support-status/#section-8
You’re welcome to hide fields with CSS however if a required field is hidden and it needs some customer input, they won’t be able to check out.
For now, if you need to customize the checkout form, it’s best to stick with the shortcode version.
Let us know if you have any questions.
Hi,
so you are saying checkout blocks are actually useless regarding its editing options ?
any plan when blocks would be finally editable ?
Hi @byweris,
The hook
woocommerce_store_api_checkout_update_order_from_request
can be used to customize the checkout block fields. However, customizing the checkout block fields is currently complex so we’re not able to provide code snippets for it. You’d have to work with a developer to achieve that.The extensibility/modification of cart & checkout blocks is still being developed.
Hi @byweris
We’ve not heard back from you in a while, so I’m marking this thread as resolved. If you have further questions, please feel free to open a new topic.
- The topic ‘Remove fields from checkout block’ is closed to new replies.