-
Notifications
You must be signed in to change notification settings - Fork 206
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Bug fix for "Withdrawal current balance is incorrect" #882
Conversation
Please merge |
Please merge, because we need to fix this bug immediately |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is working fine.
@ceefour Did you check Reports? It's not working properly. When caching enables our current implementation for Withdrew current balance is wrong & reports is fine. but this PR cause wrong Reports. Please look into this scenario. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Its not working properly. produce wrong Report.
@zamandevs Thank you for confirming that "When caching enabled our current implementation for Withdraw current balance is wrong & reports is fine" Note that I am not a weDevs developer, I am developer with an active Dokan Professional 3 Sites license. However, previously weDevs have refused to acknowledge this problem since more than a month ago, and blamed the caching plugin. That's why I attempted, with very limited knowledge of Dokan plugin internals, to make my own fix and contribute the solution back. Can you confirm that weDevs will provide a proper fix to this problem and can you give a time estimate ? |
@ceefour Thanks for your contribution. hopefully, we will fix this on the next release. |
includes/Withdraw/Hooks.php
Outdated
$cache_group = 'dokan_seller_data_' . $user_id; | ||
$cache_key = 'dokan_seller_balance_' . $user_id; | ||
wp_cache_delete( $cache_key, $cache_group ); | ||
dokan_cache_update_group( $cache_key , $cache_group ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ceefour we don't need this line 35. If you remove this line, we can merge this PR.
includes/Withdraw/Hooks.php
Outdated
@@ -28,7 +28,11 @@ public function __construct() { | |||
* @return void | |||
*/ | |||
public static function delete_seller_balance_cache( $status, $user_id, $id ) { | |||
wp_cache_delete( 'dokan_seller_balance_' . $user_id ); | |||
// Fix Dokan Pro ticket #338760: Current balance after withdrawal incorrect |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the comment!
c81d14c
to
ae3c28c
Compare
@tareq1988 @kapilpaul I've removed the requested lines. Please re-review for merge. |
Reference: Dokan Pro support ticket #338760.
This PR fixes the bug that occurs because Dokan did not use proper cache behavior :