| name | product-box-block |
| description | Convert a URL (from clipboard or user input) to an ACF Product Box Block. Fetches the page, extracts product details, and outputs WordPress block markup. Use when the user pastes a product URL, mentions "product box," "ACF product box," or wants to convert a product page to a Gutenberg block. |
| user_invocable | true |
ACF Product Box Block Generator
Convert product URLs to ACF Product Box block markup for WordPress. Fetch the page, extract details, generate the block comment, and copy to clipboard.
Workflow
- Get URL: From clipboard
{clipboard}, user message, or ask
- Fetch page: Use WebFetch or firecrawl to get product details
- Extract fields: Apply extraction rules below
- Generate block: Output ACF block comment markup
- Copy to clipboard:
echo '...' | pbcopy
Extraction Rules
Title
- Clean product name from page title or h1
- Remove brand clutter, ASIN codes, excessive keywords
- Improve wording for clarity
Image
- Best product image from
og:image or main product image
- Prefer high-resolution, clean product shots
Features
- Extract key specs/features from
<li> items or product bullet points
- Improve wording if needed for clarity
- 3-6 features is ideal
Prices
- Original price (strikethrough/was price)
- Discount percentage
- Current/sale price
- Price note (e.g., "Free shipping", "Prime eligible")
Badge
- Format: "SAVE X%" with color
#22c55e
- For free products: "FREE" with color
#22c55e
- Calculate from original vs current price if not explicit
Description
- Short one-line summary of the product
- Improve from page meta description or product summary
Button Rules
Amazon.com Products
Button 1 (Amazon US):
- URL: https://www.amazon.com/dp/{ASIN}/?tag=gtorg0f-20
- Style: "amazon"
- Icon: "cart"
- Text: "Check Price on Amazon"
Button 2 (Amazon India):
- URL: https://www.amazon.in/s?k={Product+Name+Keywords}&tag=gaurtiwa-21
- Style: "primary"
- Icon: "none"
- Class: "md-icon-external"
- Text: "Check on Amazon.in"
Non-Amazon Products
Button 1:
- URL: Product page URL (no affiliate tag unless one exists)
- Style: "primary"
- Icon: "none"
- Class: "md-icon-external"
- Text: "Check Price" or "Visit Website"
All Buttons
field_pb_cta_rel: "nofollow noopener sponsored"
ACF Block Format
CRITICAL: All field keys use the field_ prefix. Repeaters use nested row-N objects.
Standard (with image)
No Image Variation
Add "className":"is-style-no-image" to block attributes. Omit field_pb_image and field_pb_image_url.
Field Reference
| Field | Key | Type | Notes |
|---|
| Image ID | field_pb_image | string | Empty "" when using URL |
| Image URL | field_pb_image_url | string | Direct image URL |
| Badge Text | field_pb_badge_text | string | "SAVE X%" or "FREE" |
| Badge Color | field_pb_badge_color | string | Hex color, default #22c55e |
| Title | field_pb_title | string | Clean product name |
| Title URL | field_pb_title_url | string | Product page URL |
| Rating | field_pb_rating | string | e.g., "4.5" |
| Rating Count | field_pb_rating_count | string | e.g., "1,234 ratings" |
| Features | field_pb_features | repeater | row-N > field_pb_feature_text |
| Original Price | field_pb_original_price | string | e.g., "$99.99" |
| Discount | field_pb_discount_percent | string | e.g., "-15%" |
| Current Price | field_pb_current_price | string | e.g., "$84.99" |
| Price Note | field_pb_price_note | string | e.g., "Free shipping" |
| Description | field_pb_description | string | One-line summary |
| Buttons | field_pb_buttons | repeater | See button fields below |
Button Sub-fields
| Field | Key | Values |
|---|
| Text | field_pb_cta_text | Button label |
| URL | field_pb_cta_url | Full URL with affiliate tag |
| Style | field_pb_cta_style | "amazon", "primary", "secondary" |
| Icon | field_pb_cta_icon | "none", "cart", "external", "download" |
| Class | field_pb_cta_class | "", "md-icon-external", "md-icon-download" |
| Rel | field_pb_cta_rel | "nofollow noopener sponsored" |
Affiliate Tags
| Store | Tag | URL Pattern |
|---|
| Amazon.com | gtorg0f-20 | amazon.com/dp/{ASIN}/?tag=gtorg0f-20 |
| Amazon.in | gaurtiwa-21 | amazon.in/s?k={Keywords}&tag=gaurtiwa-21 |
Output
- Generate the block comment markup
- Copy to clipboard:
echo 'BLOCK_MARKUP' | pbcopy
- Show the user a summary of what was extracted