Skip to content

Instantly share code, notes, and snippets.

'use strict'
const request = require('request-promise')
async function checkoutBC(cartData) {
// https://api.bigcommerce.com/stores/{{store_hash}}/v3/carts/{{cart_id}}/redirect_urls
const options = {
method: 'POST',
uri: `https://api.bigcommerce.com/stores/q5fk0ac2gk/v3/carts/${cartData.data.id}/redirect_urls`,
headers: {
accept: 'application/json',
` 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
}
}
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
// @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,
{[{"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
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
# 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
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 );
// all variable defines here
var pageLoading = 1;
var cartId = '';
var taxProductId = 118;
//var canadaState = '';
var paymentStep = 1;
localStorage.removeItem("taxProduct");
localStorage.removeItem('taxProductId');
@gje4
gje4 / Twilio SMS
Created September 29, 2020 14:21
"use strict";
const request = require("request-promise");
const stripe = require("stripe")(process.env.STRIPE_SECRET);
const BigCommerce = require("node-bigcommerce");
const bigCommerce = new BigCommerce({
logLevel: "info",
clientId: process.env.BC_CLIENT,
accessToken: process.env.BC_TOKEN,
storeHash: process.env.STORE_HASH,