Skip to content

Instantly share code, notes, and snippets.

@odessy
odessy / remove-variant.liquid
Created January 7, 2019 15:48
remove variation code
$( document ).ready(function() {
if( typeof product_variants_removed != undefined ) { // was there items to be removed?
var $addToCartForm = $('form[action="/cart/add"]');
if (window.MutationObserver && $addToCartForm.length) {
if (typeof observer === 'object' && typeof observer.disconnect === 'function') {
observer.disconnect();
}
var config = { childList: true, subtree: true };
var observer = new MutationObserver(function() {
product_variants_removed.forEach(function(item){
@odessy
odessy / product.liquid
Created January 16, 2019 14:53
move share icon on product page to below main image
<div itemscope itemtype="http://schema.org/Product" class="product-page">
<div class="wrapper">
<meta itemprop="url" content="{{ shop.url }}{{ product.url }}">
<meta itemprop="image" content="{{ product.featured_image.src | img_url: 'grande' }}">
{% if section.settings.product_breadcrumbs %}
{% include 'breadcrumb' %}
{% endif %}
$(document).ready(function() {
thumbnails = $('#ProductThumbs-product img[src*="/products/"]');
if (thumbnails.length) {
thumbnails.on('click', function() {
var arrImage = $(this).attr('src').split('?')[0].split('.');
var strExtention = arrImage.pop();
var strRemaining = arrImage.pop()
.replace(/_(pico|icon|thumb|small|compact|medium|large|grande)/gi, '')
.replace(/_[a-zA-Z0-9@]+$/,'');
var strNewImage = arrImage.join('.')+"."+strRemaining+"."+strExtention;
@odessy
odessy / theme.css
Last active March 31, 2019 16:14
pipeline product thumbs to the left of main product image.
@media only screen and (min-width:768px){
.product__thumbs--square{
float: left;
width: 100px;
}
.product__thumbs--square .slick-dots li img,
.product__thumbs--square .slick-dots li{
width: 100px !important;
height: 100px !important;
[vc_row type="full_width_background" full_screen_row_position="middle" equal_height="yes" content_placement="middle" bg_color="#111111" scene_position="center" text_color="light" text_align="left" overlay_strength="0.3" shape_divider_position="bottom" bg_image_animation="none"][vc_column column_padding="no-extra-padding" column_padding_position="top-bottom" background_color_opacity="1" background_hover_color_opacity="1" column_link_target="_self" column_shadow="none" column_border_radius="none" width="1/2" tablet_width_inherit="default" tablet_text_alignment="default" phone_text_alignment="default" column_border_width="none" column_border_style="solid" bg_image_animation="none"][divider line_type="No Line" custom_height="90"][vc_row_inner column_margin="default" text_align="left"][vc_column_inner column_padding="no-extra-padding" column_padding_position="all" background_color_opacity="1" background_hover_color_opacity="1" column_shadow="none" column_border_radius="none" column_link_target="_self" width="1/1"
@odessy
odessy / call-to-action.js
Last active January 22, 2019 23:09
make call to action sticky
jQuery(function($) {
var $window = $(window),
ctaPosition = parseInt($('#call-to-action').offset().top) - parseInt($('#call-to-action').height()) - window.innerHeight,
cta = $('#call-to-action');
// Run this on scroll events.
$window.scroll(function() {
console.log( $window.scrollTop() + ' - ' + ctaPosition );
if ( $window.scrollTop() < ctaPosition ) {
// Make the div sticky.
@odessy
odessy / product-snipet.liquid
Created January 24, 2019 17:34
also add spit after tabs
{%- if product.description contains '[split]' and section.settings.tabs_position == 'sidebar' -%}
<div class="wrapper">
<div class="product-description rte" itemprop="description">
{{ product.description | replace: '<p>[split]</p>', '[split]' | split: '[split]' | last }}
</div>
</div>
{%- endif -%}
@odessy
odessy / product-tabs.liquid
Created January 24, 2019 17:55
change to product_description_split variable <!-- /snippets/product-tabs.liquid -->
{%- assign product_description_split = product.description | replace: '<p>[split]</p>', '[split]' | split: '[split]' | first | replace: '<h6></h6>', '' -%}
@odessy
odessy / theme.scss
Created January 27, 2019 15:25
desktop nav cart image
/* desktop nav cart image*/
.nav--desktop .cart-text-link a{
background: url("{{ 'cart.svg' | asset_url }}") no-repeat left 0 center;
width: 25px;
height: 25px;
top: 5px;
position: relative;
.cartCost{
margin-left: 25px;
top: -5px;
@odessy
odessy / gist:59a2f95fe7822a53d8785b251bd30930
Last active July 12, 2021 20:53
Pipeline 4 swap header cart and hamburger
/* swap header cart and hamburger */
.nav--mobile .header-cart,
.nav--mobile .header-cart__bubble {
right:0;
left: auto;
}
.nav--mobile .header-hamburger {
left: 0;
right: auto;
}