Skip to content

Instantly share code, notes, and snippets.

gje4 / handler.js
Created September 25, 2023 19:55
View handler.js
'use strict';
const BigCommerce = require("node-bigcommerce");
const request = require("request-promise");
async function getProductData(productId) {
const options = {
method: "GET",
uri: `${process.env.STORE_HASH}/v3/catalog/products/${productId}?include=primary_image`,
View Live_Person_Order_Confirmation
// Fetch Order Data
fetch('/api/storefront/order/{{}}', {
credentials: 'include'
}).then(function (response) {
return response.json();
}).then(function (orderData) {
const orderDate =;
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')
const bigCommerceV3 = new BigCommerce({
logLevel: 'info',
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) {
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": ""}, {"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": ""}, {"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": ""}, {"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": "
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=""></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:
- master
vmImage: ‘Ubuntu-16.04’
- 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 );