This file contains hidden or 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
// /b2b‑checkout.js | |
import wixUsers from 'wix-users'; | |
import wixLocation from 'wix-location'; | |
import { session } from 'wix-storage-frontend'; | |
import { getMemberCheckoutProfile, createOrderFromProfile } from 'backend/b2bCheckout.jsw'; | |
const COUNTRY_NAMES = { | |
AT: 'Österreich', | |
DE: 'Deutschland', |
This file contains hidden or 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 wixUsers from 'wix-users'; | |
import { currentMember } from 'wix-members-frontend'; | |
import { | |
getOrderProfileByContactId, | |
createB2BOrderFromProfile, | |
smokeOrdersKey | |
} from 'backend/b2bCheckoutTest.web'; | |
// Fallback nur wenn nicht eingeloggt / Profil leer | |
const TESTDATA = { |
This file contains hidden or 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
// backend/b2bCheckoutTest.web.js | |
import { Permissions, webMethod } from 'wix-web-module'; | |
import wixStores from 'wix-stores-backend'; | |
import { contacts } from 'wix-crm-backend'; | |
import wixFetch from 'wix-fetch'; | |
import { getSecret } from 'wix-secrets-backend'; | |
/* ---------------------------------- Helpers ---------------------------------- */ | |
function pseudoUuid() { |
This file contains hidden or 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
// backend/b2bCheckout.jsw | |
import { currentMember } from 'wix-members-backend'; | |
import { contacts } from 'wix-crm-backend'; | |
import wixData from 'wix-data'; | |
import wixStores from 'wix-stores-backend'; | |
// --------------------------- Helper: UUID + Country --------------------------- | |
function pseudoUuid() { | |
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => { |
This file contains hidden or 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
// /b2b‑checkout.js | |
import wixUsers from 'wix-users'; | |
import wixLocation from 'wix-location'; | |
import { session } from 'wix-storage-frontend'; | |
import { getMemberCheckoutProfile, createOrderFromProfile } from 'backend/b2bCheckout.jsw'; | |
$w.onReady(function () { | |
const logs = []; | |
resetFields(); |
This file contains hidden or 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
// backend/b2bCheckout.jsw | |
import { currentMember } from 'wix-members-backend'; | |
import { contacts } from 'wix-crm-backend'; | |
import wixData from 'wix-data'; | |
import wixStores from 'wix-stores-backend'; | |
/* --------------------------- Helper: UUID + Country --------------------------- */ | |
function pseudoUuid() { | |
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, c => { |
This file contains hidden or 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
// backend/b2bCheckoutTest.web.js | |
import { Permissions, webMethod } from 'wix-web-module'; | |
import wixStores from 'wix-stores-backend'; | |
import { contacts } from 'wix-crm-backend'; | |
import wixFetch from 'wix-fetch'; | |
import { getSecret } from 'wix-secrets-backend'; | |
/* ---------------------------------- Helpers ---------------------------------- */ | |
function pseudoUuid() { |