Banner Logo

Be a part of the family: Connect, Receive Support,
Contribute, and Reap Abundant Rewards!

Database error in vendor new order email sending process

WCMp Core

Resolved
Viewing 5 reply threads
  • Author
    Posts
    • #125498
      purchase
      Participant

      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
      Copy

      statement in get_wcmp_vendor_orders function seems to be causing the error.
      I tested with another order and that

      $wpdb->prepare
      Copy

      statement 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 = \'\''
      Copy

      I 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?

    • #125551

      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

    • #125572
      purchase
      Participant

      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 );
      Copy

      By the way, the error is not displayed on any of the pages.
      I just noticed the error when I checked the logs.

    • #125573
      purchase
      Participant

      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
    • #125662

      Ok.
      We will check it in our next update
      Thanks

    • #132916

      We have fixed this in our update.

Viewing 5 reply threads

The topic ‘Database error in vendor new order email sending process’ is closed to new replies.