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
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 ); |
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
// all variable defines here | |
var pageLoading = 1; | |
var cartId = ''; | |
var taxProductId = 118; | |
//var canadaState = ''; | |
var paymentStep = 1; | |
localStorage.removeItem("taxProduct"); | |
localStorage.removeItem('taxProductId'); |
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"); | |
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, |
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
'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', |
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
class LocalStorageFactory { | |
constructor() { | |
if (typeof localStorage === 'undefined' || localStorage === null) { | |
const { LocalStorage } = require('node-localstorage') | |
this.localStorage = new LocalStorage('./localStorage') | |
} else { | |
this.localStorage = window.localStorage | |
} | |
} |
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
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
'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', |
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', |