The Customers Also Bought app adds a product recommendation section to your J2Commerce product detail pages. You choose which products appear for each item and customers check the ones they want. The section shows only products that are currently in stock, so customers never encounter unavailable items.
Two layouts are available: Product Cards with a Purchase Together button, and Stacked, a checkbox list with a live subtotal that adds everything with the product's own Add to Cart button.
Use it to suggest complementary products, such as accessories, on the page where the shopper is already choosing the main product.
Requirements
- PHP 8.3+
- Joomla! 6.x
- J2Commerce 6.6.4 or later
Purchase and Download
‌Step 1: Go to our J2Commerce website -> Apps
Step 2: Locate the Customers Also Bought App -> click View Details -> Add to cart -> Checkout.
Step 3: Go to your My Downloads under your profile button at the top right corner and search for the app. Click Available Versions -> View Files -> Download
Install the App
Go to System -> Install -> Extensions
Upload the plugin ZIP file or use the Install from URL option.

Enable the App
Once you have installed the App, you will need to enable it. There are two ways you can access the App.
Option A: Go to the J2Commerce icon at the top right corner -> Apps
Option B: Go to Components on the left sidebar -> J2Commerce -> Apps

To help you narrow down the list, you can do a search for the J2Commerce - Customers Also Bought app, click the X, and it will turn into a green checkmark. It is now enabled and ready for setup.

Configure the App
Click on the Customers Also Bought title to open the plugin settings. The settings are on two tabs, Plugin and Display.
Plugin Tab
| Setting | What It Does | Default | Options |
|---|---|---|---|
| Template Style | The template style used to render the section. Choose the one that matches your front-end theme. | Auto (empty) | The installed template styles, such as bootstrap5 and uikit |
| Section Title | Heading displayed above the products. Leave it blank to use Customers Also Bought. | Blank | Any text |
| Fall Back to Cross-Sells | When a product has no Customers Also Bought list, shows its cross-sells instead. | No | Yes, No |
| Debug Mode | Writes diagnostic messages to logs/app_customerbought.php. Turn it off in production. | No | Yes, No |
Display Tab
The Display tab controls the layout and the look of the section on every product page.
| Setting | What It Does | Default | Options |
|---|---|---|---|
| Display Layout | Product Cards shows the add-ons as cards with a Purchase Together button. Stacked shows a checkbox list with a live subtotal; the product's own Add to Cart button adds the product and every ticked item. | Product Cards | Product Cards, Stacked |
| Display Position | Where on the product page the section appears. Use Stacked with Before Add to Cart or After Add to Cart. | Before Upsells | Before Upsells, Before Cross-sells, Before Add to Cart, After Add to Cart |
| Maximum Products | The most associated products to show at once. | 6 | 1 to 20 |
| Show Price | Shows the price of each product. | Yes | Yes, No |
| Show Discount Badge | Shows a discount badge when a product has a special price. | Yes | Yes, No |
| Button Text | Label of the Purchase Together button. Leave it blank to use Purchase Together. | Blank | Any text |
| Button CSS Class | CSS classes applied to the button. Change them to match your theme's button style. | btn btn-primary | Any CSS classes |
| Show Subtotal and Checked Items | Stacked layout only. Shows the summary line (for example 1 × Product + Add-on) and the subtotal under the list. Shown when Display Layout is Stacked. | Yes | Yes, No |
| Cards per Row | Product Cards layout only. A table with one row per screen width (Screen Width and Cards per Row) that sets how many cards fit in a row from that width upwards. A width you leave out uses the row above it; if a width is listed twice, the last row wins. | 1 (XS), 2 (SM), 3 (MD), 4 (LG), 4 (XL), 5 (XXL) | 1 to 6 cards for XS (below 576px), SM (576px and up), MD (768px and up), LG (992px and up), XL (1200px and up), XXL (1400px and up) |
With the Product Cards layout, the section switches to a Swiper.js slider when there are more products than fit in a single row.
Click Save or Save & Close to apply your changes.
Note
If you used the Responsive Display tab before, your saved card counts still apply. They now appear in the Cards per Row table on the Display tab.
Assign Products to Each Product Page
The global settings above apply site-wide. You then assign specific associated products to each individual product. This is done inside the product editing form.
Go to J2Commerce -> Catalog -> Products.

Click on the product you want to configure.
Click on the J2Commerce tab -> Apps. Scroll down to find the Customers Also Bought tab in the product form.

