Created
March 9, 2013 01:48
-
-
Save allenhurff/5122111 to your computer and use it in GitHub Desktop.
FriendBuy Shopify App Widget - HTML & Javascript including the line items (sku, price, quantity).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div id="friendbuy_widget"></div> | |
| <script type="text/javascript"> | |
| var _frnd = { | |
| site: "site-00000000-host", | |
| order: { | |
| id: "{{ order_number }}", | |
| amount: "{{ total_price | money_without_currency }}" | |
| }, | |
| products: [ | |
| {% for line in line_items %} | |
| { | |
| sku: "{{ line.sku }}", | |
| price: "{{ line.line_price | money_without_currency }}", | |
| quantity: "{{ line.quantity }}" | |
| } | |
| {% if forloop.rindex != 0 %},{% endif %} | |
| {% endfor %} | |
| ] | |
| }; | |
| (function(d, l, s) { | |
| var a, b = d.getElementsByTagName(s)[0]; | |
| a = d.createElement(s);a.type = 'text/javascript';a.async = true; | |
| a.src = l.protocol + '//djnf6e5yyirys.cloudfront.net/js/frndby.js'; | |
| b.parentNode.insertBefore(a, b); | |
| })(document, location, 'script'); | |
| </script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment