Skip to content

Instantly share code, notes, and snippets.

View karen-white's full-sized avatar

Karen White karen-white

View GitHub Profile
@karen-white
karen-white / navigation-list.html
Created January 9, 2019 23:46
Hide subcategory when all products are out of stock
{{#if children}}
<a class="navPages-action has-subMenu{{#if is_active}} activePage{{/if}}" href="{{url}}" data-collapsible="navPages-{{id}}">
{{name}} <i class="icon navPages-action-moreIcon" aria-hidden="true"><svg><use xlink:href="#icon-chevron-down" /></svg></i>
</a>
<div class="navPage-subMenu" id="navPages-{{id}}" aria-hidden="true" tabindex="-1">
<ul class="navPage-subMenu-list">
<li class="navPage-subMenu-item">
<a class="navPage-subMenu-action navPages-action" href="{{url}}">{{lang 'category.view_all.name' category=name}}</a>
</li>
{{#each children}}
@karen-white
karen-white / auth.js
Created January 15, 2019 18:01
Create Auth route
const express = require('express'),
router = express.Router(),
BigCommerce = require('node-bigcommerce');
const bigCommerce = new BigCommerce({
clientId: 'your Client Id from app registration',
secret: 'your Client Secret from app registration',
callback: 'https://your-ngrokURL/auth',
responseType: 'json'
});
@karen-white
karen-white / load.js
Created January 15, 2019 18:08
Load route
const express = require('express'),
router = express.Router(),
BigCommerce = require('node-bigcommerce');
const bigCommerce = new BigCommerce({
secret: 'your Client Secret',
responseType: 'json'
});
router.get('/', (req, res, next) => {
try {
@karen-white
karen-white / uninstall.js
Created January 15, 2019 18:10
Create the uninstall route
const express = require('express'),
router = express.Router(),
BigCommerce = require('node-bigcommerce');
const bigCommerce = new BigCommerce({
secret: 'Your Client Secret',
responseType: 'json'
});
router.get('/', (req, next) => {
try {
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; PHP's initialization file, generally called php.ini, is responsible for
; configuring many of the aspects of PHP's behavior.
; PHP attempts to find and load this configuration from a number of locations.
; The following is a summary of its search order:
@karen-white
karen-white / rateresponse.json
Last active April 3, 2019 23:44
Sample Rate Response
{
"quote_id": "sample_quote",
"messages": [],
"carrier_quotes": [
{
"carrier_info": {
"code": "usps_pitney_bowes",
"display_name": "USPS"
},
"quotes": [
@karen-white
karen-white / checkout.js
Last active June 2, 2020 20:23
Use Mutation Observer to listen for the Billing step of checkout
<script>
(function(win) {
'use strict';
var listeners = [],
doc = win.document,
MutationObserver = win.MutationObserver || win.WebKitMutationObserver,
observer;
function ready(selector, fn) {
@karen-white
karen-white / category.js
Created May 7, 2019 17:53
Infinite Scroll on Cornerstone 1.18.0
import { hooks } from '@bigcommerce/stencil-utils';
import CatalogPage from './catalog';
import $ from 'jquery';
import FacetedSearch from './common/faceted-search';
import InfiniteScroll from 'infinite-scroll';
export default class Category extends CatalogPage {
loaded() {
function infiniteScroll() {
const elem = document.querySelector('.productGrid');
{
"id": "cab646e2-e893-4328-a909-93fee3db682c",
"name": "BigCommerce Cart to Checkout to Order (Token) - TEMPLATE",
"values": [
{
"key": "my-email",
"value": "TODO",
"description": {
"content": "",
"type": "text/plain"
<script>
(function(win) {
'use strict';
var listeners = [],
doc = win.document,
MutationObserver = win.MutationObserver || win.WebKitMutationObserver,
observer;
function ready(selector, fn) {