Created
May 29, 2016 00:25
-
-
Save seedcms/c8f419061f27a2b6669bdc6b6fe6fe4f to your computer and use it in GitHub Desktop.
Lookbook Snippet V4
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
<link href='//pressify.s3.amazonaws.com/assets/fancybox/source/jquery.fancybox.css' rel='stylesheet' type='text/css'> | |
<script src="//pressify.s3.amazonaws.com/assets/fancybox/source/jquery.fancybox.js" type="text/javascript"></script> | |
<script src="//npmcdn.com/[email protected]/dist/masonry.pkgd.min.js"></script> | |
<script src="//npmcdn.com/[email protected]/imagesloaded.pkgd.min.js"></script> | |
<link href='//pressify.s3.amazonaws.com/assets/bxslider/jquery.bxslider.css' rel='stylesheet' type='text/css'> | |
<script src="//pressify.s3.amazonaws.com/assets/bxslider/jquery.bxslider.min.js"></script> | |
<div class="lookbook_details" style=""></div> | |
<script> | |
jQuery(document).ready(function(){ | |
// app domain | |
//var appDomain = 'http://lookbooks.herokuapp.com'; | |
var appDomain = '//lookbooks-herokuapp-com.global.ssl.fastly.net'; | |
// default vars to load the correct gallery | |
{% if product.id %} | |
var product_id = {{ product.id }}; | |
{% else %} | |
var product_id = 0; | |
{% endif %} | |
{% if page.id %} | |
var page_id = {{ page.id }}; | |
{% else %} | |
var page_id = 0; | |
{% endif %} | |
{% if collection.id %} | |
var collection_id = {{ collection.id }}; | |
{% else %} | |
var collection_id = 0; | |
{% endif %} | |
{% if article.id %} | |
var article_id = {{ article.id }}; | |
{% else %} | |
var article_id = 0; | |
{% endif %} | |
var url = appDomain + '/lookbooks/get/?collection_id='+collection_id+'&product_id='+product_id+'&page_id='+page_id+'&article_id='+article_id+'&shop_url={{shop.permanent_domain}}&v=4.0'; | |
console.log(appDomain + '/lookbooks/get/?collection_id='+collection_id+'&product_id='+product_id+'&page_id='+page_id+'&article_id='+article_id+'&shop_url={{shop.permanent_domain}}&v=4.0'); | |
$.ajax({ | |
url: url, | |
cache: false, | |
dataType: "html", | |
success: function(data) { | |
$(".lookbook_details").html(data); | |
} | |
}); | |
}); // end on document ready | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment