Skip to content

Configuration

Pair stores its settings in the pair_settings option. The settings page is available under WooCommerce → Pair recommendations and requires the manage_woocommerce capability.

  • Enable recommendations (enabled), the master switch. When off, Pair renders nothing.
  • On the single product page (show_on_single), renders recommendations after the product summary.
  • Under the cart (show_on_cart), renders recommendations below the cart.
  • Show recently viewed products (show_recently_viewed), enables the separate recently viewed block.
  • Recently viewed on product pages (recently_on_single), renders recently viewed products on product pages.
  • Recently viewed on the cart (recently_on_cart), renders recently viewed products on the cart.
  • Only recommend products that are in stock (in_stock_only), excludes out-of-stock products from the results.
  • Product-page strategy (single_strategy), defaults to related.
  • Cart strategy (cart_strategy), defaults to related.

Accepted values are:

ValueMeaning
relatedProducts from the same categories, ordered by popularity.
tagsProducts sharing product tags.
bestsellersBest-selling products.
newestMost recently published products.
recentlyProducts the shopper recently viewed.

Every strategy falls back to recent products if there are not enough matches.

  • Number of products (count), clamped from 1 to 12.
  • Columns (columns), clamped from 1 to 6.

The grid is rendered through WooCommerce’s product loop template, so it inherits the active theme’s product card markup.

  • Product-page heading (single_heading), shown above product-page recommendations.
  • Cart heading (cart_heading), shown above cart recommendations.
  • Recently viewed heading (recently_heading), shown above recently viewed products.

Leave a heading blank to use the packaged default.

[pair_recommendations]
[pair_recommendations strategy="bestsellers" count="4" columns="4"]
[pair_recently_viewed count="4" columns="4"]

Attributes:

AttributeRangeDescription
strategyrelated, tags, bestsellers, newest, recentlyOverrides the configured recommendation strategy.
count1-12Overrides the configured product count for this block.
columns1-6Overrides the configured column count for this block.
headingtextOverrides the block heading.

On a product page, [pair_recommendations] uses the current product. Outside a product page it uses the cart contents. [pair_recently_viewed] always uses the shopper’s recently viewed product IDs.

Pair stores only:

  • pair_settings
  • pair_db_version

The uninstall routine removes both options. It does not create custom database tables.