Skip to content

Instantly share code, notes, and snippets.

View haroldao's full-sized avatar
🎯
Design + Dev

Harold AO haroldao

🎯
Design + Dev
View GitHub Profile
@atikju
atikju / related-articles.liquid
Created February 25, 2021 11:24
Show related articles based on article tags - Shopify
@pablogiralt
pablogiralt / shopify-brooklyn-theme-size-guide.md
Last active February 19, 2021 17:44
Add a size guide to Shopify Brooklyn Theme

Add Size Guide to Shopify Brooklyn Theme

This is what you get:

1- A link to below the variant selector which will open the size guide:

Shopify Brooklyn Theme Size Guide

2- The size selector modal:

@adamwooding
adamwooding / product-template-enquiry.liquid
Created November 6, 2020 22:18
Shopify Minimal Theme - sections template with no prices and enquiry form
<div itemscope itemtype="http://schema.org/Product" id="ProductSection" data-section-id="{{ section.id }}" data-section-type="product-template" data-image-zoom-type="{{ section.settings.product_image_zoom_type }}" data-show-extra-tab="{{ section.settings.show_extra_tab }}" data-extra-tab-content="{{ section.settings.extra_tab_content }}" data-enable-history-state="true">
{% case section.settings.add_to_cart_width %}
{% when 'small' %}
{%- assign btn_class = 'btn--wide' -%}
{%- assign productform_class = 'product-form--wide' -%}
{% when 'medium' %}
{%- assign btn_class = 'btn--wide' -%}
{%- assign productform_class = 'product-form--wide' -%}
{% when 'large' %}
@joePichardo
joePichardo / shopify-use-case-option-selection.html
Created September 28, 2020 14:27
Shopify option_selection.js usage
{{ 'option_selection.js' | shopify_asset_url | script_tag }}
<script>
// <![CDATA[
var selectCallback = function(variant, selector) {
if (variant) {
if (variant.available) {
// Selected a valid variant that is available.
$('#add-to-cart-button').removeClass('disabled').removeAttr('disabled').html('Add to Cart');
} else {
import * as React from "react";
import { useMousePosition } from "~/hooks/useMousePosition";
/** Component to cover the area between the mouse cursor and the sub-menu, to allow moving cursor to lower parts of sub-menu without the sub-menu disappearing. */
export function MouseSafeArea(props: { parentRef: React.RefObject<HTMLDivElement> }) {
const { x = 0, y = 0, height: h = 0, width: w = 0 } = props.parentRef.current?.getBoundingClientRect() || {};
const [mouseX, mouseY] = useMousePosition();
const positions = { x, y, h, w, mouseX, mouseY };
return (
<div
@hobo71
hobo71 / floating-animation-css.markdown
Created July 30, 2020 01:35
Floating Animation - CSS
@rleaf
rleaf / background-noise-canvas.markdown
Created February 8, 2020 05:09
Background Noise - Canvas
@akella
akella / setup.md
Last active April 15, 2025 10:38
My Setup
@willbroderick
willbroderick / search.json.liquid
Last active December 13, 2021 18:08
Drop-in fallback template for Shopify Predictive Search API
{%- layout none -%}
{%- paginate search.results by 6 -%}
{%- capture products_output -%}
{%- for result in search.results -%}
{%- if result.object_type == 'product' -%}
,{"title":{{ result.title | json }},"url":{{ result.url | json }}
{%- if result.images and result.images.size > 0 -%}
,"image":{{ result.images[0] | img_url: 'master' | json }}
{%- endif -%}
,"vendor":{{ result.vendor | json }},"price_max":{{ result.price_max }},"price_min":{{ result.price_min }},"compare_at_price_min":{{ result.compare_at_price_min }}}
@enamhasan
enamhasan / mailchimp-newsletter-ajax-signup
Last active July 13, 2022 15:30
Mailchimp-Shopify-Ajax-submission
<div class="success" style="display: none;">{{ settings.success_message }}</div>
{%- if settings.newsletter_form_action != "" -%}
<form id="mc4wp-form-footer" name="nlr" class="mc4wp-form mc4wp-form-{{block.id}} mc4wp-form-basic" method="get" action="{{ settings.newsletter_form_action }}" target="_blank" data-id="{{block.id}}">
<div class="mc4wp-form-fields">
<p class="mailchimp-input-icon">
<label>Email address: </label>
<input type="email" name="EMAIL" placeholder="{{ 'general.newsletter_form.email_placeholder' | t }}" value="{%- if customer -%}{{ customer.email }}{%- endif -%}" required="">
</p>
<p>
<input type="submit" value="{{ 'general.newsletter_form.submit' | t }}">