Before you start
Widgets show only public products, so the product must have the Include in product catalog option selected on the Johku Sales Channels tab. In a Category widget, the category must also be either public or allowed to be displayed in widgets; see Category widget options. The differences between the widget types are described in Johku widgets and widget types.
Create a widget
- Open Settings → Storefront → Widgets.
- Click New widget.
- Give the widget a name. The name is only for your own use and is not shown to customers.
- Select the widget's type from the drop-down menu and click OK. You can switch between the Product and Product card types afterwards too.
- Connect content to the widget: click Select product or Select category, select the one you want from the drop-down menu and click OK. Only one product or category can be connected to one widget. No product is connected to a Search or Basket widget.
- Select additional settings under Properties if you want. The settings vary by type; see below.
- Save. The widget's Embed code is created automatically when you save.
Check the widget in the preview
When you save, the Embeddable widget preview at the bottom of the widget's settings is updated. It shows what the widget looks like and what it displays. The preview takes into account the CSS styles set for the widget, but not your website's own styles. Changes made to the product update in the widget and the preview automatically.
Product and Product card widget options
Disable shopping basket takes the customer straight to the checkout page after the product is selected, so no other products can be added to the order. Hide product name hides the name from the widget, and it is available only in the Product type. In the CSS field, you can enter your own style; see Style a widget with CSS. In the additional settings, you can also restrict the embed code to work only at the addresses you list.
Category widget options
The Category widget has Disable shopping basket and Hide category name available. In addition, the category's own settings affect the widget:
Visibility: for the category, select either Include in product catalog or the setting Allow to display in widgets on the Johku Sales Channels tab, in which case the category can be shown in a widget without publishing it on the storefront. The category's products must still have the Include in product catalog option selected. If any of these is missing, an exclamation mark is shown next to the widget on the Widgets page, and from there you can publish the products or change the category's setting.
View: the view selection on the category's Products tab also determines how the widget is presented. Normal lists the products as product cards, Showtimes shows the showtimes of events by date, and Availability search and Full-text search bring the search before the product list.
Search widget options
The Search widget requires that the search features are enabled in the shop and that the products are set to appear in the availability search; see Enable search on your storefront. The following can be selected under Properties:
- Hide title: the title set for the widget is hidden.
- Hide full-text search: the widget can't be searched by free text, only by time.
- Disable shopping basket: a product clicked in the search results opens straight on the checkout page.
- Show tags: the sales channel's tags are shown as options that filter the search.
- Show recommended results: the products of the recommended category defined in the search settings are shown in the widget even before any search selections are made.
- Search in Storefront: the search results are shown on the Johku storefront instead of in the widget.
- Open search results in a new window: the results are opened on the storefront in a new browser tab. Available only together with the Search in Storefront setting.
Result
After saving, the widget's settings show the widget's own embed code and the Embeddable widget preview. The next stage is to deliver the embed code and Johku's general embed script to your website's administrator; see Add a widget to your website.
If the preview shows nothing
The preview is empty. No product or category has been selected for the widget, or the selected content is not public. Check the product's Include in product catalog option and the category's visibility setting. Other troubleshooting situations are collected in The widget doesn't show on your website.