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
- Text Search
- Dual Search
const textsearch = window.yesplz.textsearch();
textsearch.addWidget(
textsearch.widgets.SaleCheckbox({
container: "#saleonly-checkbox",
})
);
const dualsearch = window.yesplz.dualsearch();
dualsearch.addWidget(
dualsearch.widgets.SaleCheckbox({
container: "#saleonly-checkbox",
})
);
Parameters
| Name | Type | Description |
|---|---|---|
container | string | CSS 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;
}