Skip to main content
RapidDev - Software Development Agency
bubble-tutorial

How to Build a Detailed Product Page in Bubble

A detailed product page in Bubble displays a product's images in a gallery with zoom, variant selection for size and color, dynamic pricing, an add-to-cart button, customer reviews, and related product suggestions. You build it using a page that receives a Product via URL parameter, with Repeating Groups for images and reviews, conditional displays for variants, and workflow actions for cart management.

What you'll learn

  • How to build an image gallery with thumbnail navigation
  • How to implement variant selection (size, color) with dynamic pricing
  • How to create an add-to-cart workflow from the product page
  • How to display customer reviews and related products
Book a free consultation
4.9Clutch rating
600+Happy partners
17+Countries served
190+Team members
Beginner6 min read25-30 minAll Bubble plansMarch 2026RapidDev Engineering Team
TL;DR

A detailed product page in Bubble displays a product's images in a gallery with zoom, variant selection for size and color, dynamic pricing, an add-to-cart button, customer reviews, and related product suggestions. You build it using a page that receives a Product via URL parameter, with Repeating Groups for images and reviews, conditional displays for variants, and workflow actions for cart management.

Overview: Building a Product Detail Page in Bubble

This tutorial guides you through creating a professional e-commerce product page. You will build an image gallery, variant selector, pricing display, cart integration, review section, and related products component.

Prerequisites

  • A Bubble app with a Product Data Type
  • A shopping cart system (or plan to build one)
  • Understanding of URL parameters and dynamic page content

Step-by-step guide

1

Set up the product page with URL parameter

Create a page called 'product' with type of content set to 'Product'. This lets you pass a Product via URL. In the page URL, Bubble sends the product's unique ID (or slug if configured). All elements on the page can reference 'Current page's Product' for dynamic data. Set the page title dynamically: 'Current page's Product's name - Your Store Name'.

Expected result: A product page loads specific product data based on the URL parameter.

2

Build the image gallery with thumbnail navigation

Add a large Image element for the main product image. Below it, add a horizontal Repeating Group showing all product images as thumbnails (source: Current page's Product's images). When a thumbnail is clicked, set a page custom state 'selected_image' to that thumbnail's image. Set the large Image element's source to 'page's selected_image' (or first image as default). Add left/right arrows to cycle through images.

Pro tip: Add a zoom-on-hover effect by using a second Image element that shows a magnified portion of the image based on mouse position — implement this via an HTML element with CSS zoom.

Expected result: A product image gallery with clickable thumbnails, main image display, and navigation arrows.

3

Implement variant selection with dynamic pricing

If your products have variants (size, color), create a 'ProductVariant' Data Type with: 'product' (Product), 'size' (text), 'color' (text), 'price' (number), 'stock' (number), 'sku' (text). On the product page, add dropdown menus for Size and Color, sourced from the product's variants. When the user selects both, look up the matching variant and display its price and stock status. Use custom states: 'selected_variant' (ProductVariant) updates when dropdowns change.

Expected result: Users can select product variants, and the price and stock status update dynamically based on their selection.

4

Add the add-to-cart button and quantity selector

