getdokan/dokan

Latest Dokan Lite Version Broke WooCommere Analytics

Opened this issue · 8 comments

Bug Description

The latest version of Dokan Lite contained an update to
WooCommerce Analytics. When updating today, I noticed that it broke WooCommerce Analytics. Every number in WooComerce Analytics is now $0. How can this be resolved?

Step To Reproduce

  1. Upgrade to the latest version of Dokan Like (3.12.6)
  2. Access WooCommerce Analytics

Expected Behaviour

I expect that WooCommerce Analytics will show the correct data.

Actual Behaviour

Every number in WooCommerce Analytics shows as $0.

Additional Information

No response

Environment (please complete the following information)

Dokan Version: 3.12.6

All plugins are current and up to date.

Here is the database error.

"PHP message: WordPress database error Table 'tf.wp_dokan_order_stats' doesn't exist for query..."

Here is the database error.

"PHP message: WordPress database error Table 'tf.wp_dokan_order_stats' doesn't exist for query..."

Hi @ashtonlclark,

You might not run the Dokan Migration. You need to run the Dokan migration first as follows,

  1. Admin Panel -> Dokan->Dashboard
  2. Run migration from Dokan Slider notification.

Image

@mrabbani, How can I force the Dokan database update? I tried everything and I am unable to update the Dokan database. The option does not appear for me to update in the Dokan dashboard no matter what I do.

Is there a link I can click on or code I can add/use?

We experienced a similar problem lately. We had to rerun the migration script manually.

Thank you. How did you do that @oliviertassinari?

Hi @oliviertassinari ,

Alternative option:

  1. Deactivate Dokan-lite
  2. Activate Dokan-lite again.

Thanks @mrabbani,

I tried deactivating Dokan-lite and then reactivating it, and I am still unable to update the database. Do you have any other suggestions at this point?

Hello,

After looking into this over the last few weeks, I noticed that two important items have not occurred yet for me even after I received the prompt to update the database:

  1. wp_dokan_order_stats table has not been created in the database. I figured out how to create this table using the following MYSQL Code:
    CREATE TABLE IF NOT EXISTS wp_dokan_order_stats(order_idbigint UNSIGNED NOT NULL,vendor_idbigint UNSIGNED NOT NULL DEFAULT '0',order_typetinyint(1) NOT NULL DEFAULT '0' COMMENT '0 = Dokan Parent Order, 1 = Dokan Single Vendor Order, 2 = Dokan Suborder, 3 = Refund of Dokan Parent Order, 4 = Refund of Dokan Suborder, 5 = Refund of Dokan Single Order',vendor_earningdouble NOT NULL DEFAULT '0',vendor_gateway_feedouble NOT NULL DEFAULT '0',vendor_shipping_feedouble NOT NULL DEFAULT '0',vendor_discountdouble NOT NULL DEFAULT '0',admin_commissiondouble NOT NULL DEFAULT '0',admin_gateway_feedouble NOT NULL DEFAULT '0',admin_shipping_feedouble NOT NULL DEFAULT '0',admin_discountdouble NOT NULL DEFAULT '0',admin_subsidy double NOT NULL DEFAULT '0', PRIMARY KEY (order_id), KEY vendor_id (vendor_id), KEY order_type (order_type) ) ENGINE=InnoDB DEFAULT CHARSE

  2. The historical WooCommerce orders need to be added to the new wp_dokan_order_stats table I was able to create with the MYSQL code above
    a. How can I do this? Is there code or a MYSQL query that I can run to populate the historical orders in the new table?
    b. I know that most of this code (I believe) is in 'includes/Analytics/Reports/Orders/Stats/DataStore.php' - How can I use the code in this file to add the historical orders into the new database table?
    c. What code can I run to bring the historical orders into this new table?

This is what I need help with.