This file contains 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
const dateCreated = Math.round(new Date().getTime() / 1000) | |
const payload = { | |
iss: config.storeApiClientId, | |
iat: dateCreated, | |
jti: uuid(), | |
operation: 'customer_login', | |
store_hash: config.storeHash, | |
customer_id: customerId, | |
channel_id: config.storeChannelId, | |
redirect_to: data.checkout_url, |
This file contains 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
import type { CheckoutEndpoint } from '.' | |
import getCustomerId from '../../utils/get-customer-id' | |
import jwt from 'jsonwebtoken' | |
import { uuid } from 'uuidv4' | |
import { getShopTokenFromRequest } from '@lib/auth/utils' | |
const fullCheckout = true | |
const checkout: CheckoutEndpoint['handlers']['checkout'] = async ({ req, res, config }) => { | |
const { cookies } = req |
This file contains 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
'use strict'; | |
const BigCommerce = require("node-bigcommerce"); | |
const request = require("request-promise"); | |
const { BLOOMREACH_ACCOUNT_ID, BLOOMREACH_AUTH_KEY, BLOOMREACH_DOMAIN_KEY } = process.env; | |
async function getProductData(productId) { | |
const options = { | |
method: "GET", | |
uri: `https://api.bigcommerce.com/stores/${process.env.STORE_HASH}/v3/catalog/products/${productId}?include=primary_image`, |
This file contains 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
<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', |
This file contains 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
// @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, |
This file contains 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
` 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.
This file contains 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
"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 |
This file contains 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
{[{"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 |
This file contains 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
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 |
This file contains 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
<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 |
NewerOlder