Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thank you very much for the reply.

    Unfortunately, the fix you are suggestiong is only possible in the pro version, which we don’t have.

    Looks like I have to live with my “fix”: deaktivating the pre-order function – for a short time – to run a report.

    Hi,

    just to clarify  we don’t have a blank screen. The reports load normally, but no sales data are shown.

    Environment:

    WordPress 6.8.3
    WooCommerce 10.3.3
    Ninjalytics Free (formerly Product Sales Report) 2.0.3
    WooCommerce Pre-Orders 2.3.1

    When Pre-Orders is active, Ninjalytics shows no results. As soon as we disable Pre-Orders, all reports work normally again with the same filters.

    We analyzed the SQL query used by Ninjalytics and found the following structure:

    SELECT 
      GROUP_CONCAT(DISTINCT order_items.order_item_name) AS field0,
      SUM(order_item_meta__line_subtotal.meta_value) AS field1,
      SUM(order_item_meta__line_total.meta_value) AS field2,
      SUM(order_item_meta__line_tax.meta_value) AS field3,
      order_item_meta__product_id.meta_value AS field4,
      SUM(order_item_meta__qty.meta_value) AS field5
    FROM wp_posts AS posts
    LEFT JOIN wp_woocommerce_order_items AS order_items
      ON (posts.id = order_items.order_id)
      AND (order_items.order_item_type = 'line_item')
    LEFT JOIN wp_woocommerce_order_itemmeta AS order_item_meta__line_subtotal
      ON (order_items.order_item_id = order_item_meta__line_subtotal.order_item_id)
      AND (order_item_meta__line_subtotal.meta_key = '_line_subtotal')
    LEFT JOIN wp_woocommerce_order_itemmeta AS order_item_meta__line_total
      ON (order_items.order_item_id = order_item_meta__line_total.order_item_id)
      AND (order_item_meta__line_total.meta_key = '_line_total')
    LEFT JOIN wp_woocommerce_order_itemmeta AS order_item_meta__line_tax
      ON (order_items.order_item_id = order_item_meta__line_tax.order_item_id)
      AND (order_item_meta__line_tax.meta_key = '_line_tax')
    LEFT JOIN wp_woocommerce_order_itemmeta AS order_item_meta__product_id
      ON (order_items.order_item_id = order_item_meta__product_id.order_item_id)
      AND (order_item_meta__product_id.meta_key = '_product_id')
    LEFT JOIN wp_woocommerce_order_itemmeta AS order_item_meta__qty
      ON (order_items.order_item_id = order_item_meta__qty.order_item_id)
      AND (order_item_meta__qty.meta_key = '_qty')
    WHERE
      posts.post_type IN ('shop_order')
      AND posts.post_status IN ('wc-pre-ordered')
      AND posts.post_date_gmt >= '2014-12-31 23:00:00'
      AND posts.post_date_gmt <= '2025-12-31 22:59:59'
      AND posts.post_status IN ('wc-processing','wc-on-hold','wc-completed')
    GROUP BY field4;

    As you can see, there are two conflicting post_status conditions. The query requires orders to be both 'wc-pre-ordered' and 'wc-processing'/'wc-completed' etc. at the same time, which is logically impossible — this always returns an empty result set.

    This behavior only occurs when the WooCommerce Pre-Orders plugin is active. Once it’s deactivated, the same report runs correctly.

    There are no errors in the browser console or in debug.log.

    Thanks for looking into this — it seems to be a direct conflict between Ninjalytics and Pre-Orders.

    Hi there,

    I have the same issue.

    A few days ago we’ve updated WooCommerce (Version 10.3.3) and WooCommerce Pre-Orders (Version 2.3.1). Unfortuately the Product Sales Report (now Ninjalytics) doesn’t work anymore. Deactivating WooCommerce Pre-Orders does the trick, but unfortunately I need it.

    I’ve already contacted the WooCommerce Support (I guess a KI) and they suggested to get in contact with you.

    Thanks!

    Becasue this is kind of a dead forum…

    I think this should work if you go to MyBookTable – Settings

    Thread Starter dahuyl

    (@dahuyl)

    Hi Lorro

    YOU ARE GOLD!

    I’ve tested it on the test server/installation and it works!

    Thank you so much!

    Thread Starter dahuyl

    (@dahuyl)

    Thank you!
    IIt’s still not working. Probably becasue the State Code on our checkout page is missing.
    It shows only Country, Address, Postcode/ZIP, Town/City, and Province.
    How can I add it?

Viewing 6 replies - 1 through 6 (of 6 total)