Skip to content

Instantly share code, notes, and snippets.

Avatar
👽

Derek Morash derekmorash

👽
  • Halifax Nova Scotia
View GitHub Profile
@derekmorash
derekmorash / percent-off-quantity.rb
Created Jan 10, 2018
A shopify script to give porducts with a quantity of 2 or more 10% off
View percent-off-quantity.rb
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
@derekmorash
derekmorash / gulpfile.js
Last active Sep 16, 2022
Gulp task to compile Shopify Liquid tags in SASS with Autoprefixer
View gulpfile.js
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