In Tiendanube it is possible to configure a product to contain more than one variant. That means the same shirt can come in different colors. Each of these colors can become a variant of the product. In addition, the product photo may update automatically as you scroll through the available variants.
This functionality is available both on the product page and in the “quick buy” option available in the product list and on the home page of stores.
In this article, we’ll explain how to add this functionality to a custom-themed store in two easy steps.
Step 1
Register a function in layout.tpl to be executed each time a change is detected in a variant using Javascript code like the following:
$(document).ready(function() { LS.registerOnChangeVariant(function(variant){ // this is used on quick shop modals var current_image = $('img', '#quick'+variant.product_id); current_image.attr('src', variant.image_url); // this is used on single product view $(".cloud-zoom-gallery[data-image="+variant.image+"] > img").click(); }); })
step 2
Then in templates/product.tpl add the data image ID to associate it with the currently selected image.
<a class="cloud-zoom-gallery img-thumbnail" href="https://www.tiendanube.com/blog/como-incluir-la-funcionalidad-de-imagenes-por-variante-con-diseno-a-medida/{{ image" product_image_url('original') }}" rel="useZoom: 'zoom', smallImage: "https://www.tiendanube.com/blog/como-incluir-la-funcionalidad-de-imagenes-por-variante-con-diseno-a-medida/{{ image" product_image_url('large') }}' " data-image="{{image.id}}"> {{ image | product_image_url('thumb') | img_tag(product.name) }}
That’s it! Yes now, configure by the administrator the images of your shop so that they are automatically changed.
Remember that you can register as a designer Business partners of Tiendanube and thus access a demo shop to test how to make these and many other changes. If you haven’t already, sign up now.

What is certain is that we live on investments

5 Benefits of the Bring Your Own Device (BYOD) Trend

Wide Eyes Technologies: Artificial intelligence for image recognition in the fashion industry

How can the company become more competitive?

Pronovias appoints the General Manager of L’Oreal Luxe as the company’s new CEO

Guide to designing a good purchasing plan and choosing efficient suppliers

7 organizational communication trends for 2016

The 10 best franchises in the world

Meet Playthe.net, a Spanish media solutions company

Creative ideas to spread your brand on Children’s Day

Internet Payment: How Can Your Business Sell More?

Executive MBA, the perfect master’s degree for entrepreneurs

Liiffe, the first travel marketplace offering the exchange of lives through 100% immersive experiences

How the stock market crash in China is affecting Latin America

4 criteria for choosing a business area

Would you lower your salary to get more benefits?

Renfe and EOI launch the largest customer experience business training initiative

Social networks for non-profit organizations

It is important to have details about your company’s employees

Investing in hotel rooms: a highly profitable business

What is it and how to calculate working capital for your business

Vintage clothing store decoration. dress everyone

How do you organize your work desk to be more productive?

8 tips for building your mobile site

What is the Argentine Chamber of Electronic Commerce (CACE)

Iñigo Juantegui: the man of 10 million dollars

Listen to the podcast: ‘Caganer.com: From crib to election prediction’, with Sergi Alòs

Challenges for small businesses in the age of cybersecurity

Uground: Platform that allows you to create “digital twins” to become a disruptive startup
