I'm using "Debut" as theme of my store in shopify. I would like to use Slick JS as image slide for my product gallery. I tried and it work! but the functionality of "selecting variants and showing it's image" is gone.
this is my code inside product-template.liquid:
<div class="adsurf_slickslide_container" role='toolbar'>
{% assign index = 0 %}
{% if product.images.size > 1 %}
{% for image in product.images %}
{% assign index = index | plus: 1 %}
<span class="slide" data-index="{{ index }}" data-variant-img="{{ image.id }}">
<img data-advar="{{ product.options_with_values | escape }}" src="{{ image | img_url: '1024x1024' }}" alt="{{ image.alt | escape }}">
</span>
{% endfor %}
{% endif %}
</div>
<script type='text/javascript' src='https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js'></script>
<script type='text/javascript' src='https://cdn.jsdelivr.net/jquery.slick/1.6.0/slick.min.js'></script>
<script type='text/javascript'>
$(function(){
$('div.adsurf_slickslide_container').slick({
dots: true,
infinite: true,
speed: 300,
slidesToShow: 1,
adaptiveHeight: true
});
$(document).on('change', 'select.single-option-selector', function(){
var customVal = $(this).val();
var hittedIndex = $('span img#' + customVal).data('index');
console.log('span img[addata=' + customVal + ']');
if(hittedIndex != undefined)
$('div.adsurf_slickslide_container').slick('slickGoTo', hittedIndex);
});
});
</script>
Please help. Thanks in advance :)