=== Frequently Bought Together ===
Contributors: bricksultimate
Tags: woocommerce, frequently bought together, product bundles, cross sells, upsells, bricks builder
Requires at least: 6.9.4
Requires PHP: 8.0
Tested up to: 6.9.4
WC requires at least: 7.0
WC tested up to: 10.8.1
Requires Plugins: woocommerce
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Free Frequently Bought Together offers for WooCommerce with global product sources, responsive layouts, discounts, Bricks-friendly placement, and style controls.

== Description ==

Frequently Bought Together helps WooCommerce store owners show global add-on product offers on single product pages. The plugin can use manually selected products, related products, upsells, cross-sells, and optional smart rules as the global source for Bought Together offers.

This free version focuses on global settings only. Individual product and variation override settings are not included.

The plugin is designed as a standalone WooCommerce extension and works with normal WooCommerce product templates, shortcode placement, and Bricks Builder single product templates.

= Main Features =

* Global Bought Together products from manually selected products, related products, upsells, cross-sells, and smart rules.
* Storewide manual product list with drag and drop ordering.
* Manual product search by product name, SKU, ID, phrase, or exact title.
* Flexible layouts: list, grid 2 columns, grid 3 columns, grid 4 columns, and separate images.
* Responsive desktop and mobile layout settings.
* Plus badges between grid products with automatic gap-aware positioning.
* Global discount input supports percentage and fixed values, such as 10% or 12.50.
* Product-card original and discounted price display.
* Additional price and total bundle price display with original and discounted totals.
* Optional selected item counter on the add-to-cart button.
* Default selected state for global add-ons.
* Quantity customization in the widget.
* Optional cart quantity changes for add-ons.
* Add associated items separately as individual cart items, or bundle them into the main cart item.
* Variable add-on product support with variation dropdowns.
* Variation selection updates add-on price and thumbnail image.
* Parent variable product shortcode support.
* Product link behavior: same tab, new tab, or Quick View trigger.
* Product details controls: thumbnail, price, rating, terms, and short description.
* Admin settings tabs: Settings and Documentation.
* Built-in documentation tab explaining plugin settings.
* Style Studio for colors, typography sizes, layout spacing, cards, buttons, checkboxes, prices, quantity fields, variation fields, and summary text.
* Pickr-based color picker loaded locally from plugin assets.
* WPML and Polylang support for configurable frontend texts.
* WooCommerce HPOS compatibility declaration.

== Requirements ==

* WordPress 6.9.4 or newer.
* PHP 8.0 or newer.
* WooCommerce 7.0 or newer.
* A WooCommerce-compatible theme or builder.
* Bricks Builder is optional. The plugin includes shortcode and placement support suitable for Bricks templates.

== Installation ==

1. Upload the plugin ZIP from Plugins > Add New > Upload Plugin.
2. Activate the plugin from the WordPress Plugins screen.
3. Make sure WooCommerce is installed and active.
4. Go to Bought Together > Settings.
5. Enable global Bought Together offers.
6. Configure global product sources, layout, pricing, cart behavior, and frontend text.

== Global Setup ==

Global settings control which add-ons appear on product pages.

Available global sources:

* Manually selected products.
* Related products.
* Upsells.
* Cross-sells.
* Smart rule products.

Manual global products are added from the Settings tab. Enable "Manually selected products", search for products, add them to the list, and drag them into the preferred order.

== Shortcode ==

Use the shortcode to place Bought Together manually:

[bu_fbt]

Render a specific product:

[bu_fbt product_id="123"]

Shortcode placement works well with Bricks Builder templates and shortcode blocks. In Settings, choose "Shortcode / Bricks placement only" to disable automatic WooCommerce hook placement.

== Frontend Placement ==

The plugin can render automatically on single product pages using WooCommerce hooks:

* Above add to cart.
* Under add to cart.
* After product summary.
* Before product tabs.
* After product tabs.
* Shortcode / Bricks placement only.

== Pricing and Cart Behavior ==

The plugin can calculate discounts from the sale price or regular price. The global discount applies to global add-on products.

Discount examples:

* 10% means percentage discount.
* 50 means a fixed price.
* Blank means no discount.

Cart options:

* Add add-ons separately as individual cart items.
* Bundle add-ons into the main cart item metadata.
* Allow or disallow add-on quantity changes in cart.

== Style Studio ==

The Style Studio lets store owners customize the frontend appearance without editing CSS.

Available design groups:

* Layout and spacing.
* Typography sizes.
* Colors.

Customizable areas include wrapper, heading, text, grid gap, product cards, titles, prices, quantity inputs, variation dropdowns, checkboxes, buttons, associated text, additional price, total price, and plus badges.

== Localization ==

The plugin uses the text domain bu-fbt and supports standard WordPress translation workflows.

Configurable frontend texts are registered for WPML and Polylang when those plugins are active. Developers can also use:

bu_fbt_translate_string

== Compatibility ==

Frequently Bought Together is built for WooCommerce and is intended to work with most WooCommerce themes and builders.

Known compatibility scope:

* WooCommerce products and variations.
* WooCommerce linked products: upsells and cross-sells.
* WooCommerce related products.
* WooCommerce cart and mini-cart price display.
* Bricks Builder shortcode/template placement.
* WPML and Polylang frontend text translation.
* WooCommerce HPOS.

== Frequently Asked Questions ==

= Does the main product count in the selected item counter? =

No. The selected item counter only counts selected add-on products. The main product is not optional, so it is not included in the counter.

= Can I choose a global manual product list? =

Yes. Enable "Manually selected products" under Global Products, search for products, add them to the list, and drag them into the preferred order.

= Can I create a custom Bought Together list for one product? =

No. This free version uses global rules only. Individual product and variation override settings are not included.

= Can variable products be Bought Together add-ons? =

Yes. Variable add-ons show variation dropdowns. Selecting a variation updates the card price and thumbnail.

= Can I use the plugin only inside Bricks Builder? =

Yes. Set Product list position to Shortcode / Bricks placement only, then place [bu_fbt] in the Bricks template.

= Does the plugin support WPML or Polylang? =

Yes. Configurable frontend texts are registered for WPML and Polylang when those plugins are active.

== Changelog ==

= 1.0.0 =

* Initial free release.
* Added global product sources: manual products, related products, upsells, cross-sells, and smart rules.
* Added responsive layouts and Bricks-friendly shortcode placement.
* Added global pricing, discounts, total price display, and cart behavior controls.
* Added variable add-on support with variation dropdowns, price updates, and thumbnail updates.
* Added Style Studio.
* Added documentation tab.
* Added WPML and Polylang support for configurable frontend text.
