Orders get duplicated in earnings
Author | Posts |
---|---|
November 27, 2014 at 2:42 am 31265 | |
Jani | I have a serious issue: some orders are counted twice in Dokan earnings, causing sellers to see too higher earnings than what they have actually sold. For example, I have a user who has sold 11 products, each 5 €. Seller Percentage is set to 80%, so seller's balance should be 44 €. But the system shows 60 € as seller's balance! When going in admin panel to Dokan > Earning Reports > All Logs ei get this list with same order id in multiple rows. #8688 Anna (muokkaa) 5,00 € 4,00 € 1,00 € wc-processing #8680 Anna (muokkaa) 5,00 € 4,00 € 1,00 € wc-processing #8680 Anna (muokkaa) 5,00 € 4,00 € 1,00 € wc-processing (8680 is doubled - there are also other duplicates) What could be causing this and how can I fix this? |
November 27, 2014 at 11:33 am 31281 | |
Nayem | Hello Joonas, I tested your issue but for me everything is working fine. I checked the earning reports when a customer purchased couple of or single product from a single seller and with the 80% seller percentage.But i did not find any duplicate earning reports or commission problem. Did you test it any other way?. If yes, then please tell me the testing procedure to reproduce this issue. Thank you 🙂 |
November 27, 2014 at 2:14 pm 31287 | |
Joonas | When I go to database and see the table wp_dokan_orders, I can see same order_id – seller_id combination in multiple rows. So the seller earns from same order multiple times, but I get the money only once. Shouldn’t be a constraint that the same order_id – seller_id combination may exist only once?
|
November 27, 2014 at 2:37 pm 31290 | |
Nayem | Hello Joonas, I have already tested database too. For me its running fine. Can you please update your plugin to the latest version Dokan(v1.3). Please check after updating your plugin and let me know. Thank you 🙂 |
November 27, 2014 at 2:49 pm 31293 | |
Joonas | I’d like to have it confirmed that in database table dokan_orders, by design if there should or shouldn’t be multiple rows that contain the same order_id seller_id combination. Can you check this from the dev team? |
November 27, 2014 at 3:08 pm 31294 | |
Nayem | Hello Joonas, I will discuss about your issue with our developer team. Please allow me some time. I will be back to you with the right solution. Thank you 🙂 |
November 27, 2014 at 3:18 pm 31295 | |
Joonas | Thank you Nayem! |
November 27, 2014 at 4:14 pm 31297 | |
Nayem | Hello Jonas, I have discussed with our developer team. Please check for plugin conflict. Make disable all of your plugins except Dokan. Kindly check and let me know. I am here to help you. Thank you 🙂 |
November 29, 2014 at 8:41 pm 31389 | |
Joonas | I don’t see how this could be plugin conflict, but I disabled other plugins anyway, no help. Could I just get a clear answer (yes or no): is there an error in the database data when there are multiple rows with same order-id, seller-id combination, in the table dokan-orders? |
November 29, 2014 at 8:49 pm 31390 | |
Joonas | Now I deleted all the duplicate rows in database, and now earning reports are correct. The question is, what could be causing these duplicate rows, and do the keep coming up in future? |
November 29, 2014 at 10:38 pm 31393 | |
Joonas | Actually, shouldn’t order_id – seller_id combination be the primary key of dokan_orders? |
November 30, 2014 at 12:48 am 31399 | |
Joonas | In the file /includes/wc-functions.php I see that row 1140 has changed in v1.2, from
to
Can you confirm if this fixes the error? |
November 30, 2014 at 3:12 pm 31425 | |
Nayem | Hello Joonas, You asked for a clear answer(yes or no). Dokan has no error in the database. We tested it many times here but everything working fine. You also mentioned this code Please check and let me know. Thank you 🙂 |
December 8, 2014 at 2:20 am 31974 | |
Joonas | A follow-up on this. I added a unique constraint in my MySQL database for dokan_orders: ALTER TABLE dokan_orders This fixed my problem, since multiple rows with same order_id and seller_id are no longer allowed. I think Dokan should, in it’s own code, either add this kind of constraint to dokan_orders or use seller_id – order_id combination as primary key. |
January 13, 2015 at 11:43 pm 34079 | |
Pablo | Hi, I’m having the same issue! I will try your way joonas… Could you guide me through? thanks |
January 14, 2015 at 1:44 am 34084 | |
Joonas | Ok, You will need to have an access to your database, and then run following SQL-query (how this is exactly done, depends on your database): ALTER TABLE dokan_orders |