Gift guide by budget in WordPress
A Christmas gift guide filtered by budget and theme, with the number of ideas announced and an empty state offering to show everything again.
Here is an excerpt of this component's code in WordPress. The full code is free for members, ready to copy into your project.
This component also comes in
The code in WordPress
<?php
/**
* Plugin Name: Forge, Guide des cadeaux par budget
* Description: Un guide des cadeaux de Noël filtrable par budget et par thème, avec le nombre d’idées annoncé et un état vide qui propose de tout réafficher. Ajoute la composition « Guide des cadeaux par budget » à l'éditeur de blocs.
* Version: 1.0.0
* Requires at least: 6.6
* Requires PHP: 8.1
* Author: Forge
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: forge-guide-cadeaux-budget
*<!-- wp:html -->
<section class="gcb" data-gcb aria-labelledby="gcb-titre">
<p class="gcb-eyebrow">Comptoir des Alpes · artisanat de Savoie</p>
<h2 class="gcb-title" id="gcb-titre">Idées cadeaux pour tous les budgets</h2>
<form class="gcb-filters" data-gcb-form aria-label="Filtrer les idées cadeaux">
<fieldset class="gcb-set">
<legend class="gcb-legend">Budget</legend>
<label class="gcb-chip"><input class="gcb-radio" type="radio" name="gcb-budget" value="tous" checked><span class="gcb-chip-text">Tous les budgets</span></label>
<label class="gcb-chip"><input class="gcb-radio" type="radio" name="gcb-budget" value="0-2000"><span class="gcb-chip-text">Moins de 20 €</span></label>
<label class="gcb-chip"><input class="gcb-radio" type="radio" name="gcb-budget" value="2000-5000"><span class="gcb-chip-text">20 à 50 €</span></label>
<label class="gcb-chip"><input class="gcb-radio" type="radio" name="gcb-budget" value="5000-"><span class="gcb-chip-text">Plus de 50 €</span></label>
</fieldset>(() => {
if (!document.querySelector(".gcb")) return;
document.querySelectorAll("[data-gcb]").forEach((root) => {
const on = (el, type, fn) => el.addEventListener(type, fn);
const form = root.querySelector("[data-gcb-form]");
const gifts = [...root.querySelectorAll("[data-gcb-gift]")];
const count = root.querySelector("[data-gcb-count]");
const empty = root.querySelector("[data-gcb-empty]");
const apply = () => {
const data = new FormData(form);
const budget = String(data.get("gcb-budget"));:root {
--gcb-card: #ffffff;
--gcb-text: #1d2433;
--gcb-muted: #4f586b;
--gcb-line: #dfe3ec;
--gcb-soft: #f3f5f9;
--gcb-accent: #b91c1c;
--gcb-accent-text: #ffffff;
--demo-guide-cadeaux-budget-bg: #eceff5;
--demo-guide-cadeaux-budget-text: #1d2433;
}
Free component: copy it freely, including for commercial projects.
Other e-commerce components in WordPress
E-commerce components in WordPress
A limited-time offer bar: countdown to a fixed date, one-click copyable promo code and a fallback message once the offer is over.
- Tailwind
- React
- CSS
- WordPress

A sales card showing the discount that grows with the cart amount (-10% from €50, -15% from €100…) with a progress bar towards the next tier.
- Tailwind
- React
- CSS
- WordPress

The last order dates for delivery before Christmas, per shipping method, with the days left worked out from the visitor’s date.
- Tailwind
- React
- CSS
- WordPress

A cart that shows live how much is left to add for free shipping, with a progress bar and recalculated totals.
- Tailwind
- React
- CSS
- WordPress

A colour and size picker for a product page: the visual, price and stock follow the choice, and sold-out sizes are disabled.
- Tailwind
- React
- CSS
- WordPress

Wishlist
FreeA wishlist for an online shop: add from product cards, a summary with total and removal, remembered in the browser.
- Tailwind
- React
- CSS
- WordPress