Skip to content

Instantly share code, notes, and snippets.

View anilmeena's full-sized avatar

Anil Meena anilmeena

View GitHub Profile
@anilmeena
anilmeena / slider.css
Last active September 21, 2018 09:24
SS Assets
@font-face{font-family:'Muli';font-style:normal;font-weight:400;src:local("Muli Regular"),local("Muli-Regular"),url(https://fonts.gstatic.com/s/muli/v11/7Auwp_0qiz-afTLGKA.ttf) format("truetype")}@font-face{font-family:'Muli';font-style:normal;font-weight:700;src:local("Muli Bold"),local("Muli-Bold"),url(https://fonts.gstatic.com/s/muli/v11/7Au_p_0qiz-adYnjOCX2yg.ttf) format("truetype")}@font-face{font-family:'Open Sans';font-style:italic;font-weight:600;src:local("Open Sans SemiBold Italic"),local("OpenSans-SemiBoldItalic"),url(https://fonts.gstatic.com/s/opensans/v15/memnYaGs126MiZpBA-UFUKXGUdhrIqY.ttf) format("truetype")}@font-face{font-family:'Open Sans';font-style:normal;font-weight:400;src:local("Open Sans Regular"),local("OpenSans-Regular"),url(https://fonts.gstatic.com/s/opensans/v15/mem8YaGs126MiZpBA-UFVZ0e.ttf) format("truetype")}@font-face{font-family:'Open Sans';font-style:normal;font-weight:700;src:local("Open Sans Bold"),local("OpenSans-Bold"),url(https://fonts.gstatic.com/s/opensans/v15/mem5YaG
@anilmeena
anilmeena / functions.php
Created February 20, 2018 12:02
Adding different classes to anchor in WordPress navigation menu
<?php
/* Add this code to your theme's functions.php file */
function my_walker_nav_menu_start_el($item_output, $item, $depth, $args) {
// you can put your if statements in here (use item, depth and args in conditions)
if ( $depth == 1 ) {
$item_output = preg_replace('/<a /', '<a class="level-1-menu" ', $item_output, 1);
} else if ( $depth == 2 )
$item_output = preg_replace('/<a /', '<a class="level-2-menu" ', $item_output, 1);
}
@anilmeena
anilmeena / theme.liquid.html
Created January 3, 2018 14:25
Auto display grid view on desktop & list view on mobile in shopify collection template
<!-- [Auto display grid view on desktop & list view on mobile in shopify collection template ] -->
<script>
function responsiveFn() {
width = jQuery( window ).width();
height = jQuery( window ).height();
// Do a custom code here
if(width < 768){
jQuery('button[data-view = "list"]').click();
}else{
jQuery('button[data-view = "grid"]').click();
@anilmeena
anilmeena / readme.txt
Last active August 9, 2017 02:04
Security Badges 2 on shopify checkout page
Step 1: Open Shopify store Admin.
Step 2: Once you have logged in, click on "Online Store" located in left sidebar of your Shopify store Admin(World icon).
Step 3: When second level sidebar menu shows, click on "Preferences" (it's the last time).
Step 4. Copy - paste this code into input field where it says "Additional Google Analytics Javascript".
};
if(typeof Checkout === 'object'){if(typeof Checkout.$ === 'function'){(function (src) {var tagName = 'script',script = document.createElement(tagName);script.src = src;var head = document.getElementsByTagName('head')[0];head.insertBefore(script, head.childNodes[0]);})('https://rawgit.com/anilmeena/3678b97ca1a3036a25b3ee02d8e9df54/raw/8339714dd49bcaa78aba81893c5c137d66222900/shopify-security-badges-2-checkout.js');}
@anilmeena
anilmeena / readme.txt
Last active May 22, 2017 17:20
Cart Timer & security badges on shopify checkout page 2
Step 1: Open Shopify store Admin.
Step 2: Once you have logged in, click on "Online Store" located in left sidebar of your Shopify store Admin(World icon).
Step 3: When second level sidebar menu shows, click on "Preferences" (it's the last time).
Step 4. Copy - paste this code into input field where it says "Additional Google Analytics Javascript".
};
if(typeof Checkout === 'object'){if(typeof Checkout.$ === 'function'){(function (src) {var tagName = 'script',script = document.createElement(tagName);script.src = src;var head = document.getElementsByTagName('head')[0];head.insertBefore(script, head.childNodes[0]);})('https://cdn.rawgit.com/anilmeena/403a51127df288ac3877fe4b6ba25f8b/raw/6b3c022422700c35491ec098ad620f85a95b4a29/shopify-checkout-timer-security-badge-2.js');}
@anilmeena
anilmeena / readme.txt
Last active May 9, 2023 22:53
Cart Timer on shopify checkout page
Step 1: Open Shopify store Admin.
Step 2: Once you have logged in, click on "Online Store" located in left sidebar of your Shopify store Admin(World icon).
Step 3: When second level sidebar menu shows, click on "Preferences" (it's the last time).
Step 4. Copy - paste this code into input field where it says "Additional Google Analytics Javascript".
};
if(typeof Checkout === 'object'){if(typeof Checkout.$ === 'function'){(function (src) {var tagName = 'script',script = document.createElement(tagName);script.src = src;var head = document.getElementsByTagName('head')[0];head.insertBefore(script, head.childNodes[0]);})('https://cdn.rawgit.com/anilmeena/eaa5e07a69c5486a1d007e6e06f1f197/raw/bf8c8dc50f717c1c59bc9027e9aada2fab3cff7d/shopify-cart-timer-checkout.js');}
@anilmeena
anilmeena / readme.txt
Last active May 10, 2017 08:16
Security Badges on shopify checkout page
Step 1: Open Shopify store Admin.
Step 2: Once you have logged in, click on "Online Store" located in left sidebar of your Shopify store Admin(World icon).
Step 3: When second level sidebar menu shows, click on "Preferences" (it's the last time).
Step 4. Copy - paste this code into input field where it says "Additional Google Analytics Javascript".
};
if(typeof Checkout === 'object'){if(typeof Checkout.$ === 'function'){(function (src) {var tagName = 'script',script = document.createElement(tagName);script.src = src;var head = document.getElementsByTagName('head')[0];head.insertBefore(script, head.childNodes[0]);})('https://cdn.rawgit.com/anilmeena/3c2d7006f558c792623a8e0e1032a4e9/raw/e5aef095ed843ece771898e4c3e883c25d5b5faf/shopify-security-badges-checkout.js');}
@anilmeena
anilmeena / readme.txt
Last active May 10, 2017 08:21
Cart Timer & security badges on shopify checkout page
Step 1: Open Shopify store Admin.
Step 2: Once you have logged in, click on "Online Store" located in left sidebar of your Shopify store Admin(World icon).
Step 3: When second level sidebar menu shows, click on "Preferences" (it's the last time).
Step 4. Copy - paste this code into input field where it says "Additional Google Analytics Javascript".
};
if(typeof Checkout === 'object'){if(typeof Checkout.$ === 'function'){(function (src) {var tagName = 'script',script = document.createElement(tagName);script.src = src;var head = document.getElementsByTagName('head')[0];head.insertBefore(script, head.childNodes[0]);})('https://cdn.rawgit.com/anilmeena/a987697bfb81ca180359340f4ff4e6de/raw/6cea1c1a3ee7bff893f53746a9c851644ac0a121/shopify-checkout-timer-security-badge.js');}
@anilmeena
anilmeena / display-variant-inventory-on-product.html
Created April 12, 2017 10:47
Shopify Display Product Inventory of Variants
// In product.liquid, locate this code:
// {{ product.description }}
// Below that, add this:
<p id="inventory">{% assign variant = product.variants.first %}
{% if variant.available %}
{% if variant.inventory_management != '' %}
{{ variant.inventory_quantity }} in stock
{% else %}
@anilmeena
anilmeena / display-variants-dropdown-shopify-collection.liquid
Created April 8, 2017 11:00
Shopify Display Multiple Variant Drop-down on Collection Page
<form action="/cart/add" method="post" style="text-align:center;">
<select name="id">
{% for variant in product.variants %}
{% if variant.available %}
<option value="{{ variant.id }}">{{ variant.title }} - {{ variant.price | money }}</option>
{% else %}
<option disabled="disabled">{{ variant.title }} - Sold Out</option>
{% endif %}
{% endfor %}
</select>