To change the layout for this product only, set Display Layout at the top of the tab to Product Cards or Stacked. The default, Use Plugin Setting, follows the plugin's Display Layout.
In the Search Products field, type a product name or SKU. A dropdown appears as you type (minimum 2 characters).
Select a product from the suggestions. It is added to the table immediately with a live stock status badge — In Stock (green) or Out of Stock (amber).

-
Repeat for each additional product you want to associate.
-
To remove a product, click the red trash icon in its row.
-
Click Save on the product.
Out-of-stock products show a warning in the table to let you know they will not appear on the front end until stock is restored.
Frontend View

How It Works on the Front End
With the Product Cards layout, a shopper who visits a product page where you have configured associated products sees this:
- The Customers Also Bought section appears in the position you selected (before upsells, before cross-sells, before the add-to-cart button, or after it).
- The current product card appears first with its checkbox pre-checked and locked — it is always included.
- Associated in-stock products appear alongside it, each with their own checkbox pre-checked.
- Shoppers can uncheck any product they do not want.
- A running total updates in real time as checkboxes are toggled.
- Clicking Purchase Together (or your custom button label) adds all checked products to the cart in a single action.
Products that are out of stock are filtered out automatically and never shown to shoppers. If all associated products for a given product page happen to be out of stock, the entire section is hidden.
Stacked Layout
With the Stacked layout, the section is a checkbox list inside the product's add-to-cart area.
- Each add-on has a checkbox, its image, its name and its price.
- The subtotal and the summary line update as the shopper ticks items.
- The product's own Add to Cart button adds the product and every ticked add-on to the cart.
An add-on that has options shows a Choose Options link to its product page instead of a checkbox. An add-on priced at 0.00 shows its price and can be ticked like any other.
Frontend View

Display Conditions
The section appears on a product page only when all of the following are true:
- The plugin is enabled.
- The current product has at least one associated product configured in its Customers Also Bought tab, or Fall Back to Cross-Sells is Yes and the product has cross-sells.
- At least one of those associated products is currently in stock.
Tips
- Assign 4–6 complementary products per product page for the best experience. Too many choices can be overwhelming.
- Use the Maximum Products setting as a safety limit — if you assign 10 products but set the maximum to 6, only the first 6 eligible in-stock products are shown.
- Adjust the Display Position to suit your page layout. Before Upsells works well when upsells are visually prominent, so the "Also Bought" section leads into them naturally.
- Use the Stacked layout with the Before Add to Cart or After Add to Cart position, so the checkbox list sits next to the button that adds it.
- Every element in both layouts carries a class that starts with
j2c-cb-. Use these classes in your template's CSS to restyle the section. - Keep the Button CSS Class consistent with your theme's primary action buttons for a polished look.
Troubleshooting
The Section Does Not Appear on the Product Page
Cause: One or more configuration steps have been missed.
Solution:
- Confirm the plugin is enabled in J2Commerce -> Apps.
- Open the product in J2Commerce -> Catalog -> Products and verify that at least one product has been added to the Customers Also Bought tab.
- Confirm that the associated product(s) are published and in stock. Out-of-stock products are automatically hidden.
- Check that Display Position in the Display tab matches a position that your current template renders.
All Associated Products Show as Out of Stock in the Admin
Cause: The products have stock management enabled and their availability count is zero (and backorders are not allowed).
Solution:
- Go to J2Commerce -> Catalog -> Products and open each affected associated product.
- Check the product's stock settings — either increase the stock quantity or allow backorders.
- Alternatively, disable stock management for that product if stock tracking is not required.
The Purchase Together Button Does Not Add Products to the Cart
Cause: A JavaScript error on the page is preventing the click handler from running.
Solution:
- Open your browser's developer tools (F12) and check the Console tab for errors.
- Clear your browser cache and reload the page.
- Enable Debug Mode in the plugin settings, reproduce the issue, then check
logs/app_customerbought.phpfor any server-side messages.
The Section Appears in the Wrong Location
Cause: The Display Position setting does not match the desired position.
Solution:
- Go to J2Commerce -> Apps -> Customers Also Bought and open the Display tab.
- Change Display Position to the desired value.
- Click Save, then reload the product page to verify the new position.
Stock Badges Are Not Updating After Adding a Product in Admin
Cause: The stock check runs via an AJAX call immediately after you select a product. A network issue or JavaScript error may have interrupted it.
Solution:
- Save the product form and reopen it. The stock status is re-evaluated fresh each time the form loads.
- If a product consistently fails to show a stock badge, verify the product has a master variant in the database and is published.