Improve Product Images with an Image Slider in Shopify Boundless

Published on Jun 11, 2024

By Aisha Patel

#Shopify#Web Development#E-commerce
White and Red Box on Brown Wooden Table

Are you using Shopify’s Boundless theme and finding that your product images are not displayed in the most user-friendly way? Many store owners face the challenge of having to scroll down to view additional product images, which can be frustrating for customers. In this comprehensive guide, we’ll walk you through the process of creating an image slider for your product pages, enhancing the user experience and potentially boosting your sales.

Understanding the Problem

The Default Image Display in Boundless

By default, the Boundless theme displays only the first product image at the top of the page, requiring users to scroll down to view additional images. This layout can be less than ideal for showcasing your products effectively.

The Impact on User Experience

When customers have to put in extra effort to view all product images, it can lead to a poor user experience. This might result in decreased engagement and potentially lost sales opportunities.

The Need for an Image Slider Solution

An image slider allows customers to easily browse through all product images without leaving the top of the page. This solution can significantly improve the shopping experience and product presentation.

Creating an Image Slider: Step-by-Step Guide

Step 1: Create an Alternate Product Template

To begin, you’ll need to create a new product template file:

  1. In your Shopify admin, go to “Online Store” > “Themes”
  2. Click “Actions” > “Edit code”
  3. In the “Templates” folder, create a new file named product.image-gallery.liquid

Step 2: Set Up the Product Template Section

Next, you’ll create a new section file for your image gallery:

  1. In the “Sections” folder, create a new file named product-template-gallery.liquid
  2. Open your newly created product.image-gallery.liquid file
  3. Replace the content with: {% section 'product-template-gallery' %}

Step 3: Add the Image Gallery Code

Now, you’ll need to add the code for the image gallery functionality:

  1. Open the product-template-gallery.liquid file you created
  2. Replace the contents with the code from the Gist provided in the original solution (Note: As the original link is no longer available, you may need to reach out to Shopify support or consult their documentation for the most up-to-date code)

Step 4: Initialize the Sliders

To make the sliders functional, you’ll need to add some JavaScript:

  1. Locate your theme’s theme.js.liquid file
  2. Add the following code to initialize the sliders:
$('.product-slideshow').slick({
  dots: false,
  infinite: true,
  speed: 500,
  slidesToShow: 1,
  slidesToScroll: 1,
  arrows: false,
  asNavFor: '.product-slideshow-nav'
});

$('.product-slideshow-nav').slick({
  slidesToShow: 3,
  slidesToScroll: 1,
  infinite: false,
  asNavFor: '.product-slideshow',
  dots: false,
  arrows: true,
  focusOnSelect: true,
  nextArrow: '<button type="button" class="slick-next">»</button>',
  prevArrow: '<button type="button" class="slick-prev">«</button>'
});

Step 5: Add Custom Styles

To ensure your image slider looks great, add some custom CSS:

  1. Open your theme.scss.liquid file
  2. Add the following styles:
.slick-list:focus { outline: none; }
.slick-prev,.slick-next{
  top: 42%;
  font-size: 2em;
}
.slick-next{ right: -5% }
.slick-prev{ left: -5% }

Step 6: Apply the New Template

Finally, you’ll need to apply your new template to your products:

  1. Go to your Shopify admin
  2. Navigate to “Products”
  3. Select the product you want to update
  4. In the “Theme templates” section, choose your new template from the dropdown menu
  5. Save your changes

Customizing Your Image Slider

Adjusting Image Size

If you find that your images are appearing too small on desktop, you can adjust the size:

  1. Go to “Online Store” > “Customize”
  2. Select the product page with your new template
  3. Find the “Product” section
  4. Set the “Product form width” to “Large”

Removing Image Borders

To remove borders when changing images, add this CSS to your theme.scss.liquid file:

.slick-list:focus { outline: none; }

Adding Click/Zoom Functionality

While the basic image slider doesn’t include a zoom feature, you can explore Shopify apps or consult with a developer to add this functionality.

Troubleshooting Common Issues

Arrows Not Showing

If your slider arrows aren’t visible, double-check that you’ve correctly added the CSS for the arrows in your theme.scss.liquid file.

Images Appearing Small on Desktop

Adjust the “Product form width” setting as mentioned in the customization section. If issues persist, you may need to modify the CSS to allow for larger image sizes.

Variant Images Not Syncing

Be aware that this method may not automatically sync variant images with variant selections. You might need additional JavaScript to handle this functionality.

By following these steps, you should be able to create an effective image slider for your product pages in the Boundless theme. This enhancement can significantly improve your customers’ shopping experience, potentially leading to increased engagement and sales. Remember to test your changes thoroughly across different devices to ensure a smooth experience for all users.

Take Our Quick Quiz:

Which primary product image do you think has the highest conversion rate?