feat(wordpress): Add new Elementor widgets and dynamic selectors v1.6.0

New Widgets:
- Brand Grid: Display brands in a grid with product counts
- Category List: Show categories in grid/list/pills layouts
- Specials Grid: Display products on sale with discount badges

Enhanced Product Grid Widget:
- Dynamic category dropdown (fetches from API)
- Dynamic brand dropdown (fetches from API)
- "On Special Only" toggle filter

New Plugin Methods:
- fetch_categories() - Get categories from API
- fetch_brands() - Get brands from API
- fetch_specials() - Get products on sale
- get_category_options() - Cached options for Elementor
- get_brand_options() - Cached options for Elementor

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Kelly
2025-12-10 13:41:17 -07:00
parent 2d035c46cf
commit 74957a9ec5
7 changed files with 1052 additions and 9 deletions

View File

@@ -312,3 +312,184 @@
border-radius: 4px;
border-left: 4px solid #c62828;
}
/* ========================================
Brand Grid Widget
======================================== */
.cannaiq-brand-grid {
display: grid;
gap: 20px;
margin: 20px 0;
}
.cannaiq-brand-card {
background: #fff;
border-radius: 8px;
padding: 20px;
text-align: center;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
transition: transform 0.2s, box-shadow 0.2s;
}
.cannaiq-brand-card:hover {
transform: translateY(-4px);
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}
.cannaiq-brand-name {
font-size: 16px;
font-weight: 600;
margin: 0 0 8px 0;
color: #333;
}
.cannaiq-brand-count {
font-size: 13px;
color: #666;
}
/* ========================================
Category List Widget
======================================== */
.cannaiq-category-grid {
display: grid;
gap: 16px;
margin: 20px 0;
}
.cannaiq-category-list {
display: flex;
flex-direction: column;
gap: 8px;
margin: 20px 0;
}
.cannaiq-category-pills {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin: 20px 0;
}
.cannaiq-category-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 16px;
background: #fff;
border-radius: 8px;
text-decoration: none;
color: #333;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
transition: background 0.2s, transform 0.2s;
}
.cannaiq-category-item:hover {
background: #f3f4f6;
transform: translateX(4px);
}
.cannaiq-category-pills-item {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 8px 16px;
background: #f3f4f6;
border-radius: 20px;
text-decoration: none;
color: #333;
font-size: 14px;
transition: background 0.2s;
}
.cannaiq-category-pills-item:hover {
background: #e5e7eb;
}
.cannaiq-category-name {
font-weight: 500;
}
.cannaiq-category-count {
font-size: 13px;
color: #666;
}
/* ========================================
Specials/Deals Grid Widget
======================================== */
.cannaiq-specials-grid {
display: grid;
gap: 24px;
margin: 20px 0;
}
.cannaiq-special-card {
background: #fff;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
transition: transform 0.2s, box-shadow 0.2s;
position: relative;
}
.cannaiq-special-card:hover {
transform: translateY(-4px);
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}
.cannaiq-discount-badge {
position: absolute;
top: 12px;
right: 12px;
background: #ef4444;
color: #fff;
font-size: 13px;
font-weight: 700;
padding: 4px 10px;
border-radius: 4px;
z-index: 1;
}
.cannaiq-special-image {
width: 100%;
aspect-ratio: 1;
overflow: hidden;
background: #f5f5f5;
}
.cannaiq-special-image img {
width: 100%;
height: 100%;
object-fit: cover;
}
.cannaiq-special-content {
padding: 16px;
}
.cannaiq-special-title {
font-size: 16px;
font-weight: 600;
margin: 0 0 8px 0;
color: #333;
line-height: 1.4;
}
.cannaiq-special-price {
display: flex;
align-items: center;
gap: 8px;
margin-top: 12px;
}
.cannaiq-special-price .cannaiq-price-sale {
font-size: 20px;
font-weight: 700;
color: #16a34a;
}
.cannaiq-special-price .cannaiq-price-regular {
font-size: 14px;
color: #999;
}