javascript - Is it possible to fix the positions of last three slides within the slick slider?
The scenario is as follows:-
I am working on an E-commerce site. There on product page I have products with variants. I want to show thumbnails that belongs to a particular variant.
For example, if I have clicked RED variant I want only red coloured shirts to appear under main-image as thumbnails.
I am new to java script. I don't know how to get the values of fixed slides
Answer
Solution:
You can filter your products by parameter:
const products = [
{name: 'shirt1', color: 'red'},
{name: 'shirt2', color: 'blue'},
{name: 'shirt3', color: 'white'},
{name: 'shirt4', color: 'red'}
]
function filterByColor(color){
let filteredProducts = products.filter(product => product.color == color)
}
So your Button must have function onClick:
<button onClick=filterByColor('red')>Only Red Shirts</button>
Source
Didn't find the answer?
Our community is visited by hundreds of Shopify development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.