WCMp Core
-
AuthorPosts
-
-
July 27, 2021 at 12:27 PM #125498purchaseParticipant
Hi,
I got below error when every time a new order is created.
WordPress Database Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ” WHERE order_id = \’3487\’ AND product_id = \’2935\’ AND variation_id = \’0\’ A’ at line 1 for query SELECT * FROM wp1ccf17wcmp_vendor_orders ‘ WHERE order_id = \’3487\’ AND product_id = \’2935\’ AND variation_id = \’0\’ AND order_item_id = \’1513\’ AND is_trashed = \’\” made by require(‘wp-blog-header.php’), require_once(‘wp-includes/template-loader.php’), do_action(‘template_redirect’), WP_Hook->do_action, WP_Hook->apply_filters, WC_AJAX::do_wc_ajax, do_action(‘wc_ajax_checkout’), WP_Hook->do_action, WP_Hook->apply_filters, WC_AJAX::checkout, WC_Checkout->process_checkout, WC_Checkout->process_order_payment, WC_Gateway_Stripe->process_payment, WC_Stripe_Payment_Gateway->process_response, WC_Order->payment_complete, WC_Order->save, WC_Order->status_transition, do_action(‘woocommerce_order_status_changed’), WP_Hook->do_action, WP_Hook->apply_filters, WCMp_Calculate_Commission->wcmp_vendor_new_order_mail, WC_Email_Vendor_New_Order->trigger, WC_Email->get_content, WC_Email_Vendor_New_Order->get_content_plain, wc_get_template_html, wc_get_template, include(‘/themes/astra-child/dc-product-vendor/emails/plain/vendor-new-order.php’), WCMp_Vendor->plain_vendor_order_item_table, get_wcmp_vendor_order_amount, get_wcmp_vendor_orders
I checked the problem and it seems the last
$wpdb->prepare
Copystatement in get_wcmp_vendor_orders function seems to be causing the error.
I tested with another order and that$wpdb->prepare
Copystatement return below query
SELECT * FROM wp1ccf17wcmp_vendor_orders ' WHERE order_id = \'3487\' AND product_id = \'2935\' AND variation_id = \'0\' AND order_item_id = \'1513\' AND is_trashed = \'\''
CopyI am currently using 3.7.5 but I have confirmed with the latest version (3.7.7) that that part of the code is not modified and thus error still occurs.
Can you confirm if you are able to replicate the issue? -
July 27, 2021 at 8:40 PM #125551Raju The Cool GuyKeymaster
Hi,
Maybe you have modified/override the template. We don’t face any such issue on our end from new order mail. Can you please check by the default theme? We will also review our code in our next update ( as an error you shared ). You can track the issue from here https://github.com/wcmarketplace/dc-woocommerce-multi-vendor/issues/922
Thanks -
July 28, 2021 at 1:48 PM #125572purchaseParticipant
Hi Raju,
Thank you for the quick reply.
I did overwrite the template but I only modified L28 of the template.
This part of the modified template that is causing the error is also present in the original template.do_action( 'woocommerce_email_order_meta', $order, $sent_to_admin, $plain_text, null );
CopyBy the way, the error is not displayed on any of the pages.
I just noticed the error when I checked the logs. -
July 28, 2021 at 1:49 PM #125573purchaseParticipant
I’m sorry I posted the wrong code.
Here’s the code in the template that’s causing the error.
$vendor->plain_vendor_order_item_table($order, $vendor->term_id);
Copy -
July 29, 2021 at 8:48 PM #125662MVX Support NinjaKeymaster
Ok.
We will check it in our next update
Thanks -
January 10, 2022 at 2:39 PM #132916MVX Support NinjaKeymaster
We have fixed this in our update.
-
-
AuthorPosts
The topic ‘Database error in vendor new order email sending process’ is closed to new replies.