• Resolved Chris Laursen

    (@chrislaursen)


    In the interest of faster loading times, I’d like to only load the Shopify javascript on the “Shop” page of my site. How would I go about doing that? I understand this would cause the shopping cart to not appear on other pages, which is ok.

    Ideally the Shopify script would load once the person goes to our Shop page, and then after that it would load on every page, following them around… is that possible?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Shopify

    (@shopify)

    Hi Chris,

    I’ve spoken to the team about this and we think the best way to do this would be put all your product embeds in your “Shop” page and then use the Buy Button.JS UI library to add the cart component to the rest of the pages.

    This way you don’t have to add in the whole embed script to each page so it will be a faster option and your customers will still be able to see the cart once they add something from the “Shop” page.

    Please check the Buy Button.JS docs for more information on how to add individual UI components: Buy Button JS Docs

    Plugin Author Shopify

    (@shopify)

    Hi Chris,

    I just realized the above link is not the right one. Here is the correct one, sorry about that:

    https://shopify.github.io/buy-button-js/

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Load JS only on Shop page of site’ is closed to new replies.