woocommerce / woocommerce

A customizable, open-source ecommerce platform built on WordPress. Build any commerce solution you can imagine.
https://woocommerce.com
9.35k stars 10.75k forks source link

Indian State Codes are Incorrect #37062

Closed lynnjat7 closed 1 year ago

lynnjat7 commented 1 year ago

Prerequisites

Describe the bug

Three Indian State codes appear to be configured incorrectly in the core WooCommerce code.

States are configured in this file: /woocommerce/i18n/states.php

GST (sales tax) was introduced in India some time ago and this required the state codes to be used as listed here: https://www.zoho.com/in/books/kb/gst/valid-state-codes-list.html

Three of these do not match what we have set up in the states.php file: Andhra Pradesh = AD (not AP)

Chattisgarh = CG (not CT)

Odisha = OD (Not OR)

This causes issues with tax gathering and reporting for Indian merchants.

If the merchant overrides these state codes, either by manually editing the file, or through a hook, then it causes a mismatch with the WooCommerce App. It is no longer able to sync up tax information properly.

For the Above states the Woocommerce App by Default: Andhra Pradesh as AP = Sync Issue will occur Chattisgarh as CT= Sync Issue will occur Odisha as OD= Sync Issue will occur

Expected behavior

We should use the state codes for India as listed in their GST tax rules.

However, we need to understand how changing this might impact the App and other applications before making this change.

Actual behavior

With the wrong state codes in place:

Steps to reproduce

This was first reported by an Indian customer in 6010561-zen.

They may be able to assist in testing any changes to these state codes, or help us understand the proper settings.

WordPress Environment

WordPress Environment

WordPress address (URL): https://www.nehruplaceshop.com Site address (URL): https://www.nehruplaceshop.com WC Version: 7.4.0 REST API Version: ✔ 7.4.0 WC Blocks Version: ✔ 9.4.3 Action Scheduler Version: ✔ 3.5.4 Log Directory Writable: ✔ WP Version: 6.1.1 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.54 (Debian) PHP Version: 8.1.10 PHP Post Max Size: 250 MB PHP Time Limit: 300 PHP Max Input Vars: 2500 cURL Version: 7.64.0 OpenSSL/1.1.1n

SUHOSIN Installed: – MySQL Version: 10.4.20-MariaDB-1:10.4.20+maria~buster-log Max Upload Size: 250 MB Default Timezone is UTC: ✔ fsockopen/cURL: ✔ SoapClient: ✔ DOMDocument: ✔ GZip: ✔ Multibyte String: ✔ Remote Post: ✔ Remote Get: ✔

Database

WC Database Version: 7.4.0 WC Database Prefix: wp_ Total Database Size: 1510.86MB Database Data Size: 905.06MB Database Index Size: 605.80MB wp_woocommerce_sessions: Data: 40.06MB + Index: 6.03MB + 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: 3.52MB + Index: 1.52MB + Engine InnoDB wp_woocommerce_order_itemmeta: Data: 17.55MB + Index: 14.03MB + 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.02MB + 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.03MB + Engine InnoDB wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_actions: Data: 13.52MB + Index: 15.78MB + Engine InnoDB wp_actionscheduler_claims: Data: 0.11MB + Index: 0.06MB + Engine InnoDB wp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_actionscheduler_logs: Data: 10.52MB + Index: 8.63MB + Engine InnoDB wp_bv_fw_requests: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_bv_ip_store: Data: 0.30MB + Index: 0.25MB + Engine InnoDB wp_bv_lp_requests: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_check_email_log: Data: 2.52MB + Index: 0.00MB + Engine InnoDB wp_commentmeta: Data: 1.52MB + Index: 0.56MB + Engine InnoDB wp_comments: Data: 18.55MB + Index: 16.59MB + Engine InnoDB wp_ewwwio_images: Data: 36.56MB + Index: 24.64MB + Engine InnoDB wp_ewwwio_queue: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_grp_google_place: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_grp_google_review: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_grp_google_stats: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_options: Data: 3.47MB + Index: 0.25MB + Engine InnoDB wp_postmeta: Data: 327.58MB + Index: 330.17MB + Engine InnoDB wp_posts: Data: 67.58MB + Index: 62.47MB + Engine InnoDB wp_revslider_css: Data: 0.13MB + Index: 0.00MB + Engine InnoDB wp_revslider_css_bkp: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_revslider_layer_animations: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_revslider_layer_animations_bkp: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_revslider_navigations: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_revslider_navigations_bkp: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_revslider_sliders: Data: 0.03MB + Index: 0.00MB + Engine InnoDB wp_revslider_sliders_bkp: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_revslider_slides: Data: 0.11MB + Index: 0.00MB + Engine InnoDB wp_revslider_slides_bkp: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_revslider_static_slides: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_revslider_static_slides_bkp: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_scalability_pro_cache: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_scalability_pro_profiling: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_smush_dir_images: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_termmeta: Data: 0.14MB + Index: 0.14MB + Engine InnoDB wp_terms: Data: 0.05MB + Index: 0.05MB + Engine InnoDB wp_term_relationships: Data: 31.08MB + Index: 28.94MB + Engine InnoDB wp_term_taxonomy: Data: 0.05MB + Index: 0.08MB + Engine InnoDB wp_tm_taskmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_tm_tasks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_trustindex_google_reviews: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_usermeta: Data: 18.55MB + Index: 29.47MB + Engine InnoDB wp_users: Data: 1.52MB + Index: 1.30MB + Engine InnoDB wp_vxc_zoho_accounts: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_vxc_zoho_log: Data: 113.61MB + Index: 0.19MB + Engine InnoDB wp_wc_admin_notes: Data: 0.08MB + Index: 0.00MB + Engine InnoDB wp_wc_admin_note_actions: Data: 0.05MB + Index: 0.02MB + Engine InnoDB wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wc_customer_lookup: Data: 1.52MB + Index: 1.70MB + Engine InnoDB wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB wp_wc_order_product_lookup: Data: 1.52MB + Index: 1.02MB + Engine InnoDB wp_wc_order_stats: Data: 1.52MB + Index: 0.86MB + Engine InnoDB wp_wc_order_tax_lookup: Data: 1.52MB + Index: 0.70MB + Engine InnoDB wp_wc_product_attributes_lookup: Data: 40.16MB + Index: 22.45MB + Engine InnoDB wp_wc_product_download_directories: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wc_product_meta_lookup: Data: 6.36MB + Index: 12.00MB + Engine InnoDB wp_wc_rate_limits: Data: 0.02MB + Index: 0.02MB + 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_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: 0.50MB + 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: 42.58MB + Index: 0.00MB + Engine InnoDB wp_wfhits: Data: 0.48MB + Index: 0.16MB + Engine InnoDB wp_wfhoover: Data: 0.02MB + Index: 0.02MB + Engine InnoDB wp_wfissues: Data: 0.02MB + Index: 0.06MB + Engine InnoDB wp_wfknownfilelist: Data: 22.55MB + 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.44MB + Index: 0.13MB + 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.13MB + Index: 0.09MB + Engine InnoDB wp_wftrafficrates: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wpmailsmtp_debug_events: Data: 0.02MB + Index: 0.00MB + Engine InnoDB wp_wpmailsmtp_tasks_meta: 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: 71.61MB + Index: 20.09MB + Engine InnoDB wp_yoast_indexable_hierarchy: Data: 2.47MB + Index: 4.13MB + 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: 1.52MB + Index: 0.28MB + Engine InnoDB wp_yoast_seo_meta: Data: 0.14MB + Index: 0.00MB + Engine InnoDB

Post Type Counts

attachment: 25378 block: 1 ep-synonym: 1 grw_feed: 2 is_search_form: 1 jb_store_css: 10 jp_img_sitemap: 13 jp_img_sitemap_index: 1 jp_sitemap: 1 jp_sitemap_master: 1 mc4wp-form: 1 nav_menu_item: 36 oembed_cache: 48 page: 74 post: 19 product: 33251 revision: 6 shop_coupon: 1 shop_order: 10623 shop_order_refund: 1479 vxc_zoho: 1 wc_order_email: 2 wc_order_status: 8 wcst_trigger: 17 wp_global_styles: 1 wpcf7_contact_form: 3 wpcode: 2

Security

Secure connection (HTTPS): ✔ Hide errors from visitors: ✔

Active Plugins (29)

