Best Selling Badge

(BU)Best Selling Badge displays a label when a WooCommerce product reaches a sales threshold you set. Place it next to the product title, above the price, or over an image in a product grid.

Before you start: Activate WooCommerce and BricksUltimate, then enable Best Selling Badge under Bricks → BricksUltimate → Woo Elements. Save your settings and open the Bricks editor.

How the Badge Qualifies


The element checks the product's stored WooCommerce total_sales value. If you set Minimum number of sales to 50, a product with 49 recorded sales does not show the badge. A product with 50 or more does. Leave the field blank or set it to 0 and the badge does not render. A product with no recorded sales does not qualify.

This is a threshold, not a store-wide ranking. It does not compare products, apply a time window, or count stock on hand. Several products can show the badge at the same time. To build a separate list ordered by sales, use Ultimate Woo Query Builder → Best Selling Products for the loop and add the badge only if you also want a minimum-sales label on its cards.

Add the Badge to a Product Template


  1. Open your WooCommerce single-product template in Bricks. Add (BU)Best Selling Badge near the title, price, or product image.
  2. Leave Product ID blank so the element uses the current product.
  3. Enter a positive value in Minimum number of sales. Set Badge to the text shoppers should see, such as Best Selling or Popular Pick. This is a custom label, not a live sales counter.
  4. Style the badge, save the template, and check a qualifying product and a product below the threshold on the storefront.

Use It in a Product Query Loop


  1. Open the Shop, product archive, or page containing your Bricks product grid. Find the repeated card in the product query loop.
  2. Add the badge inside the repeated card and leave Product ID blank. Each card should test its own product's sales against the same threshold.
  3. To overlay the badge, put it inside the image wrapper. Use Bricks' positioning controls to set the image wrapper to Relative and the badge to Absolute, then set the top and side offsets. Check that the badge does not cover wishlist buttons, sale labels, or other controls on narrow screens.

On a regular page without an active WooCommerce product context, you can enter a specific Product ID to check that product's sales. Use the numeric product ID, not its SKU. If WooCommerce has already supplied a current product, the element uses that context instead, so this field is not an override inside a product template or loop.

Style the Badge


  • Tag: Use span beside other inline content or div for a standalone badge. The default is div.
  • Size & Spacing: Set the width, height, margin, and padding as needed. For a label that follows the text length, leave width and height unset, choose inline-block, and use padding for breathing room.
  • Background Color and Typography: Set a high-contrast background and text colour. Keep the label short enough to fit on small product cards.
  • Layout: Display defaults to flex. In flex mode, use Align main axis and Align cross axis to centre the label or position it within the badge. Flex wrap controls whether flex items may wrap.
  • Hide In-Builder Editor? Hides the demo badge in the editor only. The storefront still follows the sales threshold. The demo text is for styling and does not indicate whether the preview product qualifies.

Troubleshooting


  • The badge appears in Bricks but not on the storefront: Check that the threshold is greater than zero, the correct product is being evaluated, and its recorded sales meet the threshold. Also check that Display is not set to none.
  • The wrong card shows the badge: Put the element inside the repeated product card, clear Product ID, and confirm the query returns WooCommerce products.
  • Changing a variation does not change the badge: This is a storefront render check for the product in context. It does not recalculate when a shopper selects a variation.
  • A newly qualifying product still has no badge: Confirm WooCommerce has recorded the sales, then check for stale page or fragment caching. Test on staging with a threshold below and above a known product's recorded count.