This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'woocommerce_calculated_total', 'modify_cart_total_by_payment_method', 10, 2 ); | |
| function modify_cart_total_by_payment_method( $total, $cart ) { | |
| $chosen_payment_method = WC()->session->get( 'chosen_payment_method' ); | |
| switch ( $chosen_payment_method ) { | |
| case 'bacs': | |
| $total += 2; | |
| break; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Showcase Demo</title> | |
| <style> | |
| body, | |
| html { | |
| padding: 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| development: | |
| password: your-password-from-the-private-app-on-dev-store | |
| theme_id: "1111111111" | |
| store: dev-store.myshopify.com | |
| ignore_files: | |
| - config/settings_data.json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Super simple throttle function. | |
| // Works in most cases, but doesn't work if need to capture the last call | |
| // Assume f already has the right context attached. E.g. throttle(f.bind(context), 500) | |
| function throttle(f, t) { | |
| let inThrottle; | |
| return function(args) { | |
| if(!inThrottle) { | |
| f(args); | |
| inThrottle = true; | |
| setTimeout(() => inThrottle = false, t) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {%if settings.enableCloudinary and settings.cloudinaryUrl != blank %} | |
| {% assign baseUrl = settings.cloudinaryUrl %} | |
| {%if img contains "?" %} | |
| {% assign imgUrl = img | split: "?" %} | |
| {% assign fetchQuery = "?" | append: imgUrl.last | url_encode %} | |
| {% assign fetchUrl = imgUrl.first | append: fetchQuery %} | |
| {% else %} | |
| {% assign fetchUrl = img %} | |
| {% endif %} | |
| {%if transformation and transformation !=blank %} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function sessionStorageOk() { | |
| const test = "test"; | |
| try { | |
| sessionStorage.setItem(test, test); | |
| sessionStorage.removeItem(test); | |
| return true; | |
| } catch (e) { | |
| return false; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function throttle(func, wait) { | |
| let last, timer; | |
| return function() { | |
| const now = +new Date; | |
| const args = arguments; | |
| const context = this; | |
| if(last && now < last + wait) { | |
| clearTimeout(timer); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function debounce(func, wait) { | |
| let timer = null; | |
| return function() { | |
| let context = this; | |
| let args = arguments; | |
| clearTimeout(timer); | |
| timer = setTimeout(function() { | |
| func.apply(context, args); | |
| }, wait); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ---- | |
| // libsass (v3.2.5) | |
| // ---- | |
| // In variables.scss | |
| // Only place where colours need to be managed | |
| $colors: ( | |
| green: #37AC47, | |
| red: #EB3C3C, | |
| yellow: #F3B241, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "NPM Build example", | |
| "description": "Based on this article: http://blog.keithcirkel.co.uk/how-to-use-npm-as-a-build-tool/", | |
| "version": "0.0.1", | |
| "private": true, | |
| "scripts": { | |
| "test": "node_modules/karma/bin/karma start", | |
| "test-once": "node_modules/karma/bin/karma start --single-run", | |
| "lint": "jsxhint js", | |
| "clean": "rm -r static/* && mkdirp static/js && mkdirp static/css", |
NewerOlder