Show products in the sidebar with the affiliate-toolkit widget

Use the affiliate-toolkit widget to show a product or a list in the sidebar or footer – optionally the main product of the page you are on.

The base plugin includes a widget that shows a product or a list in any widget area of your theme, such as the sidebar or the footer. A useful option: the widget can automatically show the main product of the post you are reading, so every review gets a matching box in the sidebar.

Prerequisite: a theme with widget areas. You find the widget under Appearance → Widgets as affiliate-toolkit widget ("Shows a product or a list"). In block-based themes without classic widget areas, use the affiliate-toolkit blocks instead – see affiliate-toolkit shortcodes: product boxes, lists and fields.

The settings form of the affiliate-toolkit widget with title, main product option, product, list, template, CSS classes, limit, content and random sorting.
The settings of the affiliate-toolkit widget.

Settings

FieldWhat it does
TitleHeading of the widget. If there is no product or list to show, the whole widget including the title is hidden.
Use main productOn a single post or page, the widget shows its main product instead of the selected one (see below).
ProductThe product to show. With "Use main product" it serves as the fallback.
ListThe list to show. Choose either a product or a list – if both are set, the product wins.
TemplateThe template for the output. Default is box.
Container CSS ClassYour own CSS classes for the container, for example to style the widget differently from boxes in the content.
Element CSS ClassYour own CSS classes for the elements. The widget always adds the class atkp-widget.
LimitMaximum number of products when a list is shown (default 10).
ContentText passed to the template. In Blade templates you read it with $parameters->get_content(), in classic templates with %content%.
Random list sortingShows the products of a list in random order on every page load.

Which product is the main product?

With Use main product switched on, the widget looks for the main product of the current page:

  • On a product page of affiliate-toolkit: the product itself.
  • On a WooCommerce product: the affiliate product linked to it.
  • On any other post or page: the product selected as "Main product" in the affiliate-toolkit box of the editor.

If the page has no main product, the widget falls back to the product selected in the widget, then to the list. If none of them is set, the widget is not shown at all.

A main list selected in a post is not used by the widget – only the main product.