Products Pagination Block
Navigation controls for browsing through multiple pages of product results.
What It Does
Section titled “What It Does”The Products Pagination block adds page numbers and previous/next buttons to navigate through large product listings. It automatically appears when there are more products than the per-page limit.
Use cases:
- Product listing pages
- Search results with many matches
- Collection pages with large catalogs
- Shop pages
How to Add It
Section titled “How to Add It”Requirements: Must be used inside a Products block.
- Add a Products block to your page
- Click + inside the Products block
- Search for “Products Pagination” or look in the Commerce category
- Click to insert
Block Settings
Section titled “Block Settings”Display Options
Section titled “Display Options”Pagination style:
- Numbers - Page numbers with prev/next (default)
- Prev/Next only - Just arrow buttons
- Load More button - Ajax load more products
- Infinite scroll - Auto-load on scroll
Show/hide:
- First page button
- Last page button
- Previous button
- Next button
- Page numbers
- Dots for skipped pages (e.g., “1 2 3 … 10”)
Number Display
Section titled “Number Display”Page numbers shown:
- 3 (compact - shows 1 2 3 … 10)
- 5 (default - shows 1 2 3 4 5 … 10)
- 7 (expanded - shows 1 2 3 4 5 6 7 … 10)
- All (shows every page number)
Positioning
Section titled “Positioning”Dropzone: Place in specific layout positions:
- Below products (default)
- Above products
- Both above and below
Alignment
Section titled “Alignment”- Left
- Center (default)
- Right
Customization
Section titled “Customization”Styling Pagination
Section titled “Styling Pagination”/* Pagination container */.wpe-commerce-products-pagination { display: flex; justify-content: center; gap: 0.5rem; margin: 2rem 0;}
/* Page number buttons */.wpe-commerce-products-pagination button,.wpe-commerce-products-pagination a { padding: 0.5rem 0.75rem; border: 1px solid #ddd; border-radius: 4px; background: white; color: #333; text-decoration: none; cursor: pointer;}
/* Hover state */.wpe-commerce-products-pagination button:hover { background: #f5f5f5; border-color: #0073aa;}
/* Active/current page */.wpe-commerce-products-pagination .active { background: #0073aa; color: white; border-color: #0073aa; font-weight: 600;}
/* Disabled state */.wpe-commerce-products-pagination button:disabled { opacity: 0.5; cursor: not-allowed;}
/* Dots for skipped pages */.wpe-commerce-products-pagination .dots { padding: 0.5rem; color: #999;}Mobile Responsive
Section titled “Mobile Responsive”/* Compact pagination on mobile */@media (max-width: 768px) { .wpe-commerce-products-pagination { gap: 0.25rem; }
/* Hide page numbers, show only prev/next */ .wpe-commerce-products-pagination .page-number { display: none; }
.wpe-commerce-products-pagination .prev, .wpe-commerce-products-pagination .next, .wpe-commerce-products-pagination .active { display: inline-block; }}Load More Button Style
Section titled “Load More Button Style”/* Load More button */.wpe-commerce-products-pagination .load-more { padding: 1rem 2rem; background: #0073aa; color: white; border: none; border-radius: 4px; font-size: 1rem; font-weight: 600; cursor: pointer; transition: background 0.2s;}
.wpe-commerce-products-pagination .load-more:hover { background: #005a87;}
/* Loading state */.wpe-commerce-products-pagination .load-more.loading { opacity: 0.6; cursor: wait;}Common Patterns
Section titled “Common Patterns”Standard Numbered Pagination
Section titled “Standard Numbered Pagination”Below products, centered:
- Style: Numbers with prev/next
- Page numbers shown: 5
- Position: Below products
- Alignment: Center
Compact Mobile Pagination
Section titled “Compact Mobile Pagination”Prev/next only on small screens:
- Show: Previous, Next, Current page only
- Hide: All other page numbers
- Alignment: Center
Load More Pattern
Section titled “Load More Pattern”For infinite scroll experience:
- Style: Load More button
- Position: Below products
- Shows: “Load More Products” or “Loading…”
Dual Pagination
Section titled “Dual Pagination”Above and below products:
- Add two pagination blocks
- One dropzone: Above products
- One dropzone: Below products
- Same settings on both for consistency
How It Works
Section titled “How It Works”Page Calculation
Section titled “Page Calculation”Total products: 48Per page: 12Total pages: 48 ÷ 12 = 4 pages
Page 1: Products 1-12Page 2: Products 13-24Page 3: Products 25-36Page 4: Products 37-48URL Parameters
Section titled “URL Parameters”Pagination updates URL for bookmarkability:
/shop/ # Page 1 (default)/shop/?page=2 # Page 2/shop/?page=3&sort=price # Page 3 with sortingState Preservation
Section titled “State Preservation”When paginating:
- Current filters are preserved
- Current sort order is preserved
- Search query is preserved
- Only page number changes
Load More Behavior
Section titled “Load More Behavior”Load More button:
- Click “Load More”
- JavaScript fetches next page via GraphQL
- New products append to existing grid
- Button updates to show next page available
- When last page reached, button hides
Infinite scroll:
- User scrolls to bottom of products
- Intersection Observer detects viewport position
- Automatically fetches next page
- Appends products seamlessly
- Continues until all pages loaded
Block Context
Section titled “Block Context”Must be used inside:
- Products block
Does not receive props from Products but shares parent state for:
- Total product count
- Current page
- Per-page limit
- Filters/sort applied
Does not work:
- Standalone (requires parent Products block)
- Inside Single Product block
- Outside Products block
Technical Details
Section titled “Technical Details”Block name: wpe-commerce/products-pagination
Attributes:
dropzone(string) - Layout positionsettingsId(string) - Settings referencestyle(string) - Pagination style (numbers, prevnext, loadmore, infinite)numbersShown(number) - How many page numbers to display
Supports:
- Alignment
- Custom CSS classes
- Multiple instances (for above + below placement)
Does not support:
- Typography controls
- Color controls (use CSS)
- Background controls
Troubleshooting
Section titled “Troubleshooting”Pagination not showing
Section titled “Pagination not showing”Check:
- Enough products to require pagination (more than per-page limit)
- Block is inside Products block
- Products block has products loaded
- Per-page setting is configured
Fix:
- If you have 12 products and per-page is 12: No pagination needed (only 1 page)
- If you have 50 products and per-page is 12: Pagination should show (5 pages)
Page numbers incorrect
Section titled “Page numbers incorrect”Check:
- Products block per-page setting
- Total product count
- Filters applied (may reduce total)
Debug calculation:
Total products shown: [X]Per page setting: [Y]Expected pages: [X ÷ Y] (rounded up)Load More not loading
Section titled “Load More not loading”Check:
- Browser console for JavaScript errors
- Network tab for failed GraphQL requests
- BigCommerce API connection
- Rate limiting (too many requests)
Fix:
- Hard refresh page
- Check if Products block is fetching data
- Verify JavaScript is not blocked
- Look for console errors
URL not updating
Section titled “URL not updating”Check:
- JavaScript enabled
- Browser history API supported
- No conflicting scripts
Expected behavior:
- URL should update:
/shop/?page=2 - Browser back button should work
- Bookmarking should preserve page
Infinite scroll not triggering
Section titled “Infinite scroll not triggering”Check:
- Intersection Observer supported (modern browsers)
- Products grid has enough height to scroll
- Scroll container is correct
- No JavaScript errors
Fix:
// Check if Intersection Observer existsif ('IntersectionObserver' in window) { console.log('Infinite scroll supported');} else { console.log('Infinite scroll not supported - use Load More instead');}Related Blocks
Section titled “Related Blocks”- Products - Parent container block
- Products Grid - Display paginated products
- Products Counter - Show “Showing X-Y of Z”
- Products Per Page - Control items per page