Skip to content

Instantly share code, notes, and snippets.

View rickydazla's full-sized avatar

Rick Davies rickydazla

View GitHub Profile
@rickydazla
rickydazla / collections.liquid.html
Created December 17, 2011 05:42 — forked from davecap/collections.liquid.html
"Infinite" (non-auto) scrolling in Shopify collections
{% paginate collection.products by 20 %}
<ul class="collection-matrix">
{% for product in collection.products %}
<li id="product-{{ forloop.index | plus:paginate.current_offset }}">
{% include 'product' with product %}
</li>
{% endfor %}
<li class="top"><a href="#collectionpage">Back to Top</a> &uarr;</li>
{% if paginate.next %}
<li class="more">&darr; <a href="{{ paginate.next.url }}">More</a></li>
@rickydazla
rickydazla / redirect.liquid
Last active May 3, 2023 13:04
Liquid Re-Direct Snippet
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="1;url={{ redirect }}">
<script type="text/javascript">
window.top.location.href = "{{ redirect }}"
</script>
<title>Page Redirection</title>
</head>
@rickydazla
rickydazla / ajax-submit-form.js
Created December 10, 2015 03:13
Shopify AJAX Form submit
/* Build the Shopify Parameters
//---------------------------------------*/
var action = '/contact?';
action += encodeURIComponent('form_type') +'='+ encodeURIComponent('contact');
action += '&'+ encodeURIComponent('utf8') +'='+ encodeURIComponent('✓');
action += '&'+ encodeURIComponent('contact[email]') +'='+ encodeURIComponent(contact_email);
action += '&'+ encodeURIComponent('contact[body]') +'='+ encodeURIComponent(contact_body);
/* Submit the form
//---------------------------------------*/
@rickydazla
rickydazla / addthis_shopify.html
Last active December 11, 2021 23:40
Custom addthis widget for Shopify using SymbolSet Social Icon fonts
<div class="addthis_toolbox" addthis:url="{{ shop.url }}{{ product.url }}" addthis:title="{{ page_title }} | {{ shop.name }}" addthis:description="{{ page_description }}">
<div class="tricky-sharing">
<a class="addthis_button_facebook"><i class="ss-facebook"></i></a>
<a class="addthis_button_twitter"><i class="ss-twitter"></i></a>
<a class="addthis_button_pinterest ss-icon ss-pinterest" pi:pinit:media="{{ product.images[0] | product_img_url: '1024x1024' }}"></a>
<!-- you can also try addthis_button_pinterest_share if above doesn't work! -->
</div>
</div>
var KlaviyoSubscribe = KlaviyoSubscribe || {};
(function() {
if (!KlaviyoSubscribe._loaded) {
KlaviyoSubscribe._loaded = !0;
var m = {
"modal.html": '<div class="klaviyo_modal" style="display:none;"><div class="klaviyo_inner"><a href="#" class="klaviyo_close_modal klaviyo_header_close">&times;</a><form action="" method="POST" novalidate="novalidate" class="klaviyo_subscription_form"><input type="hidden" name="g" value="" /><p class="klaviyo_header"></p><p class="klaviyo_subheader"></p><div class="klaviyo_fieldset"></div><div class="klaviyo_fine_print"></div><div class="klaviyo_form_actions"><button type="submit" class="klaviyo_submit_button"><span></span></button></div><div class="klaviyo_below_submit"></div><div class="error_message" style="display:none;"></div></form><div class="success_message" style="display:none;"></div></div></div>',
"flyout.html": '<div class="klaviyo_flyout" style="display:none;"><div class="klaviyo_inner"><div class="klaviyo_topbar" /><a href="#" class="klav
@rickydazla
rickydazla / collections.liquid.html
Created November 24, 2011 04:12 — forked from davecap/collections.liquid.html
"Infinite" scrolling in Shopify collections
{% paginate collection.products by 20 %}
<ul class="collection-matrix">
{% for product in collection.products %}
<li id="product-{{ forloop.index | plus:paginate.current_offset }}">
{% include 'product' with product %}
</li>
{% endfor %}
<li class="top"><a href="#collectionpage">Back to Top</a> &uarr;</li>
{% if paginate.next %}
<li class="more">&darr; <a href="{{ paginate.next.url }}">More</a></li>

Getting out on Monday...

  • Brooke and Juicy Lou meeting R&K @ Camp Avo. ~9am
  • Distribute provisions and hit the road

🚦 Probable route (101, I-5, CA-99, CA-180) stopping at:

  • ℹ️ Hume Lake Ranger District Office for campfire permits and info about:
    • Western & Eastern Big Meadows Road: dispersed road-side sites > "Many big free sites, some with picnic tables and fire rings, views of the mountains and the sunsets were mind blowing. Very quiet."
{% comment %}
See here for getting Conversion ID and Label
https://www.en.advertisercommunity.com/t5/AdWords-Tracking-and-Reporting/Finding-you-Google-Adwords-Conversion-ID/td-p/1119060#
{% endcomment %}
{% if first_time_accessed %}
{% assign google_conversion_id = 123456 %}
{% assign google_conversion_label = 'xyz789' %}
{% assign shopify_store_country = 'US' %}
<script type="text/javascript">
var google_tag_params = {
@rickydazla
rickydazla / shopify_view-all.js
Created December 21, 2011 19:45
Shopify View All (wtf? seriously!)
/*------------------------View all button script----------------------------------------------*/
var _PageUrls = [];
var _Index = 0;
function loadUrlInAjax(url,requestType,dataType,functionToBeExecutedBefore,functionToBeExecutedAfter){
$.ajax({
type: requestType,
url: url,
beforeSend: function(){
//functionToBeExecutedBefore();
},
@rickydazla
rickydazla / product-grid-item.liquid
Last active December 17, 2017 02:16
Shopify Collection thumbnail:hover image swap
<a href="{{ product.url | within: collection }}">
{% assign imgSize = 'medium' %}
{% assign canSwap = false %}
{% if product.images.size > 1 %}
{% assign canSwap = true %}
{% assign swapImg = product.images[1] %}
{% assign swapImgSrc = swapImg.src | product_img_url: imgSize %}
{% assign swapImgAlt = swapImg.alt | escape %}
{% endif %}
<img{% if canSwap %} class="has-swap"{% endif %} src="{{ product.featured_image.src | product_img_url: imgSize }}" alt="{{ product.featured_image.alt | escape }}">