Skip to content

Instantly share code, notes, and snippets.

View derekmorash's full-sized avatar
👽

Derek Morash derekmorash

👽
View GitHub Profile
@derekmorash
derekmorash / gulpfile.js
Last active February 13, 2023 08:04
Gulp task to compile Shopify Liquid tags in SASS with Autoprefixer
var gulp = require('gulp');
var sass = require('gulp-sass');
var replace = require('gulp-replace');
var autoprefixer = require('gulp-autoprefixer');
var concat = require('gulp-concat');
gulp.task('compilesass', function() {
// root SASS file (contains all your includes)
return gulp.src('./sass/style.scss')
// compile SASS to CSS
@derekmorash
derekmorash / percent-off-quantity.rb
Created January 10, 2018 17:22
A shopify script to give porducts with a quantity of 2 or more 10% off
Input.cart.line_items.each do |line_item|
next if line_item.variant.product.gift_card? || line_item.quantity <= 1
line_item.change_line_price(line_item.line_price * 0.90, message: "10% 2 or more")
end
Output.cart = Input.cart