The store is implemented on wordpress with the help of the wooCommerce plugin. It is necessary when you hover over the image of the goods with the mouse to start the sliding images of the goods. In principle, the js of the slider itself I wrote, now it remains to integrate the script into the theme. Here I have a lot of questions. The main one is that I do not know how to bind the addresses of the pictures to the script.
The script itself:
//ΡΡΠ½ΠΊΡΠΈΡ ΠΏΠΎΠ΄ΠΌΠ΅Π½Ρ src //elem - Π΅Π»Π΅ΠΌΠ΅Π½Ρ Π½Π°Π΄ ΠΊΠΎΡΠΎΡΡΠΌ ΠΏΡΠΎΠΈΡΡ
ΠΎΠ΄ΡΡ ΠΌΠ°Π½ΠΈΠΏΡΠ»ΡΡΠΈΠΈ //way - ΠΌΠ°ΡΡΠΈΠ² Ρ ΠΏΡΡΡΠΌΠΈ ΠΊ ΠΊΠ°ΡΡΠΈΠ½ΠΊΠ°ΠΌ //i - ΡΡΠ΅ΡΡΠΈΠΊ function slider(elem, way, i) { elem.setAttribute('src', way[i]); // ΠΏΡΠΎΠ²Π΅ΡΡΠ΅ΠΌ ΡΡΠΎ - Π±Ρ ΡΡΠ΅ΡΡΠΈΠΊ Π½Π΅ Π±ΡΠ» Π±ΠΎΠ»ΡΡΠ΅ Π΄Π»ΠΈΠ½Π½Ρ ΠΌΠ°ΡΡΠΈΠ²Π°, ΠΈΠ½Π°ΡΠ΅ ΡΠ±ΡΠ°ΡΡΠ²Π°Π΅ΠΌ Π² 0 if (i == way.length - 1) { i = 0; } else { i++; } //ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅ΠΌ ΡΠ°ΠΉΠΌΠ΅Ρ ΠΈ ΡΠ΅ΠΊΡΡΡΠΈΠ²Π½ΠΎ Π·Π°ΠΏΡΡΠΊΠ°Π΅ΠΌ ΡΡΠ½ΠΊΡΠΈΡ ΡΠ°ΠΌΡ ΠΈΠ· ΡΠ΅Π±Ρ var timer = setTimeout(slider, 1000, elem, way, i); //Π΄ΠΎΠ±Π°Π²Π»ΡΠ΅ΠΌ ΡΠΎΠ±ΡΡΠΈΠ΅ Π½Π° ΠΊΠΎΠ½ΡΠ΅ΠΉΠ½Π΅Ρ Ρ ΠΊΠ°ΡΡΠΈΠ½ΠΊΠΎΠΉ Π½Π° ΡΡ
ΠΎΠ΄ ΠΌΡΡΠΈ, ΡΠ΄Π°Π»ΡΠ΅ΠΌ ΡΠ°ΠΉΠΌΠ΅Ρ ΠΈ ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅ΠΌ src Π² ΠΈΡΡ
ΠΎΠ΄Π½ΠΎΠ΅ ΡΠΎΡΡΠΎΡΠ½ΠΈΠ΅. container.addEventListener('mouseout', function() { clearTimeout(timer); elem.setAttribute('src', way[0]); }); } //ΡΠΎΠ±ΡΡΠ²Π΅Π½Π½ΠΎ ΡΠ°ΠΌ ΠΌΠ°ΡΡΠΈΠ² Ρ ΠΏΡΡΡΠΌΠΈ ΠΊΠ°ΡΡΠΈΠ½ΠΎΠΊ var arr = [ 'http://www.stihi.ru/pics/2011/04/07/8199.jpg', 'http://autowalls.ru/walls/porsche/autowalls_ru_390.jpg', 'http://wallpaperrs.com/uploads/nature/earth-forest-mind-blowing-wallpaper-91990-142978533514.jpg', 'http://mykartinka.ru/_ph/22/664889599.jpg', ]; var container = document.querySelector('.container'); // ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅ΠΌ ΡΠΎΠ±ΡΡΠΈΠ΅ Π½Π° Π½Π°Π²Π΅Π΄Π΅Π½ΠΈΠ΅ ΠΌΡΡΠΈ Π½Π° ΠΊΠΎΠ½ΡΠ΅ΠΉΠ½Π΅Ρ Ρ ΠΊΠ°ΡΡΠΈΠ½ΠΊΠΎΠΉ container.addEventListener('mouseover', function(event) { //ΠΏΡΠΎΠ²Π΅ΡΡΠ΅ΠΌ ΡΡΠΎ ΡΠΎΠ±ΡΡΠΈΠ΅ Π²ΠΎΠ·Π½ΠΈΠΊΠ»ΠΎ Π½Π° ΠΊΠ°ΡΡΠΈΠ½ΠΊΠ΅, ΡΡΡΠ°Π½Π°Π²Π»ΠΈΠ²Π°Π΅ΠΌ ΡΡΠ΅ΡΡΠΈΠΊ Π² 1 ΠΈ Π·Π°ΠΏΡΡΠΊΠ°Π΅ΠΌ ΡΡΠ½ΠΊΡΠΈΡ ΠΏΠΎΠ΄ΠΌΠ΅Π½Ρ src if (event.target == container.querySelector('img')) { var i = 1; slider(event.target, arr, i); } else return; }); <div class="container"> <img width="200" height="150" src="http://www.stihi.ru/pics/2011/04/07/8199.jpg" alt=""> </div> As you can see, the paths to the pictures are stored in the arr array. So here's how to stuff the paths of those pictures that the store administrator will indicate. I understand the pictures are added like this: 
The php is not strong and I know the wordpress engine is not so good, tell me which way to look.