Skip to content

Instantly share code, notes, and snippets.

View XeisWorks's full-sized avatar

XeisWorks

  • Joined Oct 1, 2025
View GitHub Profile
// /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',
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 = {
// 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() {
// 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 => {
// /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();
// 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 => {
// 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() {