Need to use the product info rain variable in my custom JS


I am creating a custom app in lightspeed in which I am registering my custom js file into the header of lightspeed and I have included it successfully however on product detail page, I need to use the product info like product name, product category using rain variables like {{}} etc. So can you please provide me the solution in which I can get this variable into my js file and use this variable value. Its quite urgent so please reply ASAP.

Here is the test store URL and product detail page where I have insert the fashionfitr button using JS.

Please reply

Thanks in Advance

1 comment

  • JoepLindenJoepLinden Member Posts: 3

    Have you tried the following?

    Create a div around the {{product.title}}, like this:
    <div id="product-title"><br>&nbsp; &nbsp;{{product.title}}<br></div>

    Now create a js variable by calling an id:

    var producttitle = document.getElementById("product-title");

    I dont know if this will work but that is how I would do it :)


    Joep van der Linden
    Lightspeed developer
Sign In or Register to comment.