WooCommerce Customer Profile Discrepancy: Unraveling 'Purchased Products' Count Mismatches

As a WooCommerce migration expert and community analyst, I frequently encounter scenarios where store owners grapple with discrepancies in their e-commerce data. A recent support forum topic, titled "WooCommerce Customer Profile Shows Incorrect Number of Purchased Products," perfectly illustrates a common point of confusion. The user reported a significant mismatch: a customer had purchased approximately 150 product units across multiple orders, yet their WooCommerce customer profile displayed only 26 purchased products. This issue, while seemingly straightforward, touches upon critical aspects of WooCommerce's data handling, order processing, and how metrics are calculated.

Understanding the 'Purchased Products' Discrepancy

The core of the reported issue lies in the interpretation of "purchased products." The user observed "150 product units" versus "26 purchased products." This immediately suggests a fundamental difference in what WooCommerce's customer profile is tracking. In most standard WooCommerce configurations, the "purchased products" count in a customer's profile or analytics typically refers to the number of unique product IDs or distinct product SKUs that a customer has bought, rather than the cumulative total quantity of all items across all orders.

For instance, if a customer buys 10 units of "Product A" and 5 units of "Product B" over several orders, the "purchased products" count would likely be 2 (for Product A and Product B), not 15 (10+5 units). The forum user's scenario of 150 units and 26 products strongly aligns with this interpretation: the customer likely made repeat purchases of a limited set of 26 unique items, accumulating 150 total units.

Key Factors Influencing the Count

Beyond the unique vs. quantity distinction, several other factors can contribute to perceived discrepancies:

  • Order Statuses: WooCommerce typically only includes products from orders with specific statuses in its counts. Most commonly, only "Completed" orders contribute to a customer's purchase history. Orders that are "Pending Payment," "On Hold," "Cancelled," or "Refunded" are generally excluded. If many of the customer's 150 units originated from non-completed orders, they would not be counted.
  • Product Variations: How product variations are handled can also play a role. Depending on the theme, plugins, or custom code, a variation might be counted as a unique product or aggregated under its parent product. Generally, distinct variations (with their own product IDs) are counted as unique products.
  • High-Performance Order Storage (HPOS): The user's mention of HPOS is pertinent. While HPOS primarily optimizes database performance and scalability for order management, any significant change to the underlying data storage mechanism can introduce data synchronization challenges, especially during or after a migration to HPOS. If data wasn't fully migrated or synchronized correctly, it could lead to inconsistencies in aggregated counts.
  • Caching Issues: Server-level, WordPress object, or browser caching can sometimes display outdated information, leading to temporary discrepancies.
  • Third-Party Plugins: Customizations or plugins that modify WooCommerce's order processing, customer profile, or analytics features could alter how these counts are generated or displayed.

Actionable Troubleshooting Steps for Store Owners and Developers

To accurately diagnose and resolve such discrepancies, a systematic approach is essential:

  1. Step 1: Clarify WooCommerce's Definition of 'Purchased Products':
    • The most critical step is to manually review the customer's orders. Go to WooCommerce > Orders, filter by the specific customer.
    • For each order with a "Completed" status, list every unique product ID purchased. Do not count quantities initially.
    • Sum the number of unique product IDs across all completed orders. Compare this manual count with the 26 displayed in the customer profile. This will likely confirm if WooCommerce is counting unique products rather than total units.
  2. Step 2: Verify Order Statuses:
    • Ensure all orders contributing to the 150 units are indeed marked as "Completed." If orders are in other statuses, they would typically not be included in the "purchased products" count. Adjust statuses if necessary, but be cautious with production data.
  3. Step 3: Clear All Caches:
    • Clear your WooCommerce transients (WooCommerce > Status > Tools > WooCommerce transients > Clear transients).
    • Clear any caching plugins (e.g., WP Rocket, LiteSpeed Cache).
    • Clear server-level caches (if applicable, via your hosting provider).
    • Clear your browser cache.
  4. Step 4: Conduct a Plugin Conflict Test:
    • Deactivate all plugins except WooCommerce. Check the customer profile count. If the issue resolves, reactivate plugins one by one to identify the culprit. This should ideally be done on a staging environment.
  5. Step 5: Examine HPOS Status and Synchronization:
    • If HPOS is enabled, go to WooCommerce > Settings > Advanced > Features. Ensure HPOS is active and that there are no pending synchronization tasks or errors reported. If you recently enabled HPOS, ensure all old orders have been successfully migrated to the new tables.
  6. Step 6: Database Review (Advanced - for Developers):
    • For a deeper dive, inspect the database. The customer lookup data is often stored in tables like wp_wc_customer_lookup and potentially in user meta data. A direct SQL query could reveal what data WooCommerce is actually storing for the customer:
    • SELECT DISTINCT order_item_meta.meta_value
      FROM wp_woocommerce_order_items AS order_items
      LEFT JOIN wp_woocommerce_order_itemmeta AS order_item_meta ON order_items.order_item_id = order_item_meta.order_item_id
      LEFT JOIN wp_posts AS posts ON order_items.order_id = posts.ID
      WHERE posts.post_type = 'shop_order'
      AND posts.post_status = 'wc-completed'
      AND order_item_meta.meta_key = '_product_id'
      AND posts.post_author = [CUSTOMER_USER_ID];

      (Replace [CUSTOMER_USER_ID] with the actual user ID of the customer and adjust table prefixes if different). This query counts unique product IDs from completed orders for a specific user.

Conclusion

The discrepancy between "product units" and "purchased products" in WooCommerce is a classic example of how different metrics can be interpreted. In most cases, the customer profile's "purchased products" count accurately reflects the number of unique products a customer has bought from completed orders. By systematically troubleshooting, verifying order statuses, clearing caches, and potentially investigating third-party plugin conflicts or HPOS synchronization, store owners and developers can quickly identify the root cause. Understanding WooCommerce's default calculation logic is key to avoiding such confusions and maintaining accurate customer insights.

Start with the tools

Explore migration tools

See options, compare methods, and pick the path that fits your store.

Explore migration tools