• Resolved melebius

    (@melebius)


    I am going to upload an e-shop I’ve been developing locally to the production site. I deleted orders made during tests and set the total sales of all products using this SQL query:

    
    UPDATE wp_postmeta SET meta_value = '0'
    WHERE meta_key = 'total_sales' AND meta_value > '0';
    

    However, the “sort by popularity” on the main shop page keeps listing the items according to my testing orders.

    How can I reset the popularity sort, like when no orders were ever made? Is there anything similar to the command wp term recount, for example?

    
    ### WordPress Environment ###
    
    WordPress address (URL): https://localhost/at/woocomerce
    Site address (URL): https://localhost/at/woocomerce
    WC Version: 5.7.1
    REST API Version: ? 5.7.1
    WC Blocks Version: ? 5.7.2
    Action Scheduler Version: ? 3.2.1
    WC Admin Version: ? 2.6.5
    Log Directory Writable: ?
    WP Version: 5.8.1
    WP Multisite: –
    WP Memory Limit: 1 GB
    WP Debug Mode: –
    WP Cron: ?
    Language: en_US
    External object cache: –
    
    ### Server Environment ###
    
    Server Info: Apache/2.4.48 (Unix) PHP/7.4.20
    PHP Version: 7.4.20
    PHP Post Max Size: 8 MB
    PHP Time Limit: 30
    PHP Max Input Vars: 1000
    cURL Version: 7.77.0
    (SecureTransport) OpenSSL/1.1.1k
    
    SUHOSIN Installed: –
    MySQL Version: 8.0.25
    Max Upload Size: 8 MB
    Default Timezone is UTC: ?
    fsockopen/cURL: ?
    SoapClient: ?
    DOMDocument: ?
    GZip: ?
    Multibyte String: ?
    Remote Post: ?
    Remote Get: ?
    
    ### Database ###
    
    WC Database Version: 5.8.0
    WC Database Prefix: wp_
    Total Database Size: 59.94MB
    Database Data Size: 35.85MB
    Database Index Size: 24.09MB
    wp_woocommerce_sessions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_woocommerce_api_keys: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_woocommerce_attribute_taxonomies: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_woocommerce_downloadable_product_permissions: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
    wp_woocommerce_order_items: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_woocommerce_order_itemmeta: Data: 0.05MB + Index: 0.03MB + Engine InnoDB
    wp_woocommerce_tax_rates: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
    wp_woocommerce_tax_rate_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_woocommerce_shipping_zones: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_woocommerce_shipping_zone_locations: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_woocommerce_shipping_zone_methods: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_woocommerce_payment_tokens: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_woocommerce_payment_tokenmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_woocommerce_log: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_actionscheduler_actions: Data: 1.52MB + Index: 1.38MB + Engine InnoDB
    wp_actionscheduler_claims: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_actionscheduler_groups: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_actionscheduler_logs: Data: 1.52MB + Index: 0.69MB + Engine InnoDB
    wp_berocket_termmeta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_braapf_product_stock_status_parent: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_braapf_product_variation_attributes: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
    wp_braapf_term_taxonomy_hierarchical: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
    wp_braapf_variation_attributes: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_ce4wp_abandoned_checkout: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_cmplz_cookiebanners: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_cmplz_cookies: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_cmplz_services: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_commentmeta: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_comments: Data: 0.02MB + Index: 0.09MB + Engine InnoDB
    wp_duplicator_packages: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_links: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_mailchimp_carts: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_mailchimp_jobs: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_options: Data: 4.44MB + Index: 0.47MB + Engine InnoDB
    wp_postmeta: Data: 12.36MB + Index: 11.02MB + Engine InnoDB
    wp_posts: Data: 6.42MB + Index: 2.33MB + Engine InnoDB
    wp_term_relationships: Data: 1.52MB + Index: 1.38MB + Engine InnoDB
    wp_term_taxonomy: Data: 0.14MB + Index: 0.11MB + Engine InnoDB
    wp_termmeta: Data: 0.08MB + Index: 0.09MB + Engine InnoDB
    wp_terms: Data: 0.09MB + Index: 0.09MB + Engine InnoDB
    wp_usermeta: Data: 0.03MB + Index: 0.03MB + Engine InnoDB
    wp_users: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
    wp_wc_admin_note_actions: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_wc_admin_notes: Data: 0.06MB + Index: 0.00MB + Engine InnoDB
    wp_wc_category_lookup: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_wc_customer_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_wc_download_log: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_wc_order_coupon_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_wc_order_product_lookup: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
    wp_wc_order_stats: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
    wp_wc_order_tax_lookup: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_wc_product_meta_lookup: Data: 1.52MB + Index: 1.27MB + Engine InnoDB
    wp_wc_reserved_stock: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_wc_tax_rate_classes: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_wc_webhooks: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_wcpdf_invoice_number: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_wdp_order_items: Data: 0.02MB + Index: 0.06MB + Engine InnoDB
    wp_wdp_orders: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
    wp_wdp_rules: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_wdr_order_discounts: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_wdr_order_item_discounts: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_wdr_rules: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_woobe_history: Data: 0.02MB + Index: 0.05MB + Engine InnoDB
    wp_woobe_history_bulk: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_woof_query_cache: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_wpmailsmtp_tasks_meta: Data: 0.02MB + Index: 0.00MB + Engine InnoDB
    wp_yoast_indexable: Data: 3.50MB + Index: 2.77MB + Engine InnoDB
    wp_yoast_indexable_hierarchy: Data: 1.48MB + Index: 1.06MB + Engine InnoDB
    wp_yoast_migrations: Data: 0.02MB + Index: 0.02MB + Engine InnoDB
    wp_yoast_primary_term: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    wp_yoast_seo_links: Data: 0.02MB + Index: 0.03MB + Engine InnoDB
    
    ### Post Type Counts ###
    
    attachment: 51
    br_filters_group: 1
    br_product_filter: 6
    customize_changeset: 4
    nav_menu_item: 16
    page: 11
    payment_condition: 1
    post: 1
    postman_sent_mail: 80
    product: 1255
    product_variation: 6489
    revision: 121
    
    ### Security ###
    
    Secure connection (HTTPS): ?
    					Your store is not using HTTPS. Learn more about HTTPS and SSL Certificates.
    Hide errors from visitors: ?
    
    ### Active Plugins (19) ###
    
    Advanced Dynamic Pricing for WooCommerce: by AlgolPlus – 3.2.6
    Akismet Anti-Spam: by Automattic – 4.1.12
    Bulk remove posts from category: by MasterNs – 3.2
    Complianz | GDPR/CCPA Cookie Consent: by Really Simple Plugins – 5.4.0
    Custom Order Numbers for WooCommerce: by Tyche Softwares – 1.3.3
    Customizer Export/Import: by The Beaver Builder Team – 0.9.2
    Duplicator: by Snap Creek – 1.4.3
    ELEX WooCommerce Bulk Edit Products, Prices & Attributes (Basic): by ELEXtensions – 1.1.9
    WooCommerce Force Default Variant: by HappyKite – 1.5.2
    OMGF: by Daan from FFW.Press – 4.5.6
    Permalink Manager Lite: by Maciej Bis – 2.2.13.1
    Post SMTP: by Yehuda Hassine – 2.0.23
    SVG Support: by Benbodhi – 2.3.19
    Themify - WooCommerce Product Filter: by Themify – 1.3.5
    WooCommerce Smart COD: by woosmartcod.com – 1.6.1
    WC Variations Radio Buttons: by 8manos – 2.0.5
    WooCommerce PDF Invoices & Packing Slips: by Ewout Fernhout – 2.9.3
    WooCommerce: by Automattic – 5.7.1
    Yoast SEO: by Team Yoast – 17.2
    
    ### Inactive Plugins (12) ###
    
    Acowebs Woocommerce Dynamic Pricing: by Acowebs – 4.0.5
    Advanced AJAX Product Filters for WooCommerce: by BeRocket – 1.5.5.4
    BEAR - Bulk Editor and Products Manager: by realmag777 – 1.0.8.1
    Child Theme Copy Settings: by Long Nguyen – 1.0.0
    Free Downloads WooCommerce: by Square One Media – 3.3.1
    Grid/List View for WooCommerce: by BeRocket – 1.1.3.1
    Related Products for WooCommerce: by WebToffee – 1.3.9
    Related Products for WooCommerce: by PeachPay – 3.3.10
    What The File: by Never5 – 1.5.4
    WooCommerce: by Automattic – 5.8.0-dev
    Woo Discount Rules: by Flycart – 2.3.8
    WOOF - WooCommerce Products Filter: by realmag777 – 1.2.5.6
    
    ### Settings ###
    
    API Enabled: –
    Force SSL: –
    Currency: CZK (K?)
    Currency Position: right_space
    Thousand Separator: 
    Decimal Separator: ,
    Number of Decimals: 2
    Taxonomies: Product Types: external (external)
    grouped (grouped)
    simple (simple)
    variable (variable)
    
    Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
    exclude-from-search (exclude-from-search)
    featured (featured)
    outofstock (outofstock)
    rated-1 (rated-1)
    rated-2 (rated-2)
    rated-3 (rated-3)
    rated-4 (rated-4)
    rated-5 (rated-5)
    
    Connected to WooCommerce.com: –
    
    ### WC Pages ###
    
    Shop base: #6 - /
    Cart: #7 - /kosik/
    Checkout: #8 - /pokladna/
    My account: #9 - /muj-ucet/
    Terms and conditions: #480 - /obchodni-podminky/
    
    ### Theme ###
    
    Name: NanoSpace AT-Obchod
    Version: 1.0.0
    Author URL: 
    Child Theme: ?
    Parent Theme Name: NanoSpace
    Parent Theme Version: 1.2.1
    Parent Theme Author URL: https://labinator.com/
    WooCommerce Support: ?
    
    ### Templates ###
    
    Overrides: nanospace-at-obchod/woocommerce/content-widget-product.php
    nanospace-at-obchod/woocommerce/single-product/product-attributes.php
    
    ### Action Scheduler ###
    
    Complete: 5,122
    Oldest: 2021-09-01 14:20:46 +0200
    Newest: 2021-09-24 13:52:48 +0200
    
    ### Status report information ###
    
    Generated at: 2021-09-24 14:35:11 +02:00
    
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor royho

    (@royho)

    Hi @melebius – there is also the wc_product_meta_lookup table where total_sales lives. Try looking through that.

    Thread Starter melebius

    (@melebius)

    Dear @royho, thank you for the hint!

    This SQL query helped me:

    
    UPDATE wp_wc_product_meta_lookup SET
    total_sales = '0'
    WHERE total_sales > '0';
    
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Reset popularity sort’ is closed to new replies.