liquidweb / woocommerce-custom-orders-table

Store WooCommerce order data in a custom table for improved performance.
GNU General Public License v3.0
476 stars 51 forks source link

order data are missing out in `PREFIX_woocommerce_orders` table #149

Closed cndipankar closed 2 years ago

cndipankar commented 4 years ago

Describe the bug We have been using your plugin in a very large project, which is running for several years now. Last few months we are encountering an issue order data are missing out and also checked the database table ( Prefix_woocommerce_order) empty for few orders. Thus the entire row of the order is NULL.

To Reproduce Steps to reproduce the behavior:

  1. Add product to cart
  2. Go to checkout page
  3. Fill the name field more than 50 character
  4. Fill the billing address fields more than 200 character
  5. Fill the shipping address fields more than 200 character
  6. Fill the additional info/order note fields more than 200 character
  7. Place Order
  8. See error - Zero order value and no shipping/billing address saved in that table

Expected behavior A proper order should be placed with all details

Screenshots https://prntscr.com/q3s9ki https://prntscr.com/q3s9fj

Versions

Additional context While debugging we understand certain character limits in the shipping address, billing address, name are causing this issue. We modified the character limits both in the database end as well as added JS validation in the checkout form. But still we are encountering this issue for multiple times.

The character limit is below we have set in the checkout page - Name - 50 Shipping/Billing address - 150 Additional Info - 150

We have also installed your plugin into a fresh wordpress installation and still having this issue.

192 168 21 5 8001   mysql   wordpress   wp_woocommerce_orders   phpMyAdmin 4 9 0 1-1 192 168 21 5 8001   mysql   wordpress   wp_woocommerce_orders   phpMyAdmin 4 9 0 1

stevegrunwell commented 4 years ago

Yikes, that's not great. The limits are intentionally set rather high to avoid this very issue, but you're right — there's no validation happening to catch failed database inserts due to column constraints.

It looks like something else may be in play here, though: the first/last name columns are each VARCHAR(100), so a 50 character name should be no issue. Similarly, the billing/shipping address columns are VARCHAR(255), and there's no dedicated column for additional info/order notes.

When you provide addresses > 200 characters, are you referring to billing/shipping_address_1 or the *_address_2 equivalent (which is capped at 200 characters)? Can you provide an example address to use for testing, please?