Below errors I got in php error log file
[Sun Mar 29 03:58:32 2015] [error] [client 124.123.238.234] WordPress database error Table ‘./example_db/ip_woocommerce_order_itemmeta’ is marked as crashed and should be repaired for query DELETE FROM itemmeta USING ip_woocommerce_order_itemmeta itemmeta INNER JOIN ip_woocommerce_order_items items WHERE itemmeta.order_item_id = items.order_item_id and items.order_id = 10600 made by do_action(‘wp_ajax_woocommerce_checkout’), call_user_func_array, WC_AJAX::checkout, WC_Checkout->process_checkout, WC_Checkout->create_order, WC_Abstract_Order->remove_order_items, referer: https://example.com/checkout/
[Sun Mar 29 03:58:32 2015] [error] [client 124.123.238.234] WordPress database error Table ‘./example_db/ip_woocommerce_order_items’ is marked as crashed and should be repaired for query DELETE FROM ip_woocommerce_order_items WHERE order_id = 10600 made by do_action(‘wp_ajax_woocommerce_checkout’), call_user_func_array, WC_AJAX::checkout, WC_Checkout->process_checkout, WC_Checkout->create_order, WC_Abstract_Order->remove_order_items, referer: https://example.com/checkout/
[Sun Mar 29 03:58:32 2015] [error] [client 124.123.238.234] WordPress database error Table ‘./example_db/ip_woocommerce_order_items’ is marked as crashed and should be repaired for query INSERT INTO ip_woocommerce_order_items (order_item_name,order_item_type,order_id) VALUES (‘product title’,’line_item’,10600) made by do_action(‘wp_ajax_woocommerce_checkout’), call_user_func_array, WC_AJAX::checkout, WC_Checkout->process_checkout, WC_Checkout->create_order, WC_Abstract_Order->add_product, wc_add_order_item, referer: https://example.com/checkout/
If you reached here following this question then below is answer for you —>
I saw many people facing this issue but they didn’t find answer. Because there is no problem with WooCommerce. 402 is an exception thrown by WooCommerce at run time when try part fails to run. It will not show php error but php errors were logged in log file. Please monitor your log file to locate error with your WordPress. So you will get idea what trouble shooting going with you.
I was having this error, in my case – it definitely wasn’t WooCommerce related.
When setting up my WordPress install, I opted to make a rather long table prefix. Unfortunately, MySQL limits the number of characters that you can have in a table name. This caused a handful of WooCommerce tables to NOT be created when the plugin was activated.
To solve this, I changed the table prefix to something much shorter and deactivated/reactivated WooCommerce.
Hope this helps someone!
in my case it happened because woocommerce didn’t installed some tables. Check woocommerce system status and check woocommerce_order_items table exists.
Hope this would help for someone.
CREATE TABLE IF NOT EXISTS wp_woocommerce_order_items (
order_item_id bigint(20) NOT NULL,
order_item_name longtext NOT NULL,
order_item_type varchar(200) NOT NULL DEFAULT ”,
order_id bigint(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
—
— Indexes for dumped tables
—
—
— Indexes for table wp_woocommerce_order_items
—
ALTER TABLE wp_woocommerce_order_items
ADD PRIMARY KEY (order_item_id), ADD KEY order_id (order_id);
—
— AUTO_INCREMENT for dumped tables
—
—
— AUTO_INCREMENT for table wp_woocommerce_order_items
—
ALTER TABLE wp_woocommerce_order_items
MODIFY order_item_id bigint(20) NOT NULL AUTO_INCREMENT;
@chathuj Thanks for sharing.
Basically this error comes when database query fails to run insert new order.
the link is broken. Any other option?