Different jQuery tmpl based on product type

Follow

Comments

1 comment

  • Avatar
    Zetya Support

    What I normally do is create templates for each form and name them according to the product type. E.g.

    ...  
    

    <script id="p9d-row-template-book-labels" type="text/html">

    </script>

    ...

    <script id="p9d-row-template-mini-waterproof" type="text/html">

    ...

    </script>

    ...

    Then pass the name of the template through to add_cart_row:

    var template = 'p9d-row-template-{{ item.product.type | handleize }}';   
    

    personified.add_cart_row(, formatter, template);

    Cheers, Gavin.

Please sign in to leave a comment.