Prepopulating fields in lightbox form from Shopify cart page?

  • Profile Image
    CoverArtFactory
    Asked on October 23, 2013 at 08:43 AM

    Shopify (cart.liquid)

     

     

    <a target="_blank" href="{{ item.product.url }}">

                    <img src="{{ item.product.featured_image | product_img_url: 'thumb' }}"  alt="{{ item.product.title }}" />

        </a>

     

     

    item.product.title is where the product name is displayed when checking the souce on Shopify cart page.

     

    So I have added this to Shopify (cart.liquid). item is what I named the field in my jotform ( Name: {item} )

     

     

    <script src="//cdn.jotfor.ms/static/feedback2.js?3.1.90?item={{ item.product.title }}" type="text/javascript">

    new JotformFeedback({

    formId:'32543714967361',

    base:'http://jotformeu.com/',

    windowTitle:'Artist, title and picture',

    background:'#FFA500',

    fontColor:'#FFFFFF',

    type:1,

    height:500,

    width:700,

    openOnLoad:true,

    iframeParameters: {noJump: true}

    });

    </script>

     

    But Jotform does not prepopulating my item text field with the shopify item product name?

     

  • Profile Image
    guilledutra
    Answered on October 23, 2013 at 10:21 AM

    Hi,

    As JotForm forms and Shopify are separated systems, I'm afraid it won't be possible to prepopulate a form lightbox with content generated by a shopify function(in this case the item).

    I have no experience with shopify, anyways the right way to pre populate lightbox form is by adding the pre populate parameters to the "iframeParameters" section of your lightbox code:

    <script src="//cdn.jotfor.ms/static/feedback2.js?3.1.90 type="text/javascript">

    new JotformFeedback({

    formId:'32543714967361',

    base:'http://jotformeu.com/',

    windowTitle:'Artist, title and picture',

    background:'#FFA500',

    fontColor:'#FFFFFF',

    type:1,

    height:500,

    width:700,

    openOnLoad:true,

    iframeParameters: {

         'item':'item field content',

         'noJump': 'true'

    });

    </script>

    Hope it helps

    Thanks