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

Hello,

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 {{product.name}} 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. 
http://fashionfitr.webshopapp.com/ 
http://fashionfitr.webshopapp.com/g-star-tshirt.html

Please reply

Thanks in Advance

1 comment

  • JoepLindenJoepLinden Member Posts: 3
    Hi,

    Have you tried the following?

    Create a div around the {{product.title}}, like this:
    <div id="product-title">
       {{product.title}}
    </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 :)


    Mvg,

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