It’s a discussed idea about optimization dokan to do some stuffs like below
- Put datas for seller dashboard to a
seller_summarytable - Put datas for admin dashboard to
admin_summarytable - Make a system to Queue list of changes column. As for example –
- Assume, when someone purchase a product, the
seller_summarytable’sbalancehas been changed. So, we put thebalancein queue like - Again, change
pageviewcolumn, add it too inqueue. So, after some workaround, queue will look like this- balance
- pageview
- So action_scheduler than process these queue and update the summary table.
- Assume, when someone purchase a product, the
- Another idea was, just put a expired_at column in summary table or something another table like that. Then works like transiend.
Here’s the tables as far discussion, but not implemented yet.
Sellers dashboard data
Table: dokan_vendor_summary
| Table Name | Column Name | Key | Example |
|---|---|---|---|
dokan_vendor_summary | id | primary | 1 |
vendor_id | unique | 2 | |
sales_amount | 100 | ||
sales_earning | 92 | ||
pageview_count | 10 | ||
order_counts | [‘total’ => 5, ‘completed’ => 1, ‘pending’ => 1, ‘processing’ => 1, ‘cancelled’ => 1, ‘refunded’ => 1, ‘on_hold’ => 0 ] | ||
review_counts | [‘total’ => 3, ‘pending’ => 1, ‘spam’ => 1, ‘trash’ => 1 ] | ||
product_counts | [‘total’ => 3, ‘live’ => 1, ‘offline’ => 1, ‘pending_review’ => 1 ] | ||
balance | 1000 | ||
expired_at | ‘1970-01-01 00:00:01’ | ||
updated_at | ‘1970-01-01 00:00:01’ |
Admin Dashboard Data
Table: dokan_summary or if in transient and wp_options
| Table Name | Column Name | Key | Example |
|---|---|---|---|
dokan_summary | id | primary | 1 |
products | [‘this_month’ => 1, ‘last_month’ => 3, ‘this_period’ => 0, ‘class’ => ”, ‘parcent’ => 80] | ||
withdraw | [‘pending’ => 0, ‘completed’ => 0, ‘cancelled’ => 0 ] | ||
vendors | [‘inactive’ => 10, ‘active’ => 10, ‘this_month’ => 6, ‘last_month’ => 10, ‘this_period’ => ”, class’ => ”, ‘parcent’ => 80] | ||
sales | [‘this_month’ => 1, ‘last_month’ => 3, ‘this_period’ => 0, ‘class’ => ”, ‘parcent’ => 80] | ||
orders | [‘this_month’ => 1, ‘last_month’ => 3, ‘this_period’ => 0, ‘class’ => ”, ‘parcent’ => 80] | ||
earnings | [‘this_month’ => 1, ‘last_month’ => 3, ‘this_period’ => 0, ‘class’ => ”, ‘parcent’ => 80] |
If we want to show pending counts of –
- Pending withdraws
- Pending vendors
- Pending refunds
- Pending verifications
Then, we can store this also in the above table or in transient.