Liquid, JavaScript, themes, sales channels
Hi
Just in the process of creating a buy button - everything works smoothly except the arrows for the next and previous product image arent loading.
The console tab of chrome dev tools is throwing a "Failed to load resources" error. The culprit is with the source for the arrow: src="//sdks.shopifycdn.com/buy-button/latest/arrow.svg"
If I replace the src with "https://sdks.shopify "..... etc the image loads fine. As the source is loaded in the javascript of the buy button I cant figure out a way to manually correct this. Anyone have any advice?
Thanks
Solved! Go to the solution
This is an accepted solution.
For anyone interested - I figured it out. Technically there was nothing wrong but I will elaborate.
Basically the supplied src was beginning with "//" which is essentially shorthand for whatever protocol is currently being used. It didn't occur to me at the time that because I was viewing the site locally (but fetching the javascript from the internet) that the script would default to a local source for the images.
When I eventually tested on a live server, the current protocol was then web and it sourced the images correctly.
Ultimately nothing to fix - and a simple oversight on my part.
This is an accepted solution.
For anyone interested - I figured it out. Technically there was nothing wrong but I will elaborate.
Basically the supplied src was beginning with "//" which is essentially shorthand for whatever protocol is currently being used. It didn't occur to me at the time that because I was viewing the site locally (but fetching the javascript from the internet) that the script would default to a local source for the images.
When I eventually tested on a live server, the current protocol was then web and it sourced the images correctly.
Ultimately nothing to fix - and a simple oversight on my part.
Are you ready to take your business to the next level? Look no further than the latest ...
By SarahF_Shopify Apr 15, 2024We’re keeping the ball rolling to make sure you’re always ahead of the game. So buckle ...
By JasonH Apr 8, 2024Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024