Shipping zones
-
there is location dhaka, bangladesh. my shipping zones are labelled
1. inside dhaka : inside dhaka all postals except suburb dhaka
2. suburb dhaka : also in dhaka city but specific postals
so i set sepecific postals on suburb shipping zone. but i can’t exclude them from inside dhaka. for example 1313 is specific in suburb. in checkout page i input 1313 and site takes it as inside dhaka. how can i exclude 1313 postal code from inside dhaka.additionally postal code is not required. how to make it required.
-
Hi there,
I’d suggest you to add all the valid postcodes in your “inside dhaka” zone (making sure that they don’t overlap with the ones in “Suburb shaka”.
Please note that in order to make it easier, you can also use a range of postcodes (e.g. 90210…99000), or use wildcards (e.g. CB23*).
Here you can find more details about this: https://docs.woocommerce.com/document/setting-up-shipping-zones/#section-3
Thanks
ok. and what about the postal code requirement
Hi there,
In order to make the post-code field a required field, you could use an extension like https://woocommerce.com/products/woocommerce-checkout-field-editor OR do the inverse of the custom code highlighted here: https://stackoverflow.com/questions/47859120/make-checkout-shipping-postcode-field-not-required-in-woocommerce
Essentially, you’ll be setting
$address_fields['postcode']['required']
totrue
.i added a snippet
add_filter( 'woocommerce_default_address_fields', 'customise_postcode_fields' ); function customise_postcode_fields( $address_fields ) { $address_fields['postcode']['required'] = true; return $address_fields; }
didn’t worked
Hi there,
Please note that by default, the postcode field is required in WooCommerce, so I guess that some plugin or your theme is customizing your Checkout page to make this field non-required.
I’d suggest you go to Appearance>Themes and try to ‘preview’ your Checkout page using a default theme (like Storefront) to see if the field becomes required again. If that’s the case, it will mean that your current theme is disabling this requirement.
If the issue persists,the best way to find the origin of the issue is to disable all the active plugins except WooCommerce to see if the issue is fixed. If that’s the case, you just need to reactivate the disabled plugins one by one and reload the Checkout page to check if the issue reappears. You’ll know the culprit plugin when you reactivate one and the problem reappears.
Of course, I’d suggest you to perform this test on a staging version of your site (you can use “WP Staging” plugin to create one quickly).
Hi again,
Just to let you know, I’ve tried the code that you shared in your previous reply, setting the required attribute to false and I confirm that it works, as the postcode field became non-required on my site.
Maybe the problem is that your theme or a plugin in your site is using this filter to make this field non-required and it has a higher priority, overriding the code that you’re trying to add now.
You can try to increase its priority with the following code:
add_filter( 'woocommerce_default_address_fields', 'customise_postcode_fields', 100 ); function customise_postcode_fields( $address_fields ) { $address_fields['postcode']['required'] = true; return $address_fields; }
ok, so i…
1. activated storefront theme. no changes
2. deactivated all the plugin except original woocommerce. no changes
3. added this code in storefronts function.phpadd_filter( 'woocommerce_default_address_fields', 'customise_postcode_fields', 100 ); function customise_postcode_fields( $address_fields ) { $address_fields['postcode']['required'] = true; return $address_fields; }
no changes even if i put 99999999 instead of 100.
4. activated ‘code snippets’ plugin and added the same code with priority 32767. still no changes- This reply was modified 3 years, 11 months ago by muza11.
Hi @muza11,
Thank you for this updated information – it should work; as it is working in our test sites. If it is not too much trouble, can you post your Status Report with just Storefront enabled with the other plugins save WooCommerce disabled? That way we can try to mirror it and see what is going on.
I look forward to hearing back from you!
with the other plugins save WooCommerce disabled
i am not clear with this words.
you mean all the plugin associated with woocommerce should be enabled? or only the main woocommerce will be enable and all other plugin deativated?- This reply was modified 3 years, 10 months ago by muza11.
### WordPress Environment ### WordPress address (URL): https://tkc.test Site address (URL): https://tkc.test WC Version: 4.9.0 REST API Version: ? 4.9.0 WC Blocks Version: ? 4.0.0 Action Scheduler Version: ? 3.1.6 WC Admin Version: ? 1.8.3 Log Directory Writable: ? WP Version: 5.6 WP Multisite: – WP Memory Limit: 512 MB WP Debug Mode: – WP Cron: ? Language: en_US External object cache: – ### Server Environment ### Server Info: Apache/2.4.43 (Win64) OpenSSL/1.1.1g PHP/7.4.6 PHP Version: 7.4.6 PHP Post Max Size: 40 MB PHP Time Limit: 120 PHP Max Input Vars: 1000 cURL Version: 7.69.1 OpenSSL/1.1.1g SUHOSIN Installed: – MySQL Version: 5.5.5-10.4.11-MariaDB Max Upload Size: 40 MB Default Timezone is UTC: ? fsockopen/cURL: ? SoapClient: ? Your server does not have the SoapClient class enabled - some gateway plugins which use SOAP may not work as expected. DOMDocument: ? GZip: ? Multibyte String: ? Remote Post: ? Remote Get: ? ### Database ### WC Database Version: 4.9.0 WC Database Prefix: wp_ Total Database Size: 26.69MB Database Data Size: 23.17MB Database Index Size: 3.52MB wp_woocommerce_sessions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_order_itemmeta: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_shipping_zone_locations: Data: 0.06MB + Index: 0.03MB + Engine InnoDB wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_actions: Data: 0.05MB + Index: 0.11MB + Engine InnoDB wp_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_logs: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_comments: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_ewd_otp_customers: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_ewd_otp_custom_fields: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_ewd_otp_fields_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_ewd_otp_orders: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_ewd_otp_order_statuses: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_ewd_otp_sales_reps: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_fbv: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_fbv_attachment_folder: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_ms_snippets: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_options: Data: 3.08MB + Index: 0.13MB + Engine InnoDB wp_postmeta: Data: 2.48MB + Index: 0.14MB + Engine InnoDB wp_posts: Data: 1.17MB + Index: 0.06MB + Engine InnoDB wp_redirection_404: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_redirection_groups: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_redirection_items: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_redirection_logs: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_signups: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_snippets: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_termmeta: Data: 0.05MB + Index: 0.03MB + Engine InnoDB wp_terms: Data: 0.06MB + Index: 0.03MB + Engine InnoDB wp_term_relationships: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_term_taxonomy: Data: 0.20MB + Index: 0.03MB + Engine InnoDB wp_um_metadata: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_um_notifications: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_usermeta: Data: 0.09MB + Index: 0.03MB + Engine InnoDB wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wcpdf_invoice_number: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_admin_notes: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_avatars_cache: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_wc_cancel_orders: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_comments_subscription: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_feedback_forms: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_follow_users: Data: 0.02MB + Index: 0.13MB + Engine InnoDB wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_wc_order_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_phrases: Data: 0.05MB + Index: 0.02MB + Engine InnoDB wp_wc_product_meta_lookup: Data: 0.02MB + Index: 0.09MB + Engine InnoDB wp_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_users_rated: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_users_voted: Data: 0.02MB + Index: 0.08MB + Engine InnoDB wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wfblockediplog: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wfblocks7: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wfconfig: Data: 2.45MB + Index: 0.00MB + Engine InnoDB wp_wfcrawlers: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wffilechanges: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wffilemods: Data: 6.52MB + Index: 0.00MB + Engine InnoDB wp_wfhits: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wfhoover: Data: 2.52MB + Index: 0.36MB + Engine InnoDB wp_wfissues: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_wfknownfilelist: Data: 2.52MB + Index: 0.00MB + Engine InnoDB wp_wflivetraffichuman: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wflocs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wflogins: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wfls_2fa_secrets: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wfls_settings: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wfnotifications: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wfpendingissues: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_wfreversecache: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wfsnipcache: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_wfstatus: Data: 0.14MB + Index: 0.09MB + Engine InnoDB wp_wftrafficrates: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wotv_woo_track_info: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_yith_wcwl: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_yith_wcwl_lists: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_yoast_indexable: Data: 0.09MB + Index: 0.08MB + Engine InnoDB wp_yoast_indexable_hierarchy: Data: 0.02MB + Index: 0.05MB + Engine InnoDB wp_yoast_migrations: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_yoast_primary_term: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_yoast_seo_links: Data: 0.02MB + Index: 0.03MB + Engine InnoDB ### Post Type Counts ### 3d-flip-book: 1 amp_validated_url: 2 attachment: 44 bp-email: 15 custom_css: 1 customize_changeset: 13 dflip: 1 elementor_library: 1 jetpack_migration: 2 jp_img_sitemap: 1 jp_sitemap: 1 jp_sitemap_master: 1 key-alo: 1 nav_menu_item: 21 notification: 13 oembed_cache: 38 page: 20 post: 6 product: 5 product_variation: 4 psppnotif_workflow: 2 revision: 18 shop_coupon: 1 shop_order: 4 um_directory: 1 um_form: 3 um_private_content: 5 wpcf7_contact_form: 1 wpdiscuz_form: 1 wppr_review: 1 yith-wcbm-badge: 5 ### Security ### Secure connection (HTTPS): ? Hide errors from visitors: ? ### Active Plugins (1) ### WooCommerce: by Automattic – 4.9.0 ### Inactive Plugins (49) ### 3D FlipBook : Dflip Lite: by DearHive – 1.7.4.1 Adminimize: by Frank Bültge – 1.11.7 Advanced Editor Tools (previously TinyMCE Advanced): by Automattic – 5.6.0 Classic Editor: by WordPress Contributors – 1.6 Code Snippets: by Code Snippets Pro – 2.14.0 Colorlib Login Customizer: by Colorlib – 1.2.97 Contact Form 7: by Takayuki Miyoshi – 5.3.2 Custom Post Type UI: by WebDevStudios – 1.8.2 Default featured image: by Jan Willem Oostendorp – 1.6.4 Developer Tools Blocker: by SwiftNinjaPro – 2.0.1 Elementor: by Elementor.com – 3.0.16 Flexible Shipping: by WP Desk – 4.0.7 Health Check & Troubleshooting: by The www.ads-software.com community – 1.4.5 Jetpack by WordPress.com: by Automattic – 9.3 Orbit Fox Companion: by Themeisle – 2.10.3 Orders Tracking for WooCommerce: by VillaTheme – 1.1.8.5 Preloader Plus: by Massimo Sanfelice | Maxsdesign – 2.2.1 Proxy & VPN Blocker: by RickstermUK – 1.7.2 PublishPress Capabilities: by PublishPress – 1.10.1 PublishPress Checklists: by PublishPress – 2.4.2 Redirection: by John Godley – 4.9.2 Redirect URL to Post: by Chatty Mango – 0.18.3 SoftTech-IT bKash, Rocket, Nagad: by Md Toriqul Mowla Sujan – 2.2 – Installed version not tested with active version of WooCommerce 4.0 Ultimate Member: by Ultimate Member – 2.1.15 Ultimate Member - Online: by Ultimate Member – 2.1.3 Ultimate Member - Private Content: by Ultimate Member – 2.0.5 Ultimate Member - Real-time Notifications: by Ultimate Member – 2.1.5 Ultimate Member - reCAPTCHA: by Ultimate Member – 2.1.7 Ultimate Member - Terms & Conditions: by Ultimate Member – 2.1.3 Use Any Font: by Dnesscarkey – 5.11.5 User Blocker: by Solwin Infotech – 1.5.2 WC Cancel Order: by Vikram S – 3.0 WooCommerce PDF Invoices & Packing Slips: by Ewout Fernhout – 2.7.3 WooCommerce Shipping & Tax: by Automattic – 1.25.5 Wordfence Security: by Wordfence – 7.4.14 WP Content Copy Protection & No Right Click: by wp-buy – 3.1.4 WP Dark Mode: by WPPOOL – 1.3.5 WP Dark Mode Ultimate: by WPPOOL – 1.1.2 wpDiscuz: by gVectors Team – 7.1.0 WP Product Review Lite: by ThemeIsle – 3.7.11 WP Rocket: by WP Media – 3.8.0.1 WPS Hide Login: by WPServeur NicolasKulka wpformation – 1.6.1 YITH Essential Kit for WooCommerce #1: by YITH – 2.1.7 YITH Pre-Order for WooCommerce: by YITH – 1.2.13 YITH WooCommerce Badge Management: by YITH – 1.4.8 YITH WooCommerce Quick View: by YITH – 1.4.8 YITH WooCommerce Waiting List: by YITH – 1.6.1 YITH WooCommerce Wishlist: by YITH – 3.0.17 Yoast SEO: by Team Yoast – 15.6.2 ### Dropin Plugins (1) ### advanced-cache.php: advanced-cache.php ### Must Use Plugins (2) ### Health Check Troubleshooting Mode: by – 1.7.2 Hello Dolly: by Matt Mullenweg – 1.7.2 ### Settings ### API Enabled: – Force SSL: – Currency: BDT (??) Currency Position: left Thousand Separator: , Decimal Separator: . Number of Decimals: 0 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: #4285 - /shop/ Cart: #4286 - /cart/ Checkout: #4287 - /checkout/ My account: #4288 - /shop-account/ Terms and conditions: #56 - /terms-conditions/ ### Theme ### Name: Storefront Version: 3.2.0 (update to version 3.3.0 is available) Author URL: https://woocommerce.com/ 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: – ### Action Scheduler ### Complete: 66 Oldest: 2020-12-15 16:39:14 +0600 Newest: 2021-01-15 16:31:41 +0600 Pending: 1 Oldest: 2021-01-15 16:32:42 +0600 Newest: 2021-01-15 16:32:42 +0600
are you alive comrade?
- The topic ‘Shipping zones’ is closed to new replies.