Products
Overview
Section titled “Overview”The main products collection block that displays a grid of products with optional filtering, sorting, and pagination. This is the core block for product listing pages, category pages, and search results. It serves as a container for child blocks like filters, search, sorting controls, and the product grid itself.
Requirements
Section titled “Requirements”- Parent block: None (top-level block)
- BigCommerce data: Product catalog synced from BigCommerce
Configuration
Section titled “Configuration”Attributes
Section titled “Attributes”- settingsId (string) - Settings configuration identifier
- Default:
""
- Default:
- align (string) - Block alignment
- Default:
"wide"
- Default:
- dropzones (object) - Dropzone configuration for child blocks
- Default:
{}
- Default:
- fullPayload (object) - Complete products data payload
- Default:
{} - Source:
attribute
- Default:
- isFetching (boolean) - Loading state indicator
- Default:
false - Source:
attribute
- Default:
Block Support
Section titled “Block Support”- HTML editing: Not supported
- Alignment: Supported (default: wide)
Context
Section titled “Context”The Products block uses context from parent blocks:
commerce-connect/parentCategory- Category filter from parent block
The Products block provides context to child blocks:
commerce-connect/productsDropzones- Available dropzone positionscommerce-connect/productsFullPayload- Complete products datacommerce-connect/productsIsFetching- Loading state
Placement
Section titled “Placement”This block can be placed on any page or template where you want to display products. Common uses include:
- Product listing pages (e.g.,
/shop/) - Category pages
- Search results pages
- Homepage featured products sections
Common Patterns
Section titled “Common Patterns”From the demo video script, the Products block is highly configurable:
[Products Block] Products Search Box Products Filters (category, attributes) Products Sort Control → Products Grid ← (product cards) PaginationGlobal settings from Commerce Connect plugin (Products tab):
- Products per page (default page size)
- Products per row on desktop (e.g., 3 columns)
- Products per row on mobile (e.g., 1 column)
- Currency display format (symbol, code, narrow, spelled out)
- Default product ordering (newest, price, name, etc.)
- Product link behavior (same tab vs. new window)
These global defaults can be overridden at the block level for specific instances.
Technical Details
Section titled “Technical Details”CSS Classes
Section titled “CSS Classes”commerce-connect-block- Base block classproducts-blocks- Specific block identifieralignwide- Default alignment classecom-root- Commerce Connect root element
Data Attributes
Section titled “Data Attributes”The block includes several data attributes for JavaScript functionality:
data-commerce-connect-block- Block type (productsorsingleProduct)data-commerce-connect-id- Unique block instance IDdata-commerce-connect-settings- Settings JSONdata-commerce-connect-payload- Initial products data payloaddata-commerce-connect-filters- Available filters JSON
CSS Variables
Section titled “CSS Variables”The block supports CSS variable overrides for styling. Global overrides from plugin settings are merged with block-specific settings.
Data Source
Section titled “Data Source”The Products block retrieves product data from WordPress® (synced from BigCommerce) using the ProductsController:
For regular product listings:
- Queries WordPress® product post type
- Applies filters (category, search, attributes)
- Applies sorting (order by, direction)
- Applies pagination (page size, current page)
- Returns products with metadata (title, price, images, etc.)
For single product view:
- Detects
?product=query parameter - Loads specific product by slug
- Returns single product data
For filtered/searched results:
- Processes URL parameters (category, search, variant attributes)
- Retrieves available filters based on current context
- Returns filtered products and available filter options
Product data is synced from BigCommerce and stored in WordPress®. The get_items() method queries WordPress® for fast performance, while maintaining BigCommerce as the source of truth.
Available Filters
Section titled “Available Filters”The block calculates available filters based on:
- Current category (if any)
- Current search query (if any)
- Product variations and attributes
Filters are passed to child blocks (Products Filters block) via context.
Troubleshooting
Section titled “Troubleshooting”Products not displaying
Section titled “Products not displaying”- Verify products are synced from BigCommerce (check Commerce Connect > Products)
- Ensure products are published in WordPress®
- Check that BigCommerce connection is active
- Review browser console for JavaScript errors
No products message shows incorrectly
Section titled “No products message shows incorrectly”The block displays “There are no published products in your store” only when:
- No products have
publishstatus in WordPress® - No search query is active
- No category filter is active
- No pagination is active
- Not viewing a single product
If this message appears incorrectly, check product publish status in WordPress® admin.
Search returns no results
Section titled “Search returns no results”The block displays “No results found for [search term]” when:
- Search query is present
- No products match the search
- Products response is empty
To troubleshoot:
- Verify product titles/descriptions contain the search term
- Check that product data is fully synced from BigCommerce
- Test search in WordPress® admin to confirm products are searchable
Filters not working
Section titled “Filters not working”- Verify Products Filters block is added as a child block
- Check that available filters are being calculated correctly
- Review URL parameters for filter selections
- Ensure filter data is passed to child blocks via context
Pagination not working
Section titled “Pagination not working”- Check page size settings (global and block-level)
- Verify total product count is correct
- Review pagination controls implementation
- Ensure
pageparameter is being processed correctly
Category filtering not working
Section titled “Category filtering not working”- Verify category data is synced from BigCommerce
- Check that products are assigned to categories in BigCommerce
- Review
parentCategorycontext from parent blocks - Ensure category selection is being applied to query
Performance issues with large catalogs
Section titled “Performance issues with large catalogs”- Products are queried from WordPress® (not BigCommerce API) for performance
- Consider limiting products per page for large catalogs
- Use category filtering to reduce query scope
- Implement caching if needed for frequently accessed pages