Breeze: by Cloudways – 2.0.17 CCAvenue Payment Gateway for WooCommerce: by CCAvenue – 4.0 Check & Log Email: by WPChill – 1.0.6 Contact Form 7: by Takayuki Miyoshi – 5.7.4 Customer Reviews for WooCommerce: by CusRev – 5.19.0 Envato Market: by Envato – 2.0.8 EWWW Image Optimizer: by Exactly WWW – 6.9.3 Facebook for WooCommerce: by Facebook – 3.0.12 WPCode Lite: by WPCode – 2.0.8.1 Jetpack Boost: by Automattic - Jetpack Site Speed team – 1.7.0 WPBakery Page Builder: by Michael M - WPBakery.com – 6.2.0 Kapee Extensions: by PressLayouts – 1.2.1 MalCare WordPress Security Plugin - Malware Scanner, Cleaner, Security Firewall: by MalCare Security – 4.87 Retainful - Abandoned Cart Recovery Emails and Next Order Coupons: by Retainful – 2.6.19 Scalability Pro: by Dave Hilditch – 5.07 CTX Feed: by WebAppick – 5.1.0 Plugin for Google Reviews: by RichPlugins – 2.2.7 WooCommerce GST PRO: by Stark Digital – 2.1.2 Advanced Order Export For WooCommerce: by AlgolPlus – 3.3.3 Razorpay for WooCommerce: by Team Razorpay – 4.4.2 Integration for WooCommerce and Zoho: by CRM Perks – 1.3.5 WooCommerce Order Status Manager: by SkyVerge – 1.11.9 WooCommerce: by Automattic – 7.4.0 (update to version 7.4.1 is available) Yoast SEO: by Team Yoast – 20.1 WP Bulk Delete: by Xylus Themes – 1.2.3 WP Content Copy Protection & No Right Click: by wp-buy – 3.5.2 WP Mail SMTP: by WPForms – 3.7.0 Widgets for Google Reviews: by Trustindex.io – 9.8.5 XL WooCommerce Sales Triggers: by XLPlugins – 2.11.0

Inactive Plugins (0)

Dropin Plugins (2)

advanced-cache.php: advanced-cache.php object-cache.php: Object Cache Pro (Drop-in)

Must Use Plugins (1)

Object Cache Pro (MU): by Rhubarb Group – 1.18.0

Settings

API Enabled: ✔ Force SSL: – Currency: INR (₹) 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: – Enforce Approved Product Download Directories: – Order datastore: WC_Order_Data_Store_CPT

WC Pages

Shop base: #17 - /shop Cart: #18 - /cart Checkout: #19 - /checkout My account: #20 - /account Terms and conditions: #16017 - /terms-and-conditions

Theme

Name: Kapee Version: 1.5.5 Author URL: https://presslayouts.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: kapee/woocommerce/cart/cross-sells.php kapee/woocommerce/cart/mini-cart.php kapee/woocommerce/checkout/form-checkout.php kapee/woocommerce/checkout/review-order.php kapee/woocommerce/content-product.php kapee/woocommerce/content-single-product.php kapee/woocommerce/content-widget-product.php kapee/woocommerce/loop/loop-end.php kapee/woocommerce/loop/loop-start.php kapee/woocommerce/loop/pagination.php kapee/woocommerce/loop/result-count.php kapee/woocommerce/myaccount/form-login.php kapee/woocommerce/single-product/add-to-cart/variable.php kapee/woocommerce/single-product/product-image.php kapee/woocommerce/single-product/product-thumbnails.php kapee/woocommerce/single-product/related.php kapee/woocommerce/single-product/short-description.php kapee/woocommerce/single-product/tabs/tabs.php kapee/woocommerce/single-product/up-sells.php kapee/woocommerce/single-product-reviews.php kapee/woocommerce/content-product_cat.php

Admin

Enabled Features: activity-panels analytics coupons customer-effort-score-tracks import-products-task experimental-fashion-sample-products shipping-smart-defaults shipping-setting-tour homescreen marketing multichannel-marketing mobile-app-banner navigation new-product-management-experience onboarding onboarding-tasks remote-inbox-notifications remote-free-extensions payment-gateway-suggestions shipping-label-banner subscriptions store-alerts transient-notices woo-mobile-welcome wc-pay-promotion wc-pay-welcome-page

Disabled Features: minified-js product-variation-management settings

Daily Cron: ✔ Next scheduled: 2023-03-03 12:42:11 +05:30 Options: ✔ Notes: 109 Onboarding: completed

Action Scheduler

Complete: 33,695 Oldest: 2023-01-31 07:06:22 +0530 Newest: 2023-03-03 01:55:23 +0530

Failed: 2,508 Oldest: 2023-02-15 18:13:01 +0530 Newest: 2023-02-15 18:13:01 +0530

Pending: 2 Oldest: 2023-03-03 03:51:17 +0530 Newest: 2023-03-03 15:30:50 +0530

Status report information

Generated at: 2023-03-03 02:32:47 +05:30

Isolating the problem

vedanshujain commented 1 year ago

We follow CLDR notation for state codes, which does list Andhra Pradesh as AP. Unfortunately, updating state code without having the notation change would break compatibility for shops that would have already configured this code. Closing this won't fix as now, but can reopen if we find a solution that don't break back compat.