Skip to content

Instantly share code, notes, and snippets.

View projoomexperts's full-sized avatar

projoomexperts

View GitHub Profile
<!-- /snippets/product-grid-item.liquid -->
{% comment %}
This snippet is used to showcase each product during the loop,
'for product in collection.products' in collection.liquid.
A liquid variable (grid_item_width) is set just before the this
snippet is included to change the size of the container.
Once the variable is set on a page, all future instances of this
snippet will use that width. Overwrite the variable to adjust this.
<!-- /templates/page.contact.liquid -->
<div class="grid">
<div class="grid__item large--five-sixths push--large--one-twelfth">
<header class="section-header text-center">
<h1>{{ page.title }}</h1>
<hr class="hr--small">
</header>
(function ($) {
'use strict';
$.ajaxChimp = {
responses: {
'We have sent you a confirmation email' : 0,
'Please enter a value' : 1,
'An email address must contain a single @' : 2,
'The domain portion of the email address is invalid (the portion after the @: )' : 3,
'The username portion of the email address is invalid (the portion before the @: )' : 4,
<div class="Block Panel" id="SearchTabProducts">
<div id="SearchResultsCategoryAndBrand" style="display: %%GLOBAL_HideSearchResultsCategoryAndBrand%%">
<div id="SearchResultsCategory" style="display: %%GLOBAL_HideSearchResultsCategory%%" class="ptm">
%%LNG_SearchedForCategories%% %%GLOBAL_SearchResultsCategory%%
</div>
<div id="SearchResultsBrand" style="display: %%GLOBAL_HideSearchResultsBrand%%">
%%LNG_SearchedForBrands%% %%GLOBAL_SearchResultsBrand%%
</div>
</div>
<div class="header-nav">
<a class="btn icon browse {% if section and section.settings.hero_show_nav == false %}hidden-in-desktop{% endif %}" data-action="toggle-browse"><i class="fa fa-bars"></i></a>
{% unless section and section.settings.hero_show_search == false %}
{% unless template == 'customers/login' or template == 'customers/register' %}
<form class="searchbox searchbox-open" action="/search" method="get" role="search">
<input type="hidden" name="type" value="product">
.searchbox{
position:relative;
min-width:25px;
width:0%;
height:24px;
float:right;
overflow:hidden;
-webkit-transition: width 0.3s;
-moz-transition: width 0.3s;
<div class="slide slide-{{ block.id }}" data-index="{{ slide_index }}" {{ block.shopify_attributes }}>
{% capture current %}{% cycle 2, 1 %}{% endcapture %}
{% if block.settings.image != blank %}
{% include 'set-slide-background' %}
{% else %}
<div class="placeholder-background">
{{ 'lifestyle-' | append: current | placeholder_svg_tag: 'placeholder-svg' }}
</div>
{% endif %}
<div class="layer opacity_{{ section.settings.overlay_opacity }}"></div>
<script>
$(document).ready(function() {
$(".ProductList li").each(function(){
var $product = $(this);
var productURL = $(".ProductDetails a", this).attr("href");
$.get(productURL , function(data) {
var shippingText = $(data).find('.shipping-info .Value').text();
if($.trim(shippingText) == "Free Shipping"){
$product.prepend('<div class="free-shipping-label">Free Shipping</div>');
}
{% if section.blocks.size > 0 %}
<div class="index-section">
<div class="collections" id="collections--{{ section.id }}" data-section-id="{{ section.id }}" data-section-type="collections-section">
<ul class="collection-grid">
{% for block in section.blocks %}
{% if block.settings.image != blank %}
<li id="collection--{{ block.id }}">
<a href="{{ block.settings.link }}">
{{ block.settings.image | img_url: '2048x' | img_tag: block.settings.image.alt }}
</a>
@projoomexperts
projoomexperts / gist:ef7fe6522c6989e611bca4b578f585aa
Created July 20, 2017 18:52
Bigcommerce left menu add active class
var url = window.location.href;
jQuery('.Left .sf-menu li a').each(function(){
var gthis = jQuery(this);
var furl = gthis.attr('href');
if (furl == url){
gthis.parent().addClass('active-ul');
}
})