Repository navigation
Blocks Product Showcase Hero
Block name: designsetgo/product-showcase-hero
Category: DesignSetGo
Keywords: product, showcase, hero, woocommerce, shop, ecommerce
Requires WooCommerce. This block will not render on the frontend (outputs nothing) if WooCommerce is not active.
Added in 2.1.0.
The Product Showcase Hero block renders a full-width two-column hero section featuring a single WooCommerce product. The product image fills one column edge-to-edge; the other column displays the product name, price, star rating, stock status, optional short description, and an add-to-cart button (including variation selectors for variable products).
The block supports two product source modes: Manual (you pick a specific product by searching) and Current (the block reads the product from page context, making it suitable for single-product templates in the Site Editor). In Current mode the editor shows a live sample preview using the most recently published product.
Key Features:
- Manual or context-driven product selection
- Media position: product image left or right (also togglable from the toolbar)
- Configurable minimum height with unit picker
- Focal point picker for the product image
- Content vertical alignment (top, center, bottom)
- Image size selector (medium, large, full)
- Individual toggles for price, rating, stock status, sale badge, short description, add-to-cart, and variation selectors
- Add-to-cart output uses
woocommerce_template_single_add_to_cart()for variable products andwoocommerce_template_loop_add_to_cart()for simple products, inheriting WooCommerce's full cart and variation logic - Server-rendered via
render.php— always reflects live product data - Full Block Supports: color, text, gradients, link, margin, block gap, typography, border, shadow, anchor
| Attribute | Type | Default | Description |
|---|---|---|---|
align |
string | "full" |
Always full width. |
productSource |
string | "manual" |
manual (specific product) or current (page context). |
productId |
number | 0 |
WooCommerce product ID. Used when productSource is manual. 0 triggers the setup placeholder. |
layout |
string | "media-left" |
Image position: media-left or media-right. |
imageSize |
string | "large" |
WordPress image size: medium, large, or full. |
showPrice |
boolean | true |
Whether to display the product price. |
showRating |
boolean | true |
Whether to display the star rating (hidden automatically when average_rating is 0). |
showStockStatus |
boolean | true |
Whether to display "In stock" or "Out of stock". |
showSaleBadge |
boolean | true |
Whether to show a "Sale!" badge when the product is on sale. |
showShortDescription |
boolean | false |
Whether to display the product's short description. |
showAddToCart |
boolean | true |
Whether to render the add-to-cart form. |
showVariations |
boolean | true |
When true and the product is variable, uses the full variation selector; otherwise uses the simple loop button. |
minHeight |
string | "500px" |
CSS min-height of the block. |
mediaFocalPoint |
object | {x:0.5, y:0.5} |
Focal point for object-position on the product image. |
contentVerticalAlignment |
string | "center" |
Vertical alignment of the content column: top, center, or bottom. |
All controls live in a single Settings panel with per-control reset and a global "Reset all" button.
- Product — Search field for Manual mode. Typing opens a product picker that queries the WC Store API. After a product is selected, shows the product name with "Replace Product" and "Use Current Product Instead" buttons.
-
Use Current Product / Switch to Manual Selection — Toggles between
productSource: "current"andproductSource: "manual".
- Show Price — Toggle (default on).
-
Show Rating — Toggle (default on). Rating is only visible on the frontend when
average_rating > 0. - Show Stock Status — Toggle (default on). Displays "In stock" or "Out of stock".
-
Show Sale Badge — Toggle (default on). Shows a "Sale!" badge when
$product->is_on_sale()returns true. - Show Short Description — Toggle (default off).
- Show Add to Cart — Toggle (default on).
- Show Variations — Toggle (default on). When on and the product is variable, the full variation form renders. When off, a simple loop add-to-cart button renders instead.
- Image Size — Select: Medium, Large (default), Full.
- Media Position — Select: Left (default) or Right. Also togglable from the toolbar's "Flip Layout" button.
- Content Vertical Alignment — Select: Top, Center (default), Bottom.
-
Min Height — UnitControl (px, vh, vw, em, rem). Default
500px. - Focal Point — FocalPointPicker (visible once a product with an image is loaded in the editor).
{
"productSource": "manual",
"productId": 42,
"layout": "media-right",
"showShortDescription": true,
"minHeight": "600px"
}Set productSource to current (click "Use Current Product" in the inspector). Place the block in a single-product block template (single-product.html). On each product page the block resolves the displayed product automatically.
{
"productSource": "current",
"layout": "media-left",
"showVariations": true
}The block is server-rendered by render.php. On every page load it:
- Resolves the product: in
currentmode it reads$GLOBALS['product']or falls back toget_the_ID(); inmanualmode it usesproductId. - Returns an empty string if the product is not found, not published, or password-protected (password-protected posts return the password form).
- Resolves the product image via
$product->get_image_id()and callswp_get_attachment_image()withloading="eager"andfetchpriority="high"since this is a hero. - Renders a sale badge if
$product->is_on_sale()andshowSaleBadgeis true. - Outputs the price via
$product->get_price_html(), rating viawc_get_rating_html(), and stock status as a string. - Renders the add-to-cart form: variable products use
woocommerce_template_single_add_to_cart()(includes the variation dropdown and swatches); all other types usewoocommerce_template_loop_add_to_cart(). The button element getswp-block-button__link wp-element-buttonclasses so it inheritstheme.jsonbutton styles. - Sets global
$postand$GLOBALS['product']for WooCommerce template functions, then restores the originals after rendering to prevent side-effects in surrounding blocks.
- The product image uses
loading="eager"andfetchpriority="high"as appropriate for a primary hero image, avoiding lazy-load delay on above-the-fold content. - Star rating output is provided by WooCommerce's
wc_get_rating_html(), which includes screen-reader text. - Stock status is rendered as visible text in a
<div>— no ARIA roles beyond the standard document flow are needed. - The add-to-cart form inherits WooCommerce's built-in accessibility (labels, focus management, ARIA live regions for variation selection).
- Content vertical alignment and focal point controls do not affect the DOM order — content source order remains: title, price, rating, stock, description, actions.
-
Product Categories Grid (
designsetgo/product-categories-grid) — Use to display a grid of product categories rather than a single product. Also requires WooCommerce. -
Fifty Fifty (
designsetgo/fifty-fifty) — Similar two-column split layout for non-product content with a static media library image. -
Dynamic Image (
designsetgo/dynamic-image) — For embedding a per-post resolved image (including featured images from product posts) in a custom layout.
DesignSetGo v2.1.0+ | WordPress 6.4+ | WooCommerce required
Auto-generated from
docs/blocks/PRODUCT-SHOWCASE-HERO.md. To update, edit the source file and changes will sync on next push to main.
- Accordion
- Advanced Heading
- Blobs
- Breadcrumbs
- Card
- Chart
- Comparison Table
- Countdown Timer
- Counter Group
- Divider
- Dynamic Image
- Fifty Fifty
- Flip Card
- Form Builder
- Grid
- Hotspot
- Icon
- Icon Button
- Icon List
- Image Accordion
- Map
- Modal
- Modal Api Reference
- Modal Auto Triggers
- Modal Fse Compatibility
- Modal Gallery Navigation
- Modal Trigger
- Pill
- Product Categories Grid
- Product Showcase Hero
- Progress Bar
- Query
- Query Filter
- Query Group Header
- Query No Results
- Query Pagination
- Query Results
- Row
- Scroll Accordion
- Scroll Marquee
- Scroll Slides
- Section
- Section Divider
- Slider
- Star Rating
- Sticky Sections
- Table Of Contents
- Tabs
- Text Path
- Timeline
- Background Video
- Block Animations
- Clickable Group
- Conditional Visibility
- Custom Css
- Draft Mode
- Dynamic Tags
- Expanding Background
- Grid Mobile Order
- Grid Span
- Hover Effects
- Max Width
- Responsive Visibility
- Reveal Control
- Scroll Parallax
- Sticky Header
- Style Binding
- Svg Patterns
- Text Alignment Inheritance
- Text Reveal
- Abilities Api
- Abilities Api Guide
- Block Bindings
- Draft Mode Api
- Form Webhooks
- Generation Contract
- Interactive Blocks
- Layout Flexibility
- Markdown Content Negotiation
- Rest Api Reference
- Wp Cli Reference
- Ai Assisted Development
- Best Practices Summary
- Block Controls Organization
- Block Development Best Practices Comprehensive
- Block Exclusion Guide
- Deploying To Wordpress Org
- Design System
- 2026 04 16 Blocks Editor Ux Design
- 2026 04 17 Theme 3 Inspector Ia
- 2026 04 21 Query Block Onboarding
- 2026 04 21 Query Capable Layout Blocks Design
- 2026 04 27 Block Roadmap Ideas
- 2026 07 01 Shape Divider Theme Inheritance
- 2026 07 02 Icon Block Dynamic Render Pilot
- 2026 07 06 Section Divider Block Design
- 2026 07 06 Section Style Variations Fse Design
- 2026 07 06 Section Styles Editor Preview
- 2026 07 07 Row Grid Overlay Hover Parity Design
- 2026 07 21 Conditional And Dup Label Sourcing
- 2026 07 23 Theme Block Type Animation Defaults
- 2026 08 16 Chart Block
- 2026 08 16 Greenshift Gap Roadmap
- 2026 08 17 Woocommerce Surface
- 2026 08 24 Loop Carousel
- 2026 08 24 Star Rating Block
- 2026 09 17 Abilities Drift Prevention
- 2026 09 17 Abilities Drift Prevention Implementation
- 2026 09 29 Existing User Regression Fixes
- 2026 09 29 Release Preflight Fixes
- Readme
- 2026 07 02 Block Authorability Audit
- 2026 09 29 Regression Fixes
- 2026 09 29 Release 2.9.0
- 2026 09 29 Release Fixes
- 2026 10 19 Bug Hunt
- 2026 10 20 Bug Hunt Round 2