Displaying list of Products 2 times in same page not working

Highlighted
New Member
5 0 0

Hi all,

I am fairly new to shopify and trying to learn.

I am trying to display Best Sellers Products list 2 times in Home Page in

https://demostore.binaize.com/

 

At the moment, I am testing so the entire website is inserted twice. The first div displays the best sellers list and second div does not.

 

Can anyone tell me why is this happening? If I change the second div to first then it loads in second div and doesn't load in first div.

 

<!-- CUSTOM MADE DIVs -->

<div id="index1"> {% include 'index1' %} </div>
<div id="index2"> {% include 'index2' %} </div>

 

 

0 Likes
Highlighted
Pathfinder
93 9 29

Hi @Binaize,

 

If the snippet index1 has the code for best sellers, then your code should be as 

 

<!-- CUSTOM MADE DIVs -->

<div id="index1">  
  {% include 'index1' %}
</div>

<div id="index2">  
  {% include 'index1' %}
</div>


What is in the code in 'index2'? 

0 Likes
Highlighted
New Member
5 0 0

Hey @jayanetty ,


Thank you for your reply.

Well actually I am trying to create split testing for hompage. I cannot use other 3rd party apps.

 

index1 has some color changes and index2 has some other color changes but basically it's same page.

 

What I am currently doing is - I let liquid render both divs then I use javascript to hide the div element which is not required. My logic is to use random number at the moment for testing purpose.

< 0.5 then index1

> 0.5 then index2

 

If you can suggest some ways to do the split testing on my own then that would be great too!!

 

Thanks!!

0 Likes