Purchase Activity
(BU) Purchase Activity displays recent WooCommerce sales for a product or variation, such as 100+ bought in the past 30 days or 23 orders placed this month. Counts come from real eligible order items, not a random number or manually supplied storefront count.
Place it near a product title, rating, price, or purchase form. It works with current-product context, repeated product cards, explicit product/variation IDs, and matching variation forms inside Quick View. Low or unavailable counts stay hidden.
Quick Start
- Activate WooCommerce, Bricks, and the BricksUltimate build containing Purchase Activity. Enable the element under Woo Elements.
- Open your single-product template in Bricks and add (BU) Purchase Activity near the product information.
- Leave Product / variation ID empty to use the product supplied by the template.
- Keep Past 30 days, Units sold, and Rounded milestone (100+) for an Amazon-style recent-purchase message.
- Set Minimum sales to the lowest actual count you want to display. The default is 10; set 100 if you only want to show products with at least 100 qualifying units/orders.
- Choose combined or selected-variation behavior, edit the messages, and optionally choose an icon.
- Style the element under Content, save, and test a published product with known recent sales on the storefront.
The builder displays sample data for design work. Seeing a message in the editor does not prove the frontend product has enough eligible sales.
Sales Activity Controls
| Control | Purpose and default |
|---|---|
| Product / variation ID | Optional fixed or dynamic numeric ID. Empty uses the current product/query-loop item. An explicit variation ID always counts that variation, regardless of the parent-combination setting. Use an ID, not a SKU. |
| Period | Past 7 days, Past 30 days, Past 90 days, or Current calendar month. Default: Past 30 days. Eligibility uses order creation time, not the date the order reached Completed. |
| Count basis | Units sold or Distinct orders. Default: Units sold. These are not unique-customer counts. |
| Count format | Rounded milestone (100+) or Exact count. Default: Rounded milestone. Rounded values never exceed the underlying count. |
| Minimum sales | Positive actual-count threshold, default 10. The same control refers to units or orders according to Count basis. Zero counts are always hidden; this is not a way to display invented sales. |
| Variable products | Combine all variations or Selected variation only. Default: Combine all variations. Selected mode requires a matching WooCommerce variation form. |
| Data source | Read-only information about statuses, refunds, free products, caching, and the builder preview. There is no order-status picker in the element. |
Periods, Dates, and Timezones
Past 7, 30, and 90 days are rolling windows ending at calculation time. The rolling duration is measured in UTC, including across daylight-saving changes. Current calendar month starts at midnight on the first day of this month in the WordPress timezone and ends at calculation time; it does not mean the previous complete calendar month.
For example, on November 23, Current calendar month starts November 1. Past 30 days reaches back into October. Check Settings > General > Timezone if a month boundary differs from your expectations.
The date tested is the original order's creation date. An order created outside the window does not become a recent sale merely because its status changed to Completed today. Future-dated orders are not included.
Counts are cached, so a rolling window is a recent snapshot rather than a continuously updated timer. Reloading a page is not guaranteed to bypass its aggregate or full-page caches.
Units Sold Versus Distinct Orders
| Eligible sales example | Units sold | Distinct orders |
|---|---|---|
| One order contains five units of this product. | 5 | 1 |
| One order contains two separate lines for this product: quantities 2 and 3. | 5 | 1, not 2 |
| Three orders contain quantities 2, 3, and 4. | 9 | 3 |
| One order contains two Small and three Large units of one variable parent, using combined mode. | 5 | 1, not one per variation |
Order mode counts an eligible order once if it still contains a positive net quantity for the selected product or scope. Other products in that order do not increase this product's order count. One customer making several orders can contribute several orders; do not label the result as unique buyers or people viewing this product.
For stores that allow fractional quantities, net unit quantities are conservatively rounded down to a whole number for the displayed count. For example, a net total of 1.6 units becomes 1. Distinct-order counting still follows positive remaining item quantities.
Eligible Orders and Refunds
The engine uses WooCommerce's paid-status list, which is Processing and Completed by default. Supported custom paid statuses supplied through WooCommerce's paid-status mechanism can be considered. Pending, On hold, Failed, Cancelled, Refunded, trashed, and checkout-draft orders are excluded.
Only normal product line items belonging to standard WooCommerce orders are counted. Fees and shipping lines do not contribute units. Zero-price products and free ordered units in otherwise eligible orders are included; there is no element control to exclude them or promotion-gift lines.
| Refund situation | Effect on activity |
|---|---|
| Five ordered units; two units refunded against that item. | 3 net units. The order still counts once if it remains eligible. |
| Every unit of this product is refunded, but the order remains Completed because it contains other products. | 0 net units for this product. That order no longer contributes to this product's distinct-order count. |
| The entire order now has Refunded status. | The original order is excluded. |
| A partial monetary refund has no returned item quantity. | No quantity can be inferred. It does not reduce unit counts automatically. |
| A recent eligible order has an itemized refund created after the order's sales date. | The linked refunded quantity is deducted. Refunds are not restricted to the original sales-window dates. |
| A linked refund is deleted or trashed. | It no longer reduces that item's net quantity after invalidation/recalculation. |
Returned quantities are clamped so an item cannot contribute a negative count. Refunds must belong to the original order and reference its original item. Changing stock quantity alone does not constitute a sale or refund.
Purchase Activity reads the authoritative order store for either HPOS or legacy post-based orders. It does not depend on WooCommerce Analytics imports or the lifetime total_sales product field.
Exact Counts, Milestones, and Minimum Visibility
Exact mode formats the whole count using the site's number formatting. Milestone mode selects a conservative lower threshold and appends +. The built-in progression includes 1, 5, 10, 25, 50, 100, 250, 500, 1,000, 2,500, and 5,000, with larger 1/2.5/5 magnitude steps thereafter.
| Actual count | Exact | Rounded milestone |
|---|---|---|
| 4 | 4 | 1+ |
| 24 | 24 | 10+ |
| 137 | 137 | 100+ |
| 249 | 249 | 100+ |
| 250 | 250 | 250+ |
| 999 | 999 | 500+ |
| 1,370 | 1,370 | 1,000+ |
The minimum tests the actual count, not the milestone. With Minimum sales set to 120, an actual count of 137 qualifies even though the visible rounded text is 100+. An actual count of 119 stays hidden. Use Exact count if you do not want a lower-bound presentation.
Zero sales, an invalid/unpublished product, or an unavailable calculation do not produce fake fallback counts. The storefront hides the element. An external wrapper with its own padding may still occupy space; avoid styling a decorative parent as though the message is always present.
Messages, Tokens, and Singular Forms
| Control | Use |
|---|---|
| Unit message (singular) / Unit message (plural) | Available for Units sold. Both default to {count} bought {period}. You can distinguish one item from multiple items in your own language. |
| Order message (singular) | Available for Distinct orders. Default: {count} order placed {period}. |
| Order message (plural) | Available for Distinct orders. Default: {count} orders placed {period}. |
| Custom period text | Optional text replacing the period token. Empty uses the selected period's normal label. It does not change the date calculation. |
{count} becomes the exact or milestone-formatted number, with a separate styleable count span. {period} becomes in the past 7 days, in the past 30 days, in the past 90 days, or this month. Message fields accept plain text; HTML is escaped rather than rendered.
Singular/plural selection uses the underlying count: exactly 1 uses singular; larger counts use plural. A rounded 1+ can therefore use plural text when the actual count is larger than one. Keep milestone wording natural, or use Exact count for precise singular labels.
Message Examples
{count} bought {period}with 137 units and Past 30 days: 100+ bought in the past 30 days.Popular choice: {count} sold {period}with 74 units and Past 7 days: Popular choice: 50+ sold in the past 7 days.- Exact order mode with
{count} orders placed {period}: 23 orders placed this month. - For the wording 100+ bought in the past month, choose Past 30 days and set Custom period text to
in the past month.
Keep your wording truthful. Do not use today for a 30-day calculation or describe order counts as unique customers. Changing message text never changes the underlying period or count basis.
Variable Products and Individual Variations
Combine All Variations
This default uses the variable parent's product ID and combines its eligible variation lines. The count does not switch when a shopper chooses a size or color. It is suitable for general product popularity on a product page or archive card without a variation picker.
For example, 40 Small units and 60 Large units produce 100 combined units. In order mode, an order containing both sizes still counts once for the parent.
Selected Variation Only
- Place Purchase Activity and the normal WooCommerce variation form inside the same product/card/popup scope.
- Leave Product / variation ID empty or use the variable parent's ID.
- Choose Selected variation only.
- Save and test the real storefront. The message starts hidden until the form has a valid variation selection.
- Select different sizes/colors, reset the form, and check below-threshold variations. Each display should follow only its own matching form.
A selected variation uses its own eligible counts, not its siblings' counts. Changing the selection temporarily hides old activity while a cached read-only request is resolved. Resetting the selection, receiving a low count, or encountering an unavailable request hides the message rather than retaining an incorrect figure.
Requests for the same parent, variation, and period are shared within the page, including widgets with different count bases. Rapid changes are guarded so an older response cannot overwrite the latest selection. This is not a separate variation picker and does not add products to the cart.
Explicit Variation ID
Enter an individual variation ID to show activity for that fixed variation without requiring a picker. This is different from following a shopper's changing selection: the fixed ID continues to refer to the specified variation. Its parent and the variation must be published and not password-protected for the visitor.
Product Pages, Loops, Quick View, and Other Placements
| Placement | Recommended setup |
|---|---|
| Single-product template | Leave the ID empty. Use combined mode for general popularity or selected mode beside the matching variation form. |
| Shop/archive/product query loop | Place the element inside the repeated product card, not outside the loop. Leave ID empty. Combined mode is appropriate when no variation form exists on the card. |
| Quick View / AJAX popup | Pass the clicked product as the popup context. Put the activity element and its matching form together. New widgets/forms are discovered after insertion; test first open, repeated open, selection, and reset. |
| Regular page outside product context | Supply a valid fixed or dynamic product ID. Otherwise there is no product to evaluate. |
| Cart or mini-cart product loop | Supply the intended product/variation ID where the loop does not supply product post context. The figure is historical product activity, not current-cart quantity or activity across the entire cart. |
Keep repeated cards and popups properly scoped. Several forms for the same product without a clear enclosing product/card wrapper can be ambiguous. Third-party swatches and variation pickers must publish the normal WooCommerce variation selection/reset events for selected mode; test integrations rather than assuming every custom picker is compatible.
Layout, Icons, and Styling
All Purchase Activity-specific controls are under the Content tab. Normal Bricks root styling remains available.
| Layout control | Behavior |
|---|---|
| Icon | Optional Bricks icon selection. No chosen icon means no icon wrapper or placeholder is output. The icon is decorative and hidden from assistive technology. |
| Icon position | Before text or After text. Default: Before text. |
| Alignment | Start, Center, or End. This aligns the icon/message group inside the available element width; it is not a separate multiline text-alignment control. |
| Icon gap | Space between the icon and message. Without an icon there is no second item to create an empty gap. |
| Width | Optional element width using the available units. Leave unset when the surrounding layout already determines the width. |
Wrapper style, Message style, Count style, and Icon style each provide Typography, Color, Background, Padding, Margin, Border, and Shadow. Icon style also includes Icon size. You can emphasize the count without making the entire sentence bold.
A restrained product-page style is a readable muted message, a stronger count, and a small optional shopping icon. For a badge treatment, use wrapper padding, a subtle background, and a small border radius. Check wrapping on narrow product cards and with long translated labels.
The default layout vertically centers the icon and text without a fixed or minimum height. A polite live region announces selected-variation message updates. Avoid CSS that overrides the element's hidden state or forces a low-sales message back into view.
Builder-Only Preview
The authorized Bricks editor uses a sample of 137 units or 23 orders, increased to your configured minimum if necessary. With default milestone formatting, the unit sample displays 100+. With Exact count, it displays 137. Controls for the period, messages, count basis, icon, and styling still apply.
The preview does not need a product with eligible sales, does not wait for a variation selection, and does not send a selected-variation activity request. It never writes orders, changes sales totals, or publishes sample counts on the frontend.
This sample is for design work only. Use actual storefront products and orders to verify the real threshold and counting policy.
Caching, Refresh Behavior, and Performance
- Server aggregates: successful results, including zero counts, are cached for up to 15 minutes. Units and distinct orders share the aggregate result for a product/scope and period.
- Product grids: standard collected WordPress/Bricks product query results can batch uncached IDs, reducing repeated order queries for the same grid. Custom loops that do not expose those product results still use the per-product cache.
- Invalidation: relevant order saves/status changes, item changes, refunds, and deletion/trash/restore operations refresh the affected product/variation cache generations rather than flushing unrelated catalog counts.
- Variation requests: the frontend can reuse the same request/result for five minutes within the current page. A failed request is not permanently retained and a later variation selection can retry it.
- Failures: a calculation error is not stored as a successful zero-sales result. The frontend hides unavailable activity instead of fabricating a number.
There is no continuous polling. Combined/fixed-product activity is server-rendered. An order being placed in another browser does not automatically update an already-open page. Selected mode refreshes on its normal form selection events, subject to the browser and server caches.
Full-page, fragment, CDN, and persistent object caches are separate layers. A long-lived cached page can retain older server-rendered text beyond the aggregate TTL, and browser variation-result reuse can also extend the age of a displayed snapshot. Purge relevant page caches or choose an appropriate page-cache lifetime when freshness is important. There is no cache-duration control in this element.
Direct database edits or integrations that bypass normal WooCommerce save hooks may not invalidate immediately. Allow aggregate caches to expire and clear the relevant page cache when testing such changes.
Practical Configurations
100+ Bought in the Past Month
Use Units sold, Past 30 days, Rounded milestone, Minimum sales 100, and combined variations. Keep {count} bought {period}. Optionally set Custom period text to in the past month. A product with 137 qualifying net units shows 100+; one with 99 stays hidden.
Exact Monthly Order Activity
Use Distinct orders, Current calendar month, Exact count, and Minimum sales 1. Keep separate singular/plural order messages. Twenty-three eligible orders produce 23 orders placed this month, even if those orders contain more than 23 units.
Popularity for the Selected Size
Use Selected variation only beside a standard size/color form, Exact count, and a suitable minimum. The selected size's activity appears after a valid selection. A size with insufficient sales remains hidden even if the parent product has strong combined sales.
Purchase Activity Versus Best Selling Badge
Best Selling Badge checks the product's stored lifetime total_sales threshold and displays a custom label. Purchase Activity calculates a recent order-based aggregate for a selected window and displays its numeric result.
Use Best Selling Badge for a simple lifetime-threshold label. Use Purchase Activity for messages about recent units or order activity and selected variations. Neither element ranks all products against each other or proves a product is the store's number-one seller.
Troubleshooting
| Symptom | What to check |
|---|---|
| Element is missing in Bricks. | Enable Purchase Activity under Woo Elements, save, and reload the builder. It is not a MISC or Quantity Pricing switch. |
| Visible in builder but hidden on the frontend. | The editor uses sample data. Check actual product context, publication/password protection, eligible recent orders, refunds, and the minimum threshold. |
| Lifetime sales are high but recent activity is low. | This uses order creation dates in the chosen window, not total_sales or stock movement. Check statuses and timezone/month boundaries. |
| 137 displays as 100+. | Expected in milestone mode. Choose Exact count to show 137. |
| More units than orders. | Expected when an order contains multiple units or duplicate lines. Order mode counts an eligible order once per product scope, not once per unit or customer. |
| A partial refund did not lower units. | Check whether WooCommerce recorded returned item quantities. An amount-only refund cannot establish how many units were returned. |
| Selected mode stays hidden. | Choose a complete variation, keep the element with the matching form, check that the variation reaches the threshold, and inspect the read-only WooCommerce AJAX request and JavaScript errors. |
| A fixed variation does not follow the picker. | An explicit variation ID is intentionally fixed. Use the variable parent/current-product context and Selected variation only to follow the form. |
| Wrong activity in repeated cards or popups. | Place the element inside the intended product context and keep each matching form within a clear card/popup scope. Remove unintended fixed IDs. |
| Counts look stale after a real order change. | Check order eligibility and normal WooCommerce hooks, then server/browser/page caches. An already-open page is not continuously refreshed. |
| Message vanishes after a request error. | Intentional protection against stale sales claims. Fix the network/security/cache problem, then select again or reload. No fake fallback is displayed. |
| Space remains after hiding. | The element itself is hidden; inspect any parent container's padding, minimum height, gap, or sibling decorations. |
Before Publishing
- Test a known eligible product above and below the minimum, plus a product with zero sales.
- Compare exact units and orders against known order items, including duplicate lines in one order.
- Test all periods and a calendar-month boundary in your site's timezone.
- Test Processing/Completed, excluded statuses, itemized partial refunds, full refunds, and refund deletion.
- Test combined variations, a fixed variation ID, selected-size changes, rapid changes, and reset.
- Test product-loop cards and first/repeated Quick View opening with the actual variation picker used by the store.
- Check desktop/mobile wrapping, icon sizing, translated singular/plural messages, and readability.
- Check the store's authoritative HPOS or legacy order storage and its real page-cache configuration on staging.
- Confirm builder sample data never appears on public pages.
Developer Reference and Scope
- Element identifier:
bu-purchase-activity. Activation key:purchaseactivity. - CSS:
.bu-purchase-activity,.bu-purchase-activity-message,.bu-purchase-activity-count, and.bu-purchase-activity-icon. Scope overrides to your element ID/class. - Data:
data-bu-purchase-activitycontains frontend configuration.data-bu-purchase-activity-demomarks the authorized builder preview. - Variation endpoint: WooCommerce AJAX action
bu_purchase_activity. Public read-only GET requests validate parent/child publication and protection. Responses contain aggregate counts and formatted count strings, not order IDs, customer identities, or order details. - Assets:
assets/css/elements/purchase-activity.cssandassets/js/elements/purchase-activity.js.
There are no dedicated Purchase Activity dynamic tags, builder interaction triggers, unique-customer mode, live-viewer counts, manual fake-sales control, arbitrary custom-date picker, or per-element status/caching settings. The feature does not modify prices, reserve stock, alter orders, or add products to the cart.