WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce - excelling eCommerce
[resolved] How to purge old orders? (2 posts)

  1. benny Vasquez
    Member
    Posted 1 year ago #

    I'm using the following code to pull the total number of products in a given category sold:

    get_post_meta($product_id='17', 'total_sales', true );

    The problem is that the number is not accurate, as it includes orders that I moved to the trash, and then permanently deleted, in the woocommerce admin interface. Is there a way to completely purge those orders from the database, through the interface? If not, can you guys help me with the syntax to clear out the appropriate data from the appropriate tables? I looked through the tables a bit and think I know what needs to go, but would rather have an assist.

    http://wordpress.org/extend/plugins/woocommerce/

  2. benny Vasquez
    Member
    Posted 1 year ago #

    I was able to figure this one out on my own. I mistakenly was thinking that it was counting a total number of sales. Zeroing out the total_sales column in the postmeta for the appropriate product corrected the problem.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic