For Developers
Shortcode
Section titled “Shortcode”[sales_booster_extras_frequently_bought_together]
Section titled “[sales_booster_extras_frequently_bought_together]”Displays the Frequently Bought Together block.
[sales_booster_extras_frequently_bought_together]Common Shortcode Attributes
Section titled “Common Shortcode Attributes”[sales_booster_extras_frequently_bought_together product_id="123" template_variant="woocommerce_loop" display_type="slider" loop_columns="3"]Supported attributes (current implementation):
product_idlimitdisplay_type(standard,slider)layout_direction(vertical,horizontal)template_variant(minimal,woocommerce_loop)loop_columnsrender_mode(server,ajax)titleshow_slider_dotsshow_slider_arrows
REST API
Section titled “REST API”Namespace:
/wp-json/sales-booster-extras/v1GET /fbt-render
Section titled “GET /fbt-render”Renders the FBT block HTML (used for AJAX render mode).
Query params:
product_id(required)- same render args as shortcode (optional), e.g.
limit,display_type,template_variant,loop_columns, …
Response:
{ "html": "<section class=\"sbe-fbt ...\">...</section>"}GET /fbt-index-status
Section titled “GET /fbt-index-status”Returns backfill/index status for the admin tools UI.
Requires capability: manage_options
POST /fbt-index-run
Section titled “POST /fbt-index-run”Runs one backfill batch (or rebuild + first batch).
Body:
mode:backfillorrebuildbatch_size: integerwith_counts: boolean (optional; request full expensive counters)
Requires capability: manage_options
WP-CLI
Section titled “WP-CLI”The module registers the fbt command.
Backfill
Section titled “Backfill”wp fbt backfill --batch-size=300Rebuild
Section titled “Rebuild”wp fbt rebuild --batch-size=300Data Model
Section titled “Data Model”Custom Table
Section titled “Custom Table”The recommendation index is stored in a custom table managed through WPify Model:
- table (default prefix):
wp_sales_booster_extras_fbt_index
It stores undirected pairs (one row per pair):
product_parent_idrelated_parent_idscore- timestamps
Pairs are normalized as:
(min(productA, productB), max(productA, productB))
Why Parent-Level IDs?
Section titled “Why Parent-Level IDs?”Scoring is stored on parent product level to keep the index compact and stable:
- variations are normalized to the variable parent product
externalandgroupedproducts are ignored for indexing- child line items from bundles/composites/etc. are ignored (parent line item only)
Indexing Flow
Section titled “Indexing Flow”Automatic Incremental Indexing
Section titled “Automatic Incremental Indexing”Indexing runs on WooCommerce order status transitions:
processingcompleted
The module uses Action Scheduler async jobs when available and falls back to synchronous processing.
Order Flags
Section titled “Order Flags”The module stores internal order meta flags to avoid duplicate indexing:
_sbe_fbt_indexed_once_sbe_fbt_index_queue_scheduled
These are handled with WooCommerce order meta APIs (HPOS-compatible).
Product Meta (Overrides)
Section titled “Product Meta (Overrides)”Per-product FBT override data is stored in:
_sales_booster_extras_fbtStructure (simplified):
[ 'override_mode' => 'auto' | 'replace' | 'merge', 'manual_product_ids' => [12, 34, 56],]Frontend CSS Classes (FBT)
Section titled “Frontend CSS Classes (FBT)”Examples:
.sbe-fbt- root container.sbe-fbt__title- heading.sbe-fbt__viewport- scroll/Embla viewport.sbe-fbt__list- minimal list.sbe-fbt__list--woocommerce- WooCommerce loop list.sbe-fbt__dots,.sbe-fbt__dot- slider pagination.sbe-fbt__arrows,.sbe-fbt__arrow- slider arrows
State/variant classes:
.sbe-fbt--standard.sbe-fbt--slider.sbe-fbt--template-minimal.sbe-fbt--template-woocommerce_loop.sbe-fbt--columns-1to.sbe-fbt--columns-6