Add a number input for quantity (default 1, min 1, max = selected variant's stock). Add an 'Add to Cart' button. The workflow: Step 1 — check if the variant is in stock (stock > 0). Step 2 — create a CartItem record (or add to existing cart) with product, variant, quantity, and price. Step 3 — show a success notification ('Added to cart!'). Step 4 — update the cart item count display in the header. Add a conditional: when stock is 0, change the button to 'Out of Stock' and disable it.

Expected result: Users can select quantity and add products to their cart, with stock validation and feedback.

5

Display customer reviews and ratings

Below the product details, add a reviews section. Show the average rating as stars (use conditional icon visibility for each star based on the average). Show total review count. Add a Repeating Group of Reviews (Data Type: 'Review' with product, user, rating, title, body, date) sorted by date descending. Each cell shows the reviewer's name, star rating, date, title, and body text. Add a 'Write a Review' button that opens a popup form for authenticated users.

Expected result: A reviews section shows average rating, individual reviews, and a form for submitting new reviews.

6

Add related products section

At the bottom of the page, add a 'You May Also Like' section with a horizontal Repeating Group of Products. Source it with: 'Do a search for Products where category = Current page's Product's category' and filter out the current product. Limit to 4-6 items. Each cell shows the product image, name, and price, linking to that product's detail page. This encourages cross-selling and increases page views.

Expected result: A related products carousel shows similar items that link to their own product pages.

Complete working example

Workflow summary
1PRODUCT PAGE WORKFLOW SUMMARY
2=================================
3
4PAGE: product (type of content: Product)
5STATES: selected_image (image), selected_variant (ProductVariant)
6
7IMAGE GALLERY:
8 Main image: selected_image or first image
9 Thumbnails: RG of Product's images
10 Click thumbnail: set selected_image
11
12VARIANT SELECTION:
13 Dropdowns: Size, Color
14 On change: search ProductVariant matching both
15 Display: variant price + stock status
16
17ADD TO CART:
18 Validate: stock > 0, quantity <= stock
19 Create CartItem: product, variant, quantity, price
20 Show success notification
21 Update cart count in header
22
23REVIEWS:
24 Average: Search Reviews (this product) avg rating
25 List: RG of Reviews sorted by date desc
26 Write Review: popup form Create Review
27
28RELATED PRODUCTS:
29 Search: Products where category matches
30 Exclude: Current page's Product
31 Display: 4-6 items in horizontal RG

Common mistakes when building a Detailed Product Page in Bubble

Why it's a problem: Not setting the page type of content to Product

How to avoid: Set the page's type of content to your Product Data Type in the page settings

Why it's a problem: Hardcoding prices instead of pulling from the selected variant

How to avoid: Display 'selected_variant's price' dynamically, updating when the user changes variant selections

Why it's a problem: Allowing add-to-cart without checking stock

How to avoid: Check the selected variant's stock before creating a CartItem and disable the button when stock is 0

Best practices

  • Set the page type of content for clean data access via URL parameters
  • Use a custom state for the selected image to enable gallery thumbnail clicking
  • Display variant-specific pricing that updates dynamically on selection
  • Always check stock before allowing add-to-cart
  • Show social proof with review count and average rating prominently
  • Add related products to increase cross-selling and session depth
  • Use Imgix parameters for optimized image delivery at different sizes

Still stuck?

Copy one of these prompts to get a personalized, step-by-step explanation.

ChatGPT Prompt

I'm building an e-commerce app in Bubble.io and need a detailed product page with an image gallery, size/color variant selection, dynamic pricing, add-to-cart, reviews, and related products. How do I structure this?

Bubble Prompt

Build a product detail page for my store. Display the product's images in a gallery with thumbnails. Add size and color dropdowns that update the price. Include an add-to-cart button with quantity selector and stock checking. Show customer reviews with star ratings and related products at the bottom.

Frequently asked questions

How do I handle products without variants?

Add a condition: when the product has no variants, hide the variant dropdowns and show the product's base price directly. Use the product's own stock and price fields.

Can I add a zoom feature to product images?

Yes. Use an HTML element with CSS overflow:hidden and transform:scale() on hover, or use a lightbox plugin that shows a full-size image in a modal on click.

How do I implement a 'Wishlist' or 'Save for Later' button?

Add a Wishlist Data Type linking User and Product. Toggle the product in/out of the user's wishlist on button click. Show a heart icon that changes state based on whether the product is in the wishlist.

Should I use slugs or unique IDs in product URLs?

Use slugs for SEO-friendly URLs (e.g., /product/blue-widget). Set the slug via 'Set a thing's slug' action when creating products. Bubble resolves slugs automatically when the page type of content is set.

Can RapidDev build a complete e-commerce store in Bubble?

Yes. RapidDev can build full e-commerce platforms with product management, cart, checkout, payment processing, order management, and analytics in Bubble.

RapidDev

Talk to an Expert

Our team has built 600+ apps. Get personalized help with your project.

Book a free consultation

Need help with your project?

Our experts have built 600+ apps and can accelerate your development. Book a free consultation — no strings attached.

Book a free consultation

We put the rapid in RapidDev

Need a dedicated strategic tech and growth partner? Discover what RapidDev can do for your business! Book a call with our team to schedule a free, no-obligation consultation. We'll discuss your project and provide a custom quote at no cost.