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
total_sales meta key alway incrementing #10725
Comments
Not a bug, see #5928 |
Hi claudiosmweb, I fail to see how it's working as intended though? It is called 'total_sales' which implicates the total number of times the product has sold - if it's not doing that then it would make sense to call it otherwise. I am using a marketplace plugin which uses 'total_sales' to report how many times a product has sold. But this data is incorrect because it doesn't take into account refunded/cancelled/trashed orders. All the thread you posted to says is that it is a lot of effort for not so much gain, but it does not stop it from being a bug. Many Thanks, |
You can create a new field to track it if you really need. |
Hi again, Thanks for your response. I am not using it to track it. The marketplace plugin 'WC Vendors' uses this field to display the total sales of a product. Very misleading now considering it doesn't take into account order statuses. Very odd how this isn't considered a bug though? Many thanks, |
Just read this #5928 |
Hi Claudio, I have read it. The thread mentions it is too much effort for little gain. However, this is only relevant when used for best selling widget. The problem arises when a plugin starts utilising the field to report total product sales which is the case for the marketplace plugin I am using. I will speak with them to determine if there is any benefit to using the total_sales field as it is completely inaccurate. Many Thanks, |
Still not needed on WooCommerce core. As I said, if you need, you can create a plugin for it. |
Just fyi, I wrote a function to deal with this. |
Hello,
Wordpress v4.4.2 / WooCommerce v2.5.5/ StoreFront theme
I think I have found a bug. I have confirmed this with another plugin developer who has been able to replicate this issue. The meta key 'total_sales' increments when an order is placed. Subsequently, when a order status is changed to 'Refunded', 'Cancelled' or Trashed, it should deduct the 'total_sales', but this does not happen.
Instead, it remains on the same number and continues to be incremented for every new sale. This essentially defeats the purpose of the 'total_sales' meta key as the data would be largely incorrect if 'total_sales' does not get negated when an order is refunded/cancelled/trashed.
Please confirm if you can replicate? All you need to do is refund/cancel/trash an order and see if 'total_sales' gets deducted or not.
Many Thanks,
Jawad
The text was updated successfully, but these errors were encountered: