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
Set up the product page with URL parameter
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.
Build the image gallery with thumbnail navigation
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.
Implement variant selection with dynamic pricing
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.
Add the add-to-cart button and quantity selector
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.
Display customer reviews and ratings
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.
Add related products section
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
1PRODUCT PAGE — WORKFLOW SUMMARY2=================================34PAGE: product (type of content: Product)5STATES: selected_image (image), selected_variant (ProductVariant)67IMAGE GALLERY:8 Main image: selected_image or first image9 Thumbnails: RG of Product's images10 Click thumbnail: set selected_image1112VARIANT SELECTION:13 Dropdowns: Size, Color14 On change: search ProductVariant matching both15 Display: variant price + stock status1617ADD TO CART:18 Validate: stock > 0, quantity <= stock19 Create CartItem: product, variant, quantity, price20 Show success notification21 Update cart count in header2223REVIEWS:24 Average: Search Reviews (this product) avg rating25 List: RG of Reviews sorted by date desc26 Write Review: popup form → Create Review2728RELATED PRODUCTS:29 Search: Products where category matches30 Exclude: Current page's Product31 Display: 4-6 items in horizontal RGCommon 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.
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?
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.
Talk to an Expert
Our team has built 600+ apps. Get personalized help with your project.
Book a free consultation