Skip to main content

Sale Checkbox Widget

The Sale Checkbox Widget allows users to filter search results to show only items that are on sale. This widget adds a checkbox to your search interface, enabling users to toggle between viewing all items and only sale items.

Example Usage

const textsearch = window.yesplz.textsearch();

textsearch.addWidget(
textsearch.widgets.SaleCheckbox({
container: "#saleonly-checkbox",
})
);

Parameters

NameTypeDescription
containerstringCSS selector for the HTML element where the widget will be rendered.

Styling

You can style the checkbox and its label using CSS to match your site's design.

For example:

.yesplz-sale-checkbox {
margin: 10px 0;
}

.yesplz-sale-checkbox label {
display: flex;
align-items: center;
cursor: pointer;
}

.yesplz-sale-checkbox input[type="checkbox"] {
margin-right: 5px;
}