Skip to content

Instantly share code, notes, and snippets.

View joe-dempsey's full-sized avatar

joe dempsey joe-dempsey

View GitHub Profile
@joe-dempsey
joe-dempsey / gist:e3f41bbbc10726802270c275580a99e2
Created February 10, 2018 09:09
related products - custom
{% if product.metafields.accentuate.show_related_custom_products %}
<!– •••••• custom related products •••••• –>
{% assign master_product = product %}
<section class="border-top section products-section">
@joe-dempsey
joe-dempsey / no index shopify
Created December 13, 2017 08:59
no index shopify
{% if template == 'page' %}
{% if page.handle == 'whatever' %}
<meta name="robots" content="noindex,follow" />
{% endif %}
{% endif %}
@joe-dempsey
joe-dempsey / stock alert shopify
Created December 7, 2017 11:58
stock alert shopify
//here we have some code for showing when a variant is in stock.
{% assign variant = product.variants.first %}
{% if product.variants.size == 1%}
{% comment %} no variants {% endcomment %}
{% if variant.available %}
<div class="stock_alert" >
<i class="fa fa-check" aria-hidden="true"></i> In Stock
@joe-dempsey
joe-dempsey / modal in shopify order conf page
Created November 24, 2017 09:10
Modal/popup in Shopify order confirmation.
{% assign warranty = false %}
{% for line in line_items %}
{% if line.sku == 'BB-WARRANTY' %}
{% assign warranty = true %}
{% endif %}
{% endfor %}
@joe-dempsey
joe-dempsey / add FAQ's in Shopify
Created October 9, 2017 12:49
FAQ's in shopify.
{% comment %}
add assets in head and trigger in footer
page.faq needs {% section 'faq' %}
below is that section content.
{% endcomment %}
<div class="ui accordion">
{% for block in section.blocks %}
@joe-dempsey
joe-dempsey / shopify-reviews.liquid
Created October 9, 2017 11:52
Google code for reviews shopify checkout
<code>
{% if customer.default_address.country | json == 'United Kingdom' %}
{% comment %}
Delivery may take up to 7 days in this case so we're doing date + 7 days and assigning it.
{% endcomment %}
{% assign seconds = 7 | times: 24 | times: 60 | times: 60 %}
<script src="https://apis.google.com/js/platform.js?onload=renderOptIn" async defer></script>
<script>
window.renderOptIn = function() {
window.gapi.load('surveyoptin', function() {
@joe-dempsey
joe-dempsey / tagged-posts.liquid
Last active July 19, 2023 10:12
Use custom layout for tagged posts with Shopify.
{% comment %}
we need a way to loop through tags to display a different blog template for tagged posts as to the general overview/archive page
doesn't seem like there's an easy way to do this but there is.
there are tow options:
{% endcomment %}
{% if current_tags %}...{% else %}...{% endif %}
@joe-dempsey
joe-dempsey / show related posts based on tags.liquid
Created August 23, 2017 11:01
related posts by tag shopify
@joe-dempsey
joe-dempsey / resizeload.js
Created August 23, 2017 09:37
resize/load event mobile
$(window).on("load resize",function(e){
if ($(window).width() < 800) {
alert('event handle called');
}
});
@joe-dempsey
joe-dempsey / latest_blog.liquid
Created August 3, 2017 13:26
latest blog posts shopify
<!-- START OF LATEST BLOG POSTS -->
<div class="latest_posts">
<div class="grid">
<div class="widget-header rte center">
<h2>Latest Blog Posts</h2>
</div>
<div class="latest-blog-posts-wrapper">
{% for article in blogs.news.articles limit: 6 %}
{% include 'article_preview', show_author: true %}