Skip to content

Instantly share code, notes, and snippets.

View markware's full-sized avatar
👽
Working from outer space

Markware markware

👽
Working from outer space
View GitHub Profile
<script type="application/ld+json">
{{ product | structured_data }}
</script>
after this
<a href="{{ routes.root_url }}">
{%- if section.settings.logo != blank -%}
{%- if section.settings.logo -%}
{%- assign image_size = section.settings.logo_width -%}
{%- assign image_size2 = section.settings.logo_width | times: 2 -%}
<img
src="{{ section.settings.logo | image_url: width: image_size }}"
srcset="{{ section.settings.logo | image_url: width: image_size }} 1x, {{ section.settings.logo | image_url: width: image_size2 }} 2x"
Open icons.liquid and add your icons like this
after this
{%- if icon != blank -%}
{%- case icon -%}
add this
{% when 'my-icon' %}
<!-- your svg icon code -->
as many icons you want
<script>
function calculateBTU() {
// Get dimension values
const length = parseFloat(document.getElementById('length').value);
const width = parseFloat(document.getElementById('width').value);
const height = parseFloat(document.getElementById('height').value);
// Get factor values
const roomFactor = parseFloat(document.getElementById('roomType').value);
const glazingFactor = parseFloat(document.getElementById('glazing').value);
{%- comment -%}
Product Tabs (metafields only, paste directly in product template)
Uses these metafields on the product (namespace: custom):
- color
- type
- location
- attribute
{%- endcomment -%}
{%- assign keys = "color|type|location|attribute" | split: "|" -%}
Open card-article.liquid and card-article-home.liquid and
replace
{{ article.published_at | time_tag: format: 'date' }}
to
{{ article.published_at | date: "%d %B %Y" }}
In main-product.liquid L89-91 change this
{% if product.media %}
{%- liquid
assign featured_media = product.selected_or_first_available_variant.featured_media | default: product.featured_media | default: settings.product_placeholder_image
to this
{% if product.media %}
{%- liquid
assign featured_media = product.featured_media | default: settings.product_placeholder_image
Open sections/main-collection-product-grid.liquid
Next to this
{% if block.type == 'inline_card_banner' %}
change this
{% if block.settings.banner_position == product_loop.index %}
to this
{% if block.settings.banner_position == product_loop.index and block.settings.image != blank %}
<ul class="product-info-details-list">
{% if product.metafields.shopify.color-pattern.value %}
<li class="product-info-details-item product-info-details-color product-info-details-variant-field">
<span class="product-info-details-item-label">Color</span>
{% for color in product.metafields.shopify.color-pattern.value %}
<span style="margin-left:10px;" class="product-info-details-item-value">{{ color.label.value }}</span>
{% endfor %}
</li>
{% endif %}