Skip to content

Instantly share code, notes, and snippets.

View Live_Person_Order_Confirmation
<script>
// Fetch Order Data
fetch('/api/storefront/order/{{checkout.order.id}}', {
credentials: 'include'
}).then(function (response) {
return response.json();
}).then(function (orderData) {
const orderDate = Date.now();
const requestOptions = {
method: 'POST',
View build-algolia-data.tsx
// @ts-ignore
const dotenv = require('dotenv')
const algoliasearch = require('algoliasearch/lite')
const BigCommerce = require('node-bigcommerce')
dotenv.config()
const bigCommerceV3 = new BigCommerce({
logLevel: 'info',
clientId: process.env.BIGCOMMERCE_STORE_API_CLIENT_ID,
View url-query-search.js
` const parent = document.links;
let data = sessionStorage.getItem('state');
const params = new URL(window.location.href).searchParams;
if(params.get('available_state')) {
for (const link of parent) {
console.log(link);
link.href+="?_bc_fsnf=1&available_state="+data
}
}
View sampleBigCommerce.csv
We can make this file beautiful and searchable if this error is corrected: Unclosed quoted field in line 2.
"Product ID","Product Type",Code,Name,Brand,Description,"Cost Price","Retail Price","Sale Price","Calculated Price","Fixed Shipping Price","Free Shipping",Warranty,Weight,Width,Height,Depth,"Allow Purchases","Product Visible","Product Availability","Product Inventoried","Stock Level","Low Stock Level","Date Added","Date Modified","Category Details",Images,"Page Title","META Keywords","META Description","Product Condition","Product URL","Redirect Old URL?","Product Tax Code","Product Custom Fields"
234,P,BCZIPHOODIE,"Bigcommerce Zip-Up Hoodie","BC SWAG","Stay warm with this Bigcommerce zip-up hoodie. Winter is coming, but we've got selling to do! ",50.00,0.00,0.00,100.00,0.0000,N,,0.0000,10.0000,12.0000,4.0000,Y,Y,,N,0,0,02/05/2018,17/03/2021,"Category Name: Member, Category Path: Member|Category Name: Women, Category Path: Women|Category Name: Shirts, Category Path: Shirts|Category Name: Men, Category Path: Men|Category Name: pants, Category Path: pants|Category Name: Loungewear, Category Path: Accessories/Lo
View example.json
{[{"sku": "401866", "option_values": [{"label": "Dazzle Melange", "option_display_name": "Color"}, {"label": "36 C", "option_display_name": "Size"}], "price": "30.00", "weight": "120", "image_url": "http://step-assetpush.s3.amazonaws.com/5028474_DAZ01.jpg"}, {"sku": "401869", "option_values": [{"label": "Dazzle Melange", "option_display_name": "Color"}, {"label": "34 D", "option_display_name": "Size"}], "price": "30.00", "weight": "120", "image_url": "http://step-assetpush.s3.amazonaws.com/5028474_DAZ01.jpg"}, {"sku": "401870", "option_values": [{"label": "Dazzle Melange", "option_display_name": "Color"}, {"label": "36 D", "option_display_name": "Size"}], "price": "30.00", "weight": "120", "image_url": "http://step-assetpush.s3.amazonaws.com/5028474_DAZ01.jpg"}, {"sku": "419674", "option_values": [{"label": "Stardust Melange/Cosmic", "option_display_name": "Color"}, {"label": "34 C", "option_display_name": "Size"}], "price": "35.00", "weight": "120", "image_url": "http://step-assetpush.s3.amazonaws.com/502847
View loginview.tsx
import { FC, useEffect, useState, useCallback } from 'react'
import { Logo, Button, Input } from '@components/ui'
import useLogin from '@framework/use-login'
import { useUI } from '@components/ui/context'
import { validate } from 'email-validator'
interface Props {}
const LoginView: FC<Props> = () => {
// Form State
View Customerpaymentmethods.js
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js"></script>
<script>
var obs = new MutationObserver(function(mutations, observer) {
$.each(mutations, function(i, mutation) {
var addedNodes = $(mutation.addedNodes);
var selector = "form, .checkout-step-info";
var filteredEls = addedNodes.find(selector).addBack(selector);
filteredEls.each(function() {
//get customer and adjust payment methods
View Azure Stencil Dev Deploy
# Node.js
# Build a general Node.js project with npm.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
trigger:
- master
pool:
vmImage: ‘Ubuntu-16.04’
steps:
- task: NodeTool@0
View channel_wordpress.php
add_filter( 'bigcommerce/channels/enable-multi-channel', '__return_true' );
if (function_exists('geoip_detect2_get_info_from_current_ip')) {
$userInfo = geoip_detect2_get_info_from_current_ip();
do_action( 'php_console_log', $userInfo->country->isoCode );
if ($userInfo->country->isoCode == 'ES') {
add_filter( 'bigcommerce/channel/current', function( $channel ) {
// logic to set the channel
return get_term( 33, \BigCommerce\Taxonomies\Channel\Channel::NAME );
}, 10, 1 );
View tax_product.js
// all variable defines here
var pageLoading = 1;
var cartId = '';
var taxProductId = 118;
//var canadaState = '';
var paymentStep = 1;
localStorage.removeItem("taxProduct");
localStorage.removeItem('taxProductId');