Quantity

(BU)Quantity adds a standalone numeric quantity field to a WooCommerce product card. Use it when the quantity field and Add to Cart link need to sit in different parts of the same Bricks query-loop item. A shopper chooses a number, then clicks the linked Add to Cart control to purchase that quantity.

The field does not add anything on its own, change the quantity of an existing cart line, or act as a variation picker. It displays for purchasable, in-stock simple products and individual variations when the variation itself is the current item.

Set Up a Product Card


  1. In Bricks → BricksUltimate → Woo Elements, enable Quantity. Enable Add To Cart or Add To Cart Icon as well if you plan to use that BricksUltimate element. Save and reopen Bricks.
  2. Open your Shop, archive, or landing page in Bricks. Build a product query loop and place (BU)Quantity and the Add to Cart element inside the same repeated product card.
  3. Use a loop Add to Cart control that reads the link's data-quantity attribute. For (BU)Add To Cart, enable its query-loop mode. Disable any built-in quantity input for that button if you are using the standalone one, so shoppers see only one quantity field.
  4. In (BU)Quantity, set Add to cart button selector to the purchase link for that card. Use the examples below or inspect the actual rendered link.
  5. On the storefront, change the quantity in one card and click its corresponding Add to Cart control. Check the quantity added in WooCommerce, then repeat with a different product to confirm the cards are independent.

Connect the Right Link

  • Native Bricks Add to Cart in a product loop: Start with .brxe-product-add-to-cart a, the element's default selector.
  • (BU)Add To Cart in a product loop: Start with .brxe-bu-atc a.add_to_cart_button and confirm it matches the purchase link in your layout.
  • (BU)Add To Cart Icon: For the icon that directly adds the item, target .brxe-bu-atci a.bu-add-to-cart. Do not target the Select options link or spinner icon.
  • Multiple links in one card: Give the intended Add to Cart element or its wrapper a class, such as card-purchase, and narrow the selector to its actual purchase link, for example .card-purchase a.add_to_cart_button.

The Quantity script searches the closest Bricks loop item for the first matching element and writes the quantity to its data-quantity attribute. Target the link itself, not its container, a View cart link, or a regular form submit button. Placing the field next to a button outside the loop does not connect them. The usual setup uses WooCommerce's AJAX Add to Cart behavior; verify the selected amount reaches the cart, since a link or integration that ignores data-quantity may still add one item.

Choose the Right Quantity Control


  • Simple product in a grid: Use (BU)Quantity with a matching loop purchase link when you need to position the field independently. Use the quantity built into (BU)Add To Cart if both controls can stay together.
  • Single-product page: For a regular single-product layout, keep the quantity field in the native or BricksUltimate Add to Cart form. WooCommerce submits that form's quantity; the standalone element's link selector is designed for loop items, even if the field itself renders on a simple product page.
  • Variable product: Use the quantity field inside the variation form so it can follow the shopper's selected size or color, stock limits, and purchase state. On a grid of variable parent products, use an options workflow such as BricksUltimate Quick Add or send shoppers to the product page. A standalone Quantity field does not appear for a variable parent and does not update when swatches select a variation.
  • Query loop of individual variations: The field can render for a valid, purchasable variation in its own card. Pair it with a link that adds that exact variation, including any required attributes. Verify the variation and quantity in the cart.
  • Side-by-side comparison: In Compare Items, add a Quantity row and a (BU) Add To Cart row. Use the per-product selector .bu-atc--{post_id} .brxe-bu-atc a in the Quantity row so each field targets its own column. Test two products with different quantities.
  • Cart, mini-cart, or editable checkout summary: Use the built-in controls of Cart Content, or (BU)Item Quantity inside a Mini Cart Contents loop. Those controls are meant to update an existing cart item. Use WooCommerce's native quantity control in a Cart Block.
  • Preset list of quantities: Use the separate (BU)Dropdown Quantity element when you want selectable values instead of a number input. Configure its action and maximum separately.

Minimum, Maximum, and Step


The standalone element starts with a quantity of 1 before filters. It gets the minimum and maximum from the product's WooCommerce purchase limits, and the default step is 1. WooCommerce quantity-input filters can change those values. The element has no builder controls for setting purchase limits or stock independently.

For example, with a step of 1 and a maximum of 5, the shopper cannot increment the field past 5 using the plus control. If a store extension changes the minimum or step, check that the initially displayed value is valid and that clicks and typed values send the expected amount. The field is not a substitute for WooCommerce's server-side stock and purchase validation.

Style the Quantity Field


  • Wrapper: Set width, height, background, and border for the whole control.
  • +/- Buttons: Set width, icon size, background, color, and border. Use the separate hover settings for feedback. Disable it hides the plus and minus controls while leaving the numeric field available.
  • Quantity field: Set its width, font size, text color, and background. Use the focus color and background settings to make keyboard focus visible.

Give the field enough room to show the largest quantity customers can buy. Check the control on mobile, where the buttons, field, and Add to Cart link should be easy to use without overlapping.

Test and Troubleshoot


  • The field is missing: Confirm Quantity is enabled and the current product is a purchasable, in-stock simple product or a specific variation. In Bricks template settings, use Populate Content to preview a qualifying product.
  • The button adds only one item: Confirm both elements are in the same repeated card and the selector targets the actual purchase link. In the browser inspector, check that the link's data-quantity changes after clicking plus or minus, or after entering a number and leaving the field. If it updates but WooCommerce still adds one, check whether your button uses AJAX or otherwise consumes that value.
  • The wrong link updates: Narrow the selector so there is only one match in the card. The first match wins.
  • The plus and minus controls do not respond: Check that your layout loads the Bricks quantity controls and BricksUltimate scripts. If it only happens after filtering, opening an AJAX popup, or using another language, repeat the test in that exact storefront context and check the browser console.
  • Typed quantities behave differently from clicks: Test both methods on your actual template. Check the field's minimum, maximum, and step and compare the requested quantity with the cart result. Keep the Add to Cart form's built-in quantity on single-product layouts.
  • There are two quantity fields: Keep either the standalone element or the built-in field for that purchase action. Do not give both control of the same link.

Related BricksUltimate Guides

  • Add To Cart Button: Built-in quantity controls, loop mode, and variable-product Quick Add.
  • Add To Cart Icon: Icon-based AJAX purchasing in query loops and its optional swatch integration.