Skip to content
Gaurav TiwariDocs

Show Frequently Bought Together Products

Updated November 22, 2026

Shoppers often need two or three things that go together: the camera and the memory card, the course and the workbook. WooCommerce’s related products are picked by category and tag, not by what people actually buy, and each one needs its own trip to the cart.

Frequently Bought Together shows the product being viewed with up to three companions, a combined total and one button that adds the checked items. Companions come from your own picks first, then from your paid order history. You can also give a discount when a shopper takes the whole set.

Turn On Frequently Bought Together

  1. Open Stackless → Dashboard and turn on Frequently Bought Together in the Catalog section.
  2. Open Stackless → Settings → Frequently Bought Together and choose a placement under Show automatically, or add the block or shortcode yourself.
  3. Click Save changes.

Nothing shows until you choose a placement, add the block or use the shortcode. A product shows the box only when it has at least one companion to offer.

Choose Where the Box Shows

  • Show automatically: Off (default), After the add to cart button, After the product summary, before the tabs or After the description tabs. Classic product templates and block themes are both covered.
  • Heading: up to 80 characters. Leave it empty to show “Frequently bought together” when order history chose every companion, and “Buy it with” when any of them is your own pick.
  • Companions: 1, 2 or 3, with 3 as the default.

For any other spot, add the Frequently Bought Together block, with optional Heading and Product ID settings, or this shortcode:

[stackless_bought_together id="123" heading="Complete the kit"]

Both attributes are optional. Without id, the box uses the product being viewed.

Pick Companions for a Product

Edit the product and open Product data → Bought together. In Companions, search for products or variations and put them in the order you want, up to six. The box shows as many as the Companions setting allows, and order history fills any places left.

The tab also lists your picks that aren’t shown right now, and the products order history suggests, with how many orders they shared. It isn’t shown for external and grouped products.

A variable product you pick offers its default variation. Pick a single variation to offer that one.

Suggestions from Order History

  • Automatic suggestions: Suggest products bought in the same paid orders, on by default.
  • Minimum shared orders: 3 by default, at least 2. A product is suggested with another only after this many orders contained both.

Suggestions are counted once a day from paid orders of the last 365 days. Renewals, orders with a refund, orders from internal addresses and orders with more than 25 products are left out. Variations count under their product, and quantities don’t add weight.

Below the settings, Order history data shows when suggestions were last rebuilt and how many product pairs were found, with a Top pairs table. Click Rebuild suggestions now after a big import. A long rebuild continues in the background.

Which Products Are Left Out

The box skips a product, as a companion or as the product being viewed, when it:

  • isn’t published, is hidden from the catalog, or is out of stock
  • can’t be bought or has no price
  • is a subscription, an external product or a grouped product
  • is a variation with an attribute set to “Any”
  • needs a choice first, such as a required product add-on
  • can’t be bought by this shopper under Purchase Rules (role, tag or Buy once)
  • is already in the cart

What Shoppers See

The box lists “This item:” with the product, then each companion with a View product link. Every item has a checkbox, all checked. A variable product being viewed gets an Option dropdown that follows the variation the shopper picks. Below the items are the Total price and an Add selected to cart button.

One click adds one of each checked item to the cart. The shopper sees “3 items were added to your cart.” with a View cart link, or which items couldn’t be added and why. The box then redraws without the items now in the cart.

The box needs JavaScript. Without it, the shopper sees “Turn on JavaScript to add these items to your cart together.”

Give a Set Discount

  • Discount: Give a discount when a shopper adds the whole set from the box, off by default.
  • Percentage off: 1 to 90, with 10 as the default.
  • Discount code: up to 30 letters, digits and dashes, bought-together by default. It can’t be the code of a WooCommerce coupon.
  • Other coupons: Allow it together with other coupons, off by default.

With the discount on, the box says “Add all 3 items together to save 10% on them. The discount shows in your cart.” The set is the product being viewed and every companion the box offered.

The discount applies only while the whole set is in the cart, and only to complete sets. The number of sets is the smallest quantity among the set’s items, and the discount covers that many units of each item. One set with the product raised to 10 discounts one unit of each item, not ten of the product. If any item of the set leaves the cart, the discount comes off, and adding that item back from elsewhere doesn’t bring it back. Adding the set from the box again does.

In the cart and on the order it’s a coupon line. The classic cart and the Cart and Checkout blocks show it as “Bought together:” and the code in capitals, such as “Bought together: BOUGHT-TOGETHER”. With Other coupons off, a cart has either the set discount or another coupon, whichever came first, and the shopper sees “The set discount could not be combined with the coupon already in your cart.” Coupons set to individual use never combine with it. Cart Goals rewards always combine.

Limits

  • Up to three companions, and one of each item per click.
  • No fallback to related products, upsells or cross-sells. With no pick and no order history, there’s no box.
  • Order history updates once a day and ignores quantities.
  • The box total is the price before the set discount.
  • There’s no report of clicks or revenue from the box.
  • The Option dropdown follows WooCommerce’s classic variation form.
  • The box doesn’t check country locks from Purchase Rules. The cart and checkout do.
  • Shoppers can add up to 60 times an hour from the same IP address. After that they see “Too many requests. Please wait a while and try again.”

For Developers

stackless_frequently_bought_together_product_blocked keeps a product or variation out of every box. It receives bool $blocked, WC_Product $product:

add_filter('stackless_frequently_bought_together_product_blocked', function ($blocked, $product) {
    $id = $product->get_parent_id() ?: $product->get_id();
    return $blocked || has_term('gift-cards', 'product_cat', $id);
}, 10, 2);
  • stackless_frequently_bought_together_lookback_days: int $days, 365 by default. 0 counts every order.
  • stackless_frequently_bought_together_rate_limit: int $limit, adds per IP address per hour, 60 by default.
  • stackless_frequently_bought_together_coupon_combines: bool $combines, WC_Coupon $coupon, to let one coupon combine with the set discount.
  • stackless_frequently_bought_together_added: action after a box add, with the cart, the added items, the failed items and the offer.
  • stackless_frequently_bought_together_built: action after a rebuild of the suggestions goes live.

To change the box’s markup, copy templates/frequently_bought_together/box.php from the plugin to stackless/frequently_bought_together/box.php in your theme.

Share

Was this helpful?

Still stuck? Open a support ticket