MBA
All docs
WooCommerce 8.0+PHP 8.1+HPOS-aware

WooCommerce quick start

Install the plugin, run your first mining job, drop the widget on a product page. ~10 minutes start to first recommendation.

Prerequisites

  • WordPress 6.4+ (tested up to 6.7)
  • WooCommerce 8.0+ (tested up to 9.4)
  • PHP 8.1, 8.2, or 8.3
  • MySQL 8.0+ or MariaDB 10.4+
  • WP-Cron firing (the default, only edit if your host says otherwise)
  • At least ~200 orders in your chosen window for meaningful patterns

1. Install

Two install paths:

  • Free tier: from the WordPress.org plugin directory (coming soon), search "Market Basket Analysis" and click Install. Activate from Plugins.
  • Pro: after purchase, download the plugin ZIP from your marketbasketanalysis.com account. Upload via Plugins, Add New, Upload Plugin and activate.

Or via WP-CLI:

wp plugin activate marketbasketanalysis

Activation creates the wp_mba_jobs, wp_mba_rules, wp_mba_opportunities, and wp_mba_api_keys tables via dbDelta, and schedules the hourly cron tick.

2. Run your first mining job

From the WP admin: WooCommerce → MBA Jobs Run Now. Default engine is fp_growth, default window is 90 days.

Or from the command line:

wp mba run-job --engine=fp_growth --days=90

Typical runtime: a few seconds per 10k orders. The job marks itself done in wp_mba_jobs with the emitted rule count.

3. Review your opportunities

WooCommerce → MBA Opportunities. Each row is a ranked bundle or cross-sell candidate with product chips for both sides of the rule, score, confidence%, and lift. Pin the ones you want to surface in the storefront widget; dismiss the ones you don't.

4. Drop the widget on a product page

Three options, all backed by the same template:

  1. Shortcode: paste [mba_fbt] into a product description, a Beaver Builder / Elementor / Bricks template, or anywhere else.
  2. Gutenberg block: inserter → search "MBA" → pick Frequently Bought Together. Configure heading + max items inline.
  3. Template tag (for custom theme files): mba_the_fbt(); (or echo mba_render_fbt();).

The widget hides itself entirely when no recommendations exist for the source product, so you can drop it everywhere without worrying about empty cards.

5. Customize styling

Two options:

  • CSS overrides, every block element exposes a BEM-style class (.mba-fbt,.mba-fbt__heading,.mba-fbt__item, etc.). Add overrides to your theme's CSS.
  • Template override, copy templates/fbt-widget.php from the plugin to <your-theme>/marketbasketanalysis/fbt-widget.php. Theme override always wins.

6. Schedule recurring mining

WooCommerce → MBA Settings. Toggle “Auto-run mining on schedule,” pick a cadence (1, 3, 7, 14, or 30 days), and a window. The hourly WP-Cron tick enqueues the job when the cadence is up.

Upgrading to Pro

Buy a Pro license at the pricing page. Paste the mba_pro_... key into MBA Settings → MBA Pro license. The plugin validates against our license server on save and lights up the Pro-only software features:

  • ai_catalog engine, produces recommendations from catalog alone, no orders required. Solves the cold-start problem.
  • AI-generated bundle copy for new bundles.
  • Public REST API + MCP server access, see the API quick start and MCP setup.

Configure your LLM provider key (for AI features)

Pro is software-only. The Pro license unlocks the AI-driven features, but every LLM call runs against your own provider key, your WordPress install talks to Anthropic or OpenAI directly. Your order data and catalog never flow through our servers, and you control your AI spend directly with the provider.

In the WP admin, go to WooCommerce → MBA Settings → AI:

  1. Pick a provider: Anthropic Claude (default) or OpenAI.
  2. Paste your API key (sk-ant-... for Anthropic, sk-... for OpenAI). Stored encrypted in wp_options.
  3. Save. The plugin pings the provider to verify the key and the chosen model. Bad key → AI features stay disabled until fixed; deterministic mining (FP-Growth, SQL pairs, HUI) is unaffected.

Same architecture as the Magento module, the WooCommerce plugin is BYO-key too. See the AI features deep dive for provider/model details, fallbacks, and cost-control knobs.

Troubleshooting

  • Empty Opportunities grid after job runs — check transactions_analyzed on the job row. If 0, no qualifying orders in the window. Lower min_support or widen the window.
  • Widget doesn't show up, verify the product has at least one opportunity in MBA Opportunities where the product is in the antecedent. Widget hides itself when there are no rules.
  • WP-Cron not firing, many hosts disable WP-Cron and rely on a server cron. See DISABLE_WP_CRON in wp-config.php.
  • Pro license “unknown” status, the license validation endpoint is unreachable. We serve the last-known-good for 7 days, then revert to free-tier behavior.

Next steps

Ready to turn your order data into revenue?

Install on your platform in under 10 minutes. Or book a consulting call and we'll do the launch for you.