How to Build a WooCommerce Product Gallery in Divi 5

A copy-and-adapt recipe for a shoppable Divi 5 product grid, with a one-click cart icon and a color attribute slider.

Shoppable WooCommerce product gallery in Divi 5 with price slider, sale badges and Add to Cart buttons

To build a Divi WooCommerce product gallery, add HappyDivi Gallery, set Content Source to WooCommerce Products, then turn on prices, sale badges and Add to Cart under Caption. You can add a filter bar, price slider and sort menu without code.

Divi already has a Woo Products module, which is a good fit for a standard product grid. This recipe is for when you want shoppers to do more from the grid, such as sorting, narrowing by price and buying without leaving the page.

Step 1: Choose Which Products Appear

Under Image / Content Source, choose WooCommerce Products, then narrow the list:

  • Sale Filter: perfect for a sale landing page.
  • Featured Products Only: just your marked favorites.
  • Minimum and Maximum Price: for a "gifts under $50" page.
  • Stock Status: most shops choose In Stock.
  • Included Categories, Product Tags and Minimum Rating: build a page for one collection.

Further down, turn on Show Sort Dropdown In the Frontend and Show Price Range Slider In the Frontend.

WooCommerce Products source settings beside a shop grid with price slider, sort dropdown and category pills

Our demo shop, with the sort menu and price slider on.

Step 2: Show Prices and Add to Cart

Open Caption and turn on what each product should show: Show Title, Show Price, Show Sale Badge and Show Add To Cart Button. For image-led pages, try Show Cart Icon on Hover instead. Set Content Position to Below Image for a clean card.

Caption settings with Show Price, Show Sale Badge and Add To Cart beside product cards with Sale badges

Style badges and buttons under the Design tab.

How the hover cart icon behaves. A round + appears over the product photo. We clicked it on a simple product, and this is what happened:

  • The product went into the cart with no page reload, and the WooCommerce mini cart refreshed.
  • The icon turned green, and it stays green on later visits while the product is in the cart.
  • On a variable product, the icon opens the product page instead, because the shopper still has to choose a variation.

You can change the icon's size, color, background and corner radius under the Design tab.

Which button?

Use the full Add to Cart button on landing pages where buying is the goal. Use the hover icon on lookbook pages, where the photos should do the talking.

Step 3: Add the Color Attribute Slider

This is the part shoppers notice. Each card becomes a small slider, and color dots on the photo jump to the matching variation image, so people can compare colors from the grid.

  1. In WooCommerce, give the variable product a color attribute, and set an image on each variation.
  2. Under Product Carousel, turn on Enable Product Carousel. Keep arrows and dots on, and leave Autoplay off so shoppers stay in control.
  3. Turn on Show Color Swatches. Color Attribute stays on Auto-detect, or you can pick your attribute if it has another name.

The slider uses the featured image, then the product gallery images, then any image that exists only on a variation. Simple products get a slider too, as long as they have gallery images.

Product Carousel settings beside two product cards: a teapot with a green in-cart icon and a mug switched to its blue variation by a color dot

Our test shop: the teapot is in the cart, and the blue dot switched the mug to its blue variation image.

No dots showing?

Dots appear only when a color matches a slide. Check that the product is variable, that each variation has its own image, and that Enable Product Carousel is on.

Divi's own Woo Products module has no per-card slider or color dots. Some Divi add-ons offer swatches on their own. The advantage here is having the slider, color dots, cart icon, filters and price slider together in one gallery module.

Step 4: Add a Category Filter Bar

Under Filter Bar, turn on Enable Category Filter, choose Pills, and turn on Sticky Filter Bar so the controls stay on screen. Turn on Save Filter in URL too, so an email campaign can link straight to one category, such as ?hdg_cat=sweaters.

Step 5: Finish the Layout

  • Gallery Layout: Grid with Square (1:1) or Portrait (3:4), so each product carries the same weight.
  • Columns: 4 on desktop, 2 on tablet, 1 or 2 on phone.
  • Click Action: Go to Post / Product URL, or Open in Lightbox.
  • Pagination: Load More Button with 12 per page. See the pagination guide.

The Recipe at a Glance

GroupSetting
Content SourceWooCommerce Products, In Stock, Sort and Price Slider on
CaptionTitle, Price, Sale Badge, Add to Cart, Below Image
Product CarouselOn, arrows and dots on, autoplay off, Show Color Swatches on
Gallery LayoutGrid, Square, 4 columns
Filter BarPills, Sticky on, Save Filter in URL on
PaginationLoad More, 12 per page

Frequently asked questions

Do I need a separate WooCommerce page template?

No. The gallery is a normal Divi 5 module, so you can place it on any page, landing page or Theme Builder layout.

Can I make a sale or under-$50 page?

Yes. Set Sale Filter to On Sale Only, or set a Maximum Price, and the gallery shows only matching products.

Can shoppers add to the cart without leaving the page?

Yes, for simple products. The Add to Cart button and the hover cart icon add the product with no page reload. A variable product opens its product page so the shopper can choose a variation.

How do I show variation images in a Divi product grid?

Set an image on each variation in WooCommerce, then turn on Enable Product Carousel and Show Color Swatches. Clicking a color dot moves the card to that variation's image.

My color attribute has a different name. Will swatches work?

Yes. Color attributes are auto-detected, and you can choose the attribute yourself for any other name.

Does this replace my WooCommerce shop page?

It can sit on a landing page or a custom shop layout. WooCommerce still runs your cart and checkout, and the gallery only changes how products are browsed.

Want the full picture? The Complete Divi 5 Gallery Guide covers every source, layout, lightbox, filter and pagination option.

Get the next Divi 5 guide

New guides and plugin news from HappyDivi. Unsubscribe any time.

Rubait Hasan

Written by

Founder & Product Builder

Rubait has been building for Divi since 2017. He founded DiviZoom in 2019, sold it in 2022, and started HappyDivi when Divi 5 rebuilt the builder from the ground up. He writes the code behind HappyDivi's plugins and answers support himself.

More articles by Rubait

Get the next Divi 5 guide

New guides and plugin news from HappyDivi. Unsubscribe any time.