If Photolock seems to load slowly on your page and you are noticing delays for locks to activate, there are couple things you can do to prevent this happening.

Why is there a delay on my website?
Photolock is loaded asynchronously, meaning that it loads after the rest of your page elements to ensure speed and not cause any conflict with any other apps on your store. For that reason if your site's load time is longer than average, this may cause slight delays on Photolock actions.

To prevent this happening, you can either optimize your website for speed or disable asynchronous loading.

Optimize Your Site Speed
To maximize the effectiveness of Photolock, we recommend optimizing your site to an effective load-time under 3 seconds.

The most common way to increase site speed is compressing digital assets and photography. You can use a free tool like www.tinyjpg.com to compress your images yourself and upload them to your online store or website.

If your site has a longer load time and image compression does not solve the problem, we suggest that you speak with a developer team or Shopify Expert (like Pasilobus) to optimize your pages.

Disabling Asynchronous Loading
While we always recommend optimizing your speed, if you are not able to do so, you can choose to disable asynchronous loading so Photolock will load before all your page elements and no delay will occur. To do so, you need to make a small change in your connector script.

In Shopify you can find connector script in your theme files. Go to Online Store > Themes and open the code editor. When you are in the editor, you will see all files listed in the left sidebar. Click on "theme.liquid" file. See this article to learn more about using code editor.

Locate the connector script which should have been placed just before </head> tag, which looks something like this:

<script type="text/javascript" src="https://app.photolock.io/lock.js?shop=www.myonlinestore.com" async defer></script>

You will want to remove "async defer" attributes from this script and it should look like this after:

<script type="text/javascript" src="https://app.photolock.io/lock.js?shop=www.myonlinestore.com"></script>

Save changes in your code editor, and that's all you need to do to disable asynchronous loading.
Was this article helpful?
Thank you!