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
import React from "react" | |
import Layout from "../components/layout" | |
import ReactDOM from "react-dom" | |
import Embedcheckout from "../components/embedcheckout" | |
export default () => { | |
function testing(){if(typeof window !== 'undefined'){ | |
console.log('windowstaturl',window.history.state.checkoutData.data.embedded_checkout_url) | |
return window.history.state.checkoutData.data.embedded_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
<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 |
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 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() { | |
//ADD EXTRA FIELD to SHIPPING OPTIONS |
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
/* eslint-disable */ | |
import React from "react"; | |
import ReactDOM from "react-dom"; | |
import PageManager from "../page-manager"; | |
import ApolloClient from "apollo-boost"; | |
import gql from "graphql-tag"; | |
function getProducts(token, productIds) { | |
const client = new ApolloClient({ |
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 he = require("he"); | |
const _ = require("lodash"); | |
const request = require("request-promise"); | |
//use for invetory | |
var BigCommerce = require("node-bigcommerce"); | |
var bigCommerce = new BigCommerce({ |
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 request = require("request-promise"); | |
async function getOrderData(orderDataId) { | |
const options = { | |
method: "GET", | |
uri: `https://api.bigcommerce.com/stores/XXXX/v2/orders/${orderDataId}`, | |
headers: { | |
accept: "application/json", |
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> | |
//Add calander | |
<script src="https://unpkg.com/js-datepicker"></script> | |
//Add Calander script you want to use | |
<script> | |
//observe timmer to ensure element is present to add calander on after | |
var obs = new MutationObserver(function(mutations, observer) { | |
$.each(mutations, function(i, mutation) { | |
var addedNodes = $(mutation.addedNodes); |
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 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', |
NewerOlder