Instantly share code, notes, and snippets.

Levin Mejia levinmejia

View GitHub Profile
View api-key.html
<head>
<script src="https://cdn.shopify.com/s/assets/external/app.js"></script>
<script type="text/javascript">
ShopifyApp.init({
apiKey: 'YOUR_APP_API_KEY',
View head-tag.html
<head>
<script src="https://cdn.shopify.com/s/assets/external/app.js"></script>
...
</head>
View shopify-b2b
{% comment %}
Source: https://gist.github.com/carolineschnapp/9122054
If you are not on a collection page, do define which collection to use in the order form.
Use the following assign statement, replace 'your-collection-handle-here' with your collection handle.
{% assign collection = collections.your-collection-handle-here %}
Use the assign statement outside of this comment block at the top of your template.
{% endcomment %}
{% paginate collection.products by 100 %}
View metafield-2.liquid
Input:
{% assign instructions = product.metafields.instructions %}
{% assign key = 'Dry' %}
<p>Drying instructions: {{ instructions.Dry }}.</p>
Output:
View metafield.liquid
Input:
{% assign instructions = product.metafields.instructions %}
{% assign key = 'Wash' %}
<p>Washing instructions: {{ instructions.Wash }}.</p>
Output:
View cart-page.liquid
<header class="section-header text-center">
<h1>{{ 'cart.general.title' | t }}</h1>
</header>
<style>
body.template-cart h1 {
font-family: 'Helvetica Neue', Helvetica, sans-serif;
font-weight: 600;
font-size: 40px;
text-align: left;
View social-settings-schema.json
{
"name": "Social media",
"settings": [
{
"type": "header",
"content": "Accounts"
},
{
"type": "text",
"id": "social_facebook_link",
View footer.liquid
View related-products.liquid
View product-card.liquid
<!-- /snippets/product-card.liquid -->
{% comment %}
The product card snippet is passed a liquid object, used in this file
as "product". The object is either "product" or "item", the latter if
it is from search results.
{% endcomment %}
<a href="{{ product.url | within: collection }}" class="product-card">
<div class="product-card__image-wrapper">