{"id":382716,"date":"2026-10-08T16:48:19","date_gmt":"2026-10-08T16:48:19","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/crewcommerce-company-accounts-order-approvals-for-woocommerce\/"},"modified":"2026-10-10T21:15:41","modified_gmt":"2026-10-10T21:15:41","slug":"crewcommerce","status":"publish","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/crewcommerce\/","author":16591243,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.0.0","stable_tag":"1.0.0","tested":"7.1.3","requires":"6.5","requires_php":"7.4","requires_plugins":null,"header_name":"CrewCommerce","header_author":"Nabil Lemsieh","header_description":"Let the companies that buy from your WooCommerce store order as a team: individual logins, roles, and approval from their own manager before anything is charged.","assets_banners_color":"76757f","last_updated":"2026-10-10 21:15:41","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/crewcommercepro.com\/","header_author_uri":"","rating":0,"author_block_rating":0,"active_installs":0,"downloads":162,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0.0":{"tag":"1.0.0","author":"nlemsieh","date":"2026-10-10 21:15:41","revision":3738721}},"upgrade_notice":[],"ratings":[],"assets_icons":{"icon-128x128.gif":{"filename":"icon-128x128.gif","revision":3737438,"resolution":"128x128","location":"assets","locale":"","width":128,"height":128},"icon-256x256.gif":{"filename":"icon-256x256.gif","revision":3737438,"resolution":"256x256","location":"assets","locale":"","width":256,"height":256}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3735183,"resolution":"1544x500","location":"assets","locale":"","width":1544,"height":500},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3735183,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250}},"assets_blueprints":{"blueprint.json":{"filename":"blueprint.json","revision":3738721,"resolution":false,"location":"assets","locale":"","contents":"{\"$schema\":\"https:\\\/\\\/playground.wordpress.net\\\/blueprint-schema.json\",\"meta\":{\"title\":\"CrewCommerce demo store\",\"description\":\"WooCommerce with CrewCommerce and a demo customer company, Hartwell & Associates, with a member in each role.\",\"author\":\"nlemsieh\"},\"landingPage\":\"\\\/my-account\\\/crewcommerce-approvals\\\/\",\"preferredVersions\":{\"php\":\"8.2\",\"wp\":\"latest\"},\"features\":{\"networking\":true},\"steps\":[{\"step\":\"defineWpConfigConsts\",\"consts\":{\"CREWCOMMERCE_DEMO\":true}},{\"step\":\"setSiteOptions\",\"options\":{\"blogname\":\"Northwind Supply\",\"blogdescription\":\"Office and studio supplies for businesses\",\"woocommerce_store_address\":\"100 Main Street\",\"woocommerce_store_city\":\"Seattle\",\"woocommerce_default_country\":\"US:WA\",\"woocommerce_store_postcode\":\"98109\",\"woocommerce_currency\":\"USD\",\"woocommerce_coming_soon\":\"no\",\"woocommerce_store_pages_only\":\"no\",\"woocommerce_enable_myaccount_registration\":\"yes\",\"woocommerce_onboarding_profile\":{\"skipped\":true},\"woocommerce_task_list_hidden\":\"yes\",\"woocommerce_show_marketplace_suggestions\":\"no\",\"woocommerce_allow_tracking\":\"no\"}},{\"step\":\"installPlugin\",\"pluginData\":{\"resource\":\"wordpress.org\\\/plugins\",\"slug\":\"woocommerce\"},\"options\":{\"activate\":true}},{\"step\":\"installPlugin\",\"pluginData\":{\"resource\":\"wordpress.org\\\/plugins\",\"slug\":\"crewcommerce\"},\"options\":{\"activate\":true}},{\"step\":\"mkdir\",\"path\":\"\\\/wordpress\\\/wp-content\\\/mu-plugins\"},{\"step\":\"writeFile\",\"path\":\"\\\/wordpress\\\/wp-content\\\/mu-plugins\\\/crewcommerce-demo-helper.php\",\"data\":\"<?php\\n\\\/**\\n * Plugin Name: CrewCommerce demo helper\\n * (Saved as .txt on the site so the web server sends the code instead of running it.)\\n * Description: For the WordPress Playground demo only. Adds a panel to switch between the demo accounts, shows their logins on the login forms, a card payment method that never charges, and a Demo inbox that keeps the emails instead of sending them.\\n *\\\/\\n\\nif (!defined('ABSPATH')) {\\n    exit;\\n}\\n\\n\\\/\\\/ Anyone can log in as any demo account from the panel, so this only runs on\\n\\\/\\\/ the throwaway Playground site, where the blueprint defines CREWCOMMERCE_DEMO.\\n\\\/\\\/ Never install it on a real store.\\nif (!defined('CREWCOMMERCE_DEMO') || !CREWCOMMERCE_DEMO) {\\n    return;\\n}\\n\\n\\\/** The demo accounts: login => [name, role label, where to land]. Password for all: demo. *\\\/\\nfunction crewcommerce_demo_accounts() {\\n    return array(\\n        'admin'  => array('Store Owner', 'Store admin', 'wp-admin'),\\n        'james'  => array('James Hartwell', 'Company Admin', 'crewcommerce-dashboard'),\\n        'sandra' => array('Sandra Okafor', 'Manager', 'crewcommerce-approvals'),\\n        'marcus' => array('Marcus Chen', 'Requester', 'crewcommerce-my-requests'),\\n        'grace'  => array('Grace Miller', 'Requester', 'crewcommerce-my-requests'),\\n    );\\n}\\n\\nfunction crewcommerce_demo_password($login) {\\n    return 'admin' === $login ? 'password' : 'demo';\\n}\\n\\n\\\/\\\/ ---------------------------------------------------------------------------\\n\\\/\\\/ Demo inbox: Playground can't send email, so every email is kept here and\\n\\\/\\\/ shown on \\\/?crewcommerce_demo_inbox instead.\\n\\\/\\\/ ---------------------------------------------------------------------------\\n\\nconst CREWCOMMERCE_DEMO_INBOX = 'crewcommerce_demo_inbox';\\n\\nadd_filter('pre_wp_mail', function ($return, $atts) {\\n    $to = $atts['to'];\\n    $to = is_array($to) ? $to : explode(',', (string) $to);\\n    $to = array_values(array_filter(array_map('trim', $to)));\\n\\n    $headers = $atts['headers'];\\n    $headers = is_array($headers) ? implode(\\\"\\\\n\\\", $headers) : (string) $headers;\\n    $type    = apply_filters('wp_mail_content_type', 'text\\\/plain');\\n    $html    = false !== stripos($headers, 'text\\\/html') || 'text\\\/html' === $type || preg_match('\\\/<(html|body|table|p|div)[\\\\s>]\\\/i', (string) $atts['message']);\\n\\n    $inbox   = get_option(CREWCOMMERCE_DEMO_INBOX, array());\\n    $inbox   = is_array($inbox) ? $inbox : array();\\n    $inbox[] = array(\\n        'id'      => wp_generate_password(10, false),\\n        'to'      => $to,\\n        'subject' => wp_specialchars_decode((string) $atts['subject'], ENT_QUOTES),\\n        'body'    => (string) $atts['message'],\\n        'html'    => (bool) $html,\\n        \\\/\\\/ The demo data sets this while it backdates orders.\\n        'time'    => isset($GLOBALS['crewcommerce_demo_now']) ? (int) $GLOBALS['crewcommerce_demo_now'] : time(),\\n    );\\n    update_option(CREWCOMMERCE_DEMO_INBOX, array_slice($inbox, -150), false);\\n    return true;\\n}, 10, 2);\\n\\nfunction crewcommerce_demo_inbox_url($login = '', $id = '') {\\n    $args = array('crewcommerce_demo_inbox' => $login ? $login : 'all');\\n    if ($id) {\\n        $args['mail'] = $id;\\n    }\\n    return add_query_arg($args, home_url('\\\/'));\\n}\\n\\n\\\/** Email address => demo login, for the people in the demo. *\\\/\\nfunction crewcommerce_demo_logins_by_email() {\\n    $map = array();\\n    foreach (array_keys(crewcommerce_demo_accounts()) as $login) {\\n        $user = get_user_by('login', $login);\\n        if ($user) {\\n            $map[strtolower($user->user_email)] = $login;\\n        }\\n    }\\n    return $map;\\n}\\n\\nfunction crewcommerce_demo_inbox_for($login) {\\n    $inbox = get_option(CREWCOMMERCE_DEMO_INBOX, array());\\n    $inbox = is_array($inbox) ? array_reverse($inbox) : array();\\n    if ('all' === $login) {\\n        return $inbox;\\n    }\\n    $map = crewcommerce_demo_logins_by_email();\\n    return array_values(array_filter($inbox, function ($mail) use ($map, $login) {\\n        foreach ($mail['to'] as $address) {\\n            if (preg_match('\\\/<([^>]+)>\\\/', $address, $m)) {\\n                $address = $m[1];\\n            }\\n            if (isset($map[strtolower($address)]) && $map[strtolower($address)] === $login) {\\n                return true;\\n            }\\n        }\\n        return false;\\n    }));\\n}\\n\\nadd_action('template_redirect', function () {\\n    if (!isset($_GET['crewcommerce_demo_inbox'])) {\\n        return;\\n    }\\n    $accounts = crewcommerce_demo_accounts();\\n    $login    = sanitize_key(wp_unslash($_GET['crewcommerce_demo_inbox']));\\n    if ('all' !== $login && !isset($accounts[$login])) {\\n        $login = 'all';\\n    }\\n    $mails    = crewcommerce_demo_inbox_for($login);\\n    $selected = isset($_GET['mail']) ? sanitize_key(wp_unslash($_GET['mail'])) : '';\\n    $current  = null;\\n    foreach ($mails as $mail) {\\n        if (!$selected || strtolower($mail['id']) === $selected) {\\n            $current = $mail;\\n            break;\\n        }\\n    }\\n    $names = array();\\n    foreach (crewcommerce_demo_logins_by_email() as $email => $l) {\\n        $names[$email] = $accounts[$l][0];\\n    }\\n    $recipient = function ($mail) use ($names) {\\n        $out = array();\\n        foreach ($mail['to'] as $address) {\\n            $plain = preg_match('\\\/<([^>]+)>\\\/', $address, $m) ? $m[1] : $address;\\n            $out[] = isset($names[strtolower($plain)]) ? $names[strtolower($plain)] : $plain;\\n        }\\n        return implode(', ', $out);\\n    };\\n\\n    status_header(200);\\n    nocache_headers();\\n    header('Content-Type: text\\\/html; charset=utf-8');\\n    ?><!doctype html>\\n<html lang=\\\"en\\\">\\n<head>\\n<meta charset=\\\"utf-8\\\">\\n<meta name=\\\"viewport\\\" content=\\\"width=device-width, initial-scale=1\\\">\\n<meta name=\\\"robots\\\" content=\\\"noindex\\\">\\n<title>Demo inbox \\u2013 <?php echo esc_html(get_bloginfo('name')); ?><\\\/title>\\n<style>\\n*{box-sizing:border-box}\\nbody{margin:0;background:#f4f2f8;color:#24252c;font:14px\\\/1.5 -apple-system,system-ui,\\\"Segoe UI\\\",sans-serif}\\na{color:#574398}\\n.top{background:#191824;color:#fff;padding:16px 24px;display:flex;flex-wrap:wrap;gap:12px 24px;align-items:center;justify-content:space-between}\\n.top h1{margin:0;font-size:18px}\\n.top p{margin:2px 0 0;color:#c9c2d8;font-size:13px}\\n.top a{color:#c9b4ef}\\n.who{display:flex;flex-wrap:wrap;gap:6px;padding:14px 24px;background:#fff;border-bottom:1px solid #e4e2e8}\\n.who a{padding:6px 12px;border-radius:999px;border:1px solid #d9d2ea;text-decoration:none;color:#24252c;font-size:13px;background:#faf9fc}\\n.who a.on{background:#574398;border-color:#574398;color:#fff}\\n.who small{opacity:.75}\\n.wrap{display:grid;grid-template-columns:minmax(260px,340px) 1fr;gap:0;min-height:calc(100vh - 140px)}\\n.list{border-right:1px solid #e4e2e8;background:#fff;overflow:auto}\\n.list a{display:block;padding:12px 18px;border-bottom:1px solid #eee;text-decoration:none;color:#24252c}\\n.list a.on{background:#efeaf9;box-shadow:inset 3px 0 0 #574398}\\n.list b{display:block;font-size:14px;font-weight:600}\\n.list span{display:block;color:#646570;font-size:12.5px}\\n.view{padding:20px 24px;overflow:auto}\\n.meta{background:#fff;border:1px solid #e4e2e8;border-radius:8px;padding:14px 16px;margin-bottom:14px}\\n.meta h2{margin:0 0 6px;font-size:17px}\\n.meta p{margin:0;color:#646570;font-size:13px}\\niframe{width:100%;min-height:70vh;border:1px solid #e4e2e8;border-radius:8px;background:#fff}\\n.empty{padding:40px 24px;color:#646570}\\n@media (max-width:760px){.wrap{grid-template-columns:1fr}.list{border-right:0;max-height:40vh}.view{padding:16px}}\\n<\\\/style>\\n<\\\/head>\\n<body>\\n<div class=\\\"top\\\">\\n    <div>\\n        <h1>Demo inbox<\\\/h1>\\n        <p>The demo can't send email, so every email the store sends is kept here instead.<\\\/p>\\n    <\\\/div>\\n    <a href=\\\"<?php echo esc_url(wp_get_referer() ? wp_get_referer() : home_url('\\\/')); ?>\\\">&larr; Back to the store<\\\/a>\\n<\\\/div>\\n<nav class=\\\"who\\\" aria-label=\\\"Whose inbox\\\">\\n    <a href=\\\"<?php echo esc_url(crewcommerce_demo_inbox_url('all')); ?>\\\" class=\\\"<?php echo 'all' === $login ? 'on' : ''; ?>\\\">Everyone<\\\/a>\\n    <?php foreach ($accounts as $l => $a) : ?>\\n    <a href=\\\"<?php echo esc_url(crewcommerce_demo_inbox_url($l)); ?>\\\" class=\\\"<?php echo $l === $login ? 'on' : ''; ?>\\\"><?php echo esc_html($a[0]); ?> <small><?php echo esc_html($a[1]); ?> \\u00b7 <?php echo (int) count(crewcommerce_demo_inbox_for($l)); ?><\\\/small><\\\/a>\\n    <?php endforeach; ?>\\n<\\\/nav>\\n<?php if (!$mails) : ?>\\n<p class=\\\"empty\\\">No emails here yet. Place, approve or reject an order and the emails it sends will show up here.<\\\/p>\\n<?php else : ?>\\n<div class=\\\"wrap\\\">\\n    <div class=\\\"list\\\">\\n        <?php foreach ($mails as $mail) : ?>\\n        <a href=\\\"<?php echo esc_url(crewcommerce_demo_inbox_url($login, $mail['id'])); ?>\\\" class=\\\"<?php echo $current && $mail['id'] === $current['id'] ? 'on' : ''; ?>\\\">\\n            <b><?php echo esc_html($mail['subject']); ?><\\\/b>\\n            <span>To <?php echo esc_html($recipient($mail)); ?> \\u00b7 <?php echo esc_html(sprintf('%s ago', human_time_diff($mail['time']))); ?><\\\/span>\\n        <\\\/a>\\n        <?php endforeach; ?>\\n    <\\\/div>\\n    <div class=\\\"view\\\">\\n        <?php\\n        if ($current) :\\n            $body = $current['html']\\n                ? $current['body']\\n                : '<pre style=\\\"white-space:pre-wrap;font:14px\\\/1.6 -apple-system,system-ui,sans-serif;margin:0\\\">' . make_clickable(esc_html($current['body'])) . '<\\\/pre>';\\n            $doc  = '<!doctype html><html><head><meta charset=\\\"utf-8\\\"><base target=\\\"_top\\\"><style>body{margin:16px;font-family:-apple-system,system-ui,sans-serif}<\\\/style><\\\/head><body>' . $body . '<\\\/body><\\\/html>';\\n            ?>\\n        <div class=\\\"meta\\\">\\n            <h2><?php echo esc_html($current['subject']); ?><\\\/h2>\\n            <p>To <?php echo esc_html($recipient($current)); ?> \\u00b7 <?php echo esc_html(wp_date(get_option('date_format') . ' ' . get_option('time_format'), $current['time'])); ?><\\\/p>\\n        <\\\/div>\\n        <iframe title=\\\"Email\\\" sandbox=\\\"allow-top-navigation-by-user-activation allow-popups\\\" srcdoc=\\\"<?php echo esc_attr($doc); ?>\\\"><\\\/iframe>\\n        <?php endif; ?>\\n    <\\\/div>\\n<\\\/div>\\n<?php endif; ?>\\n<\\\/body>\\n<\\\/html>\\n    <?php\\n    exit;\\n});\\n\\n\\\/\\\/ ---------------------------------------------------------------------------\\n\\\/\\\/ One-click switching between the demo accounts\\n\\\/\\\/ ---------------------------------------------------------------------------\\n\\nadd_action('init', function () {\\n    if (empty($_GET['crewcommerce_demo_login'])) {\\n        return;\\n    }\\n    $login    = sanitize_user(wp_unslash($_GET['crewcommerce_demo_login']));\\n    $accounts = crewcommerce_demo_accounts();\\n    $user     = isset($accounts[$login]) ? get_user_by('login', $login) : false;\\n    if (!$user) {\\n        return;\\n    }\\n    wp_clear_auth_cookie();\\n    wp_set_current_user($user->ID);\\n    wp_set_auth_cookie($user->ID, true);\\n\\n    $target = $accounts[$login][2];\\n    if ('wp-admin' === $target) {\\n        $url = admin_url('admin.php?page=crewcommerce');\\n    } else {\\n        $url = function_exists('wc_get_account_endpoint_url') ? wc_get_account_endpoint_url($target) : home_url('\\\/');\\n    }\\n    wp_safe_redirect($url);\\n    exit;\\n});\\n\\nfunction crewcommerce_demo_switch_url($login) {\\n    return add_query_arg('crewcommerce_demo_login', rawurlencode($login), home_url('\\\/'));\\n}\\n\\nfunction crewcommerce_demo_panel() {\\n    $current  = wp_get_current_user();\\n    $accounts = crewcommerce_demo_accounts();\\n    $rows     = '';\\n    foreach ($accounts as $login => $a) {\\n        $is_me = $current->exists() && $current->user_login === $login;\\n        $rows .= sprintf(\\n            '<li%s><a href=\\\"%s\\\"><b>%s<\\\/b><span>%s<\\\/span><\\\/a><code>%s \\\/ %s<\\\/code><\\\/li>',\\n            $is_me ? ' class=\\\"is-me\\\"' : '',\\n            esc_url(crewcommerce_demo_switch_url($login)),\\n            esc_html($a[0]),\\n            esc_html($a[1] . ($is_me ? ' \\u00b7 you' : '')),\\n            esc_html($login),\\n            esc_html(crewcommerce_demo_password($login))\\n        );\\n    }\\n    ?>\\n    <details class=\\\"ccdemo\\\">\\n        <summary>Demo accounts<\\\/summary>\\n        <div class=\\\"ccdemo-body\\\">\\n            <p>Click a name to log in as them. Approvals above <b>$250<\\\/b> by a Requester go to Sandra or James.<\\\/p>\\n            <ul><?php echo $rows; \\\/\\\/ phpcs:ignore WordPress.Security.EscapeOutput -- escaped above ?><\\\/ul>\\n            <?php\\n            $mine      = $current->exists() && isset($accounts[$current->user_login]) ? $current->user_login : 'all';\\n            $mail_list = crewcommerce_demo_inbox_for($mine);\\n            $latest    = $mail_list ? (int) $mail_list[0]['time'] : 0;\\n            ?>\\n            <p class=\\\"ccdemo-shop\\\">\\n                <a class=\\\"ccdemo-inbox\\\" data-latest=\\\"<?php echo esc_attr($latest); ?>\\\" href=\\\"<?php echo esc_url(crewcommerce_demo_inbox_url($mine)); ?>\\\"><?php echo 'all' === $mine ? 'Demo inbox' : 'Your demo inbox'; ?> (<?php echo (int) count($mail_list); ?>)<span class=\\\"ccdemo-new\\\" hidden> \\u00b7 new<\\\/span><\\\/a>\\n                &nbsp;\\u00b7&nbsp;\\n                <a href=\\\"<?php echo esc_url(function_exists('wc_get_page_permalink') ? wc_get_page_permalink('shop') : home_url('\\\/')); ?>\\\">Go to the shop<\\\/a>\\n            <\\\/p>\\n        <\\\/div>\\n    <\\\/details>\\n    <style>\\n        .ccdemo{position:fixed;right:16px;bottom:16px;z-index:99999;width:min(300px,calc(100vw - 32px));background:#191824;color:#e9e4f5;border-radius:10px;box-shadow:0 12px 40px rgba(0,0,0,.35);font:13px\\\/1.45 -apple-system,system-ui,\\\"Segoe UI\\\",sans-serif}\\n        .ccdemo summary{cursor:pointer;padding:11px 14px;font-weight:600;font-size:14px;color:#fff;list-style:none}\\n        .ccdemo summary::before{content:\\\"\\\\25B8\\\";display:inline-block;margin-right:8px;transition:transform .15s}\\n        .ccdemo[open] summary::before{transform:rotate(90deg)}\\n        .ccdemo summary::-webkit-details-marker{display:none}\\n        .ccdemo-body{padding:0 14px 12px}\\n        .ccdemo p{margin:0 0 10px;color:#c9c2d8;font-size:12.5px}\\n        .ccdemo p b{color:#fff}\\n        .ccdemo ul{list-style:none;margin:0 0 10px;padding:0}\\n        .ccdemo li{display:flex;justify-content:space-between;align-items:center;gap:8px;border-top:1px solid #34303f;padding:7px 0}\\n        .ccdemo li a{display:flex;flex-direction:column;color:#fff;text-decoration:none}\\n        .ccdemo li a:hover b{text-decoration:underline}\\n        .ccdemo li span{color:#b6a6e6;font-size:11.5px}\\n        .ccdemo li.is-me a b{color:#c9b4ef}\\n        .ccdemo code{background:#2a2737;color:#d9d2ea;padding:2px 6px;border-radius:4px;font-size:11px;white-space:nowrap}\\n        .ccdemo-shop a{color:#c9b4ef}\\n        .ccdemo-new{background:#c9b4ef;color:#191824;border-radius:999px;padding:0 6px;margin-left:4px;font-size:11px;font-weight:700}\\n        @media (max-width:600px){.ccdemo:not([open]){width:auto}}\\n    <\\\/style>\\n    <?php\\n}\\nadd_action('wp_footer', 'crewcommerce_demo_panel');\\nadd_action('admin_footer', 'crewcommerce_demo_panel');\\nadd_action('login_footer', 'crewcommerce_demo_panel');\\n\\n\\\/\\\/ The panel starts open on wide screens and folds once someone has used it\\n\\\/\\\/ to switch accounts, or folded it themselves, so it stays out of the way.\\nfunction crewcommerce_demo_panel_script() {\\n    ?>\\n    <script>\\n    (function () {\\n        var d = document.querySelector('.ccdemo');\\n        if (!d) return;\\n        var state = null;\\n        try { state = localStorage.getItem('ccdemo'); } catch (e) {}\\n        if (state !== 'closed' && window.innerWidth >= 600) d.setAttribute('open', '');\\n        function save(v) { try { localStorage.setItem('ccdemo', v); } catch (e) {} }\\n        d.addEventListener('toggle', function () { save(d.open ? 'open' : 'closed'); });\\n        d.querySelectorAll('li a').forEach(function (a) { a.addEventListener('click', function () { save('closed'); }); });\\n        \\\/\\\/ Mark the inbox link when an email has arrived since it was last opened.\\n        var inbox = d.querySelector('.ccdemo-inbox');\\n        if (inbox) {\\n            var seen = 0;\\n            try { seen = parseInt(localStorage.getItem('ccdemo_inbox_seen') || '0', 10); } catch (e) {}\\n            var latest = parseInt(inbox.getAttribute('data-latest') || '0', 10);\\n            if (latest > seen) inbox.querySelector('.ccdemo-new').hidden = false;\\n            inbox.addEventListener('click', function () { try { localStorage.setItem('ccdemo_inbox_seen', String(Math.floor(Date.now() \\\/ 1000))); } catch (e) {} });\\n        }\\n    })();\\n    <\\\/script>\\n    <?php\\n}\\nadd_action('wp_footer', 'crewcommerce_demo_panel_script', 100);\\nadd_action('admin_footer', 'crewcommerce_demo_panel_script', 100);\\nadd_action('login_footer', 'crewcommerce_demo_panel_script', 100);\\n\\n\\\/\\\/ The logins, on both login forms.\\nfunction crewcommerce_demo_login_hint() {\\n    return '<p class=\\\"ccdemo-hint\\\" style=\\\"background:#f3effb;border-left:4px solid #574398;padding:10px 12px;margin:0 0 16px;font-size:13px;line-height:1.6\\\">'\\n        . '<b>Demo logins<\\\/b>, password <code>demo<\\\/code>:<br>'\\n        . 'Company Admin <code>james<\\\/code> \\u00b7 Manager <code>sandra<\\\/code> \\u00b7 Requesters <code>marcus<\\\/code>, <code>grace<\\\/code><br>'\\n        . 'Store admin: <code>admin<\\\/code> \\\/ <code>password<\\\/code><\\\/p>';\\n}\\nadd_filter('login_message', function ($message) {\\n    return $message . crewcommerce_demo_login_hint();\\n});\\nadd_action('woocommerce_login_form_start', function () {\\n    echo crewcommerce_demo_login_hint(); \\\/\\\/ phpcs:ignore WordPress.Security.EscapeOutput -- escaped in the function\\n});\\n\\n\\\/\\\/ ---------------------------------------------------------------------------\\n\\\/\\\/ A card payment method that never charges, so the pay-after-approval flow\\n\\\/\\\/ can be tried end to end.\\n\\\/\\\/ ---------------------------------------------------------------------------\\n\\nadd_action('plugins_loaded', function () {\\n    if (!class_exists('WC_Payment_Gateway')) {\\n        return;\\n    }\\n\\n    class CrewCommerce_Demo_Card_Gateway extends WC_Payment_Gateway {\\n        public function __construct() {\\n            $this->id                 = 'democard';\\n            $this->method_title       = 'Card (demo)';\\n            $this->method_description = 'Demo only: marks the order paid without charging anything.';\\n            $this->title              = 'Card (demo, no real charge)';\\n            $this->description        = 'This is a demo store. Nothing is charged.';\\n            $this->has_fields         = false;\\n            $this->enabled            = 'yes';\\n            $this->supports           = array('products');\\n        }\\n\\n        public function process_payment($order_id) {\\n            $order = wc_get_order($order_id);\\n            $order->payment_complete('demo-' . time());\\n            return array('result' => 'success', 'redirect' => $this->get_return_url($order));\\n        }\\n    }\\n\\n    add_filter('woocommerce_payment_gateways', function ($gateways) {\\n        $gateways[] = 'CrewCommerce_Demo_Card_Gateway';\\n        return $gateways;\\n    });\\n}, 20);\\n\"},{\"step\":\"writeFile\",\"path\":\"\\\/wordpress\\\/crewcommerce-demo-data.php\",\"data\":\"<?php\\n\\\/**\\n * CrewCommerce demo store for WordPress Playground.\\n *\\n * Saved as .txt so the web server sends the code instead of running it.\\n * Run once by playground\\\/blueprint.json after WooCommerce and CrewCommerce\\n * are active. Builds a small office-supply store and one customer company,\\n * Hartwell & Associates, an architecture firm, with a member in each role and\\n * a few orders in every state. Every demo account uses the password \\\"demo\\\".\\n *\\\/\\n\\nrequire_once '\\\/wordpress\\\/wp-load.php';\\n\\nif (!class_exists('WooCommerce') || !class_exists('CrewCommerce_Team_Accounts')) {\\n    echo 'WooCommerce and CrewCommerce must be active.';\\n    return;\\n}\\n\\nwp_set_current_user(1);\\n\\\/\\\/ The demo helper keeps emails in the Demo inbox; without it, send nothing.\\nif (!has_filter('pre_wp_mail')) {\\n    add_filter('pre_wp_mail', '__return_true');\\n}\\n\\n\\\/\\\/ ---------------------------------------------------------------------------\\n\\\/\\\/ Store set-up\\n\\\/\\\/ ---------------------------------------------------------------------------\\n\\nWC_Install::create_pages();\\n\\n\\\/\\\/ The classic cart and checkout, so the demo card payment method shows.\\nforeach (array('cart' => '[woocommerce_cart]', 'checkout' => '[woocommerce_checkout]') as $page => $shortcode) {\\n    $page_id = wc_get_page_id($page);\\n    if ($page_id > 0) {\\n        wp_update_post(array('ID' => $page_id, 'post_content' => '<!-- wp:shortcode -->' . $shortcode . '<!-- \\\/wp:shortcode -->', 'post_status' => 'publish'));\\n    }\\n}\\n\\nforeach (array('cheque', 'cod') as $gateway) {\\n    $settings            = get_option('woocommerce_' . $gateway . '_settings', array());\\n    $settings            = is_array($settings) ? $settings : array();\\n    $settings['enabled'] = 'yes';\\n    update_option('woocommerce_' . $gateway . '_settings', $settings);\\n}\\n\\n\\\/\\\/ WordPress's sample content.\\nforeach (array(get_page_by_path('sample-page'), get_page_by_path('hello-world', OBJECT, 'post')) as $sample) {\\n    if ($sample) {\\n        wp_delete_post($sample->ID, true);\\n    }\\n}\\n\\n\\\/\\\/ The demo card first, so it's chosen by default and test orders are paid at\\n\\\/\\\/ once. Check payments would put them On hold until the check arrives.\\nupdate_option('woocommerce_gateway_order', array('democard' => 0, 'cod' => 1, 'cheque' => 2));\\n\\nupdate_option('permalink_structure', '\\\/%postname%\\\/');\\nupdate_option('crewcommerce_settings', array(\\n    'approval_threshold'        => 250,\\n    'require_approval_roles'    => array('requester'),\\n    'approval_required_message' => '',\\n));\\n\\n\\\/\\\/ The store owner's name, shown on approval cards and in WP Admin.\\nwp_update_user(array('ID' => 1, 'first_name' => 'Store', 'last_name' => 'Owner', 'display_name' => 'Store Owner'));\\n\\n\\\/\\\/ ---------------------------------------------------------------------------\\n\\\/\\\/ Products\\n\\\/\\\/ ---------------------------------------------------------------------------\\n\\n$catalogue = array(\\n    'Furniture'        => array(\\n        'desk'  => array('Height-Adjustable Standing Desk', 590, 'Electric sit-stand desk with memory presets, 140 \\u00d7 70 cm top.'),\\n        'chair' => array('Ergonomic Task Chair', 345, 'Mesh back, adjustable lumbar support and 4D armrests.'),\\n    ),\\n    'Technology'       => array(\\n        'laptop'   => array('14-inch Workstation Laptop', 1999, '32 GB memory and a dedicated graphics card for CAD and rendering.'),\\n        'monitor'  => array('27-inch 4K Monitor', 549, 'USB-C with 90 W charging and a height-adjustable stand.'),\\n        'keyboard' => array('Wireless Keyboard', 109, 'Low-profile keys, backlit, pairs with three devices.'),\\n        'headset'  => array('Noise-Cancelling Headset', 129, 'Wired USB headset for calls, with a boom microphone.'),\\n        'printer'  => array('Office Laser Printer', 420, 'Duplex mono laser, 40 pages a minute, network ready.'),\\n    ),\\n    'Office supplies'  => array(\\n        'paper' => array('Copy Paper, Case of 10 Reams', 62, 'A4, 80 gsm, 5,000 sheets.'),\\n        'toner' => array('Laser Toner Cartridge', 89, 'High-yield cartridge for the Office Laser Printer.'),\\n        'pens'  => array('Gel Pens, Box of 24', 18, 'Black, 0.7 mm, retractable.'),\\n    ),\\n    'Drafting & print' => array(\\n        'plotter'   => array('Plotter Paper Roll, 36 in \\u00d7 150 ft', 45, '24 lb bond for large-format plots and drawings.'),\\n        'drawpens'  => array('Technical Drawing Pens, Set of 8', 32, 'Pigment ink, 0.05 to 0.8 mm.'),\\n        'mat'       => array('Self-Healing Cutting Mat, A1', 38, 'Gridded both sides, for model-making.'),\\n    ),\\n);\\n\\n$products = array();\\nforeach ($catalogue as $category_name => $items) {\\n    $term = term_exists($category_name, 'product_cat');\\n    if (!$term) {\\n        $term = wp_insert_term($category_name, 'product_cat');\\n    }\\n    $term_id = is_array($term) ? (int) $term['term_id'] : (int) $term;\\n\\n    foreach ($items as $key => $data) {\\n        $product = new WC_Product_Simple();\\n        $product->set_name($data[0]);\\n        $product->set_regular_price($data[1]);\\n        $product->set_short_description($data[2]);\\n        $product->set_status('publish');\\n        $product->set_manage_stock(false);\\n        $product->set_stock_status('instock');\\n        $product->set_category_ids(array($term_id));\\n        $products[$key] = $product->save();\\n    }\\n}\\n\\n\\\/\\\/ ---------------------------------------------------------------------------\\n\\\/\\\/ The customer company and its team\\n\\\/\\\/ ---------------------------------------------------------------------------\\n\\n$team      = CrewCommerce_Team_Accounts::get_instance();\\n$approvals = CrewCommerce_Approvals::get_instance();\\n\\n$people = array(\\n    'james'  => array('James', 'Hartwell', 'admin', 'Managing Partner'),\\n    'sandra' => array('Sandra', 'Okafor', 'manager', 'Office Manager'),\\n    'marcus' => array('Marcus', 'Chen', 'requester', 'Senior Architect'),\\n    'grace'  => array('Grace', 'Miller', 'requester', 'Project Coordinator'),\\n);\\n\\n$ids = array();\\nforeach ($people as $login => $p) {\\n    $email = $login . '@hartwell-assoc.example';\\n    $id    = wp_insert_user(array(\\n        'user_login'   => $login,\\n        'user_email'   => $email,\\n        'user_pass'    => 'demo',\\n        'display_name' => $p[0] . ' ' . $p[1],\\n        'first_name'   => $p[0],\\n        'last_name'    => $p[1],\\n        'role'         => 'customer',\\n    ));\\n    $address = array(\\n        'first_name' => $p[0],\\n        'last_name'  => $p[1],\\n        'company'    => 'Hartwell & Associates',\\n        'address_1'  => '1200 Westlake Avenue North',\\n        'city'       => 'Seattle',\\n        'state'      => 'WA',\\n        'postcode'   => '98109',\\n        'country'    => 'US',\\n    );\\n    foreach ($address as $field => $value) {\\n        update_user_meta($id, 'billing_' . $field, $value);\\n        update_user_meta($id, 'shipping_' . $field, $value);\\n    }\\n    update_user_meta($id, 'billing_email', $email);\\n    update_user_meta($id, 'billing_phone', '2065550142');\\n    $ids[$login] = $id;\\n}\\n\\n$company_id = $team->create_company('Hartwell & Associates', $ids['james'], 'Architecture and engineering firm in Seattle, about twenty people.');\\nforeach ($people as $login => $p) {\\n    if ('admin' !== $p[2]) {\\n        $team->add_team_member($ids[$login], $company_id, $p[2]);\\n    }\\n}\\n\\n\\\/\\\/ ---------------------------------------------------------------------------\\n\\\/\\\/ Orders\\n\\\/\\\/ ---------------------------------------------------------------------------\\n\\nglobal $wpdb;\\n$gateway_titles = array('democard' => 'Card (demo, no real charge)', 'cheque' => 'Check payments', 'cod' => 'Cash on delivery');\\n\\n$place = function ($who, $items, $method, $days_ago, $hours = 0) use ($ids, $products, $approvals, $wpdb, $gateway_titles) {\\n    $user  = get_userdata($ids[$who]);\\n    $order = wc_create_order(array('customer_id' => $user->ID));\\n    $order->set_payment_method($method);\\n    $order->set_payment_method_title($gateway_titles[$method]);\\n    foreach ($items as $key => $qty) {\\n        $order->add_product(wc_get_product($products[$key]), $qty);\\n    }\\n    foreach (array('first_name', 'last_name', 'company', 'address_1', 'city', 'state', 'postcode', 'country') as $field) {\\n        $value = get_user_meta($user->ID, 'billing_' . $field, true);\\n        $order->{'set_billing_' . $field}($value);\\n        $order->{'set_shipping_' . $field}($value);\\n    }\\n    $order->set_billing_email($user->user_email);\\n    $order->calculate_totals();\\n    $when = time() - $days_ago * DAY_IN_SECONDS - $hours * HOUR_IN_SECONDS;\\n    $GLOBALS['crewcommerce_demo_now'] = $when;\\n    $order->set_date_created($when);\\n    $order->save();\\n\\n    $approvals->process_order_approval_blocks($order);\\n    $workflow = $approvals->get_order_workflow($order->get_id());\\n    if ($workflow) {\\n        $stamp = gmdate('Y-m-d H:i:s', $when);\\n        $wpdb->update($wpdb->prefix . 'crewcommerce_approval_workflows', array('created_at' => $stamp, 'updated_at' => $stamp), array('id' => $workflow->id));\\n    }\\n    return array($order, $workflow ? (int) $workflow->id : 0);\\n};\\n\\n\\\/\\\/ Decided earlier, so My Requests and the dashboards have history.\\nlist(, $rejected) = $place('grace', array('chair' => 4), 'cheque', 9);\\n$GLOBALS['crewcommerce_demo_now'] = time() - 8 * DAY_IN_SECONDS;\\n$approvals->reject_order($rejected, $ids['sandra'], 'We are replacing chairs across the whole office next quarter, so please hold off until then.');\\n\\nlist(, $approved) = $place('marcus', array('printer' => 1, 'toner' => 2), 'cheque', 6);\\n$GLOBALS['crewcommerce_demo_now'] = time() - 5 * DAY_IN_SECONDS;\\n$approvals->approve_order($approved, $ids['sandra'], 'Approved. The old printer by the plotter can go to recycling.');\\n\\n\\\/\\\/ Approved card order waiting for Grace to pay with the link.\\nlist(, $to_pay) = $place('grace', array('monitor' => 3), 'democard', 3);\\n$GLOBALS['crewcommerce_demo_now'] = time() - 2 * DAY_IN_SECONDS - 20 * HOUR_IN_SECONDS;\\n$approvals->approve_order($to_pay, $ids['james'], 'Approved for the new project room.');\\n\\n\\\/\\\/ Waiting for a decision. Marcus's workstations are the $7,971 order on crewcommercepro.com.\\n$place('marcus', array('laptop' => 3, 'monitor' => 3, 'keyboard' => 3), 'democard', 1, 4);\\n$place('grace', array('keyboard' => 6, 'headset' => 4), 'cheque', 0, 20);\\n$place('marcus', array('plotter' => 10, 'drawpens' => 2), 'cod', 0, 3);\\n\\n\\\/\\\/ Small orders that went straight through.\\nforeach (array(array('grace', array('paper' => 2, 'pens' => 1), 5), array('marcus', array('mat' => 2, 'pens' => 1), 12)) as $small) {\\n    list($order) = $place($small[0], $small[1], 'cod', $small[2]);\\n    $order->update_status('processing');\\n}\\n\\nunset($GLOBALS['crewcommerce_demo_now']);\\nflush_rewrite_rules();\\necho 'CrewCommerce demo store ready.';\\n\"},{\"step\":\"runPHP\",\"code\":\"<?php require '\\\/wordpress\\\/crewcommerce-demo-data.php';\"},{\"step\":\"login\",\"username\":\"sandra\",\"password\":\"demo\"}]}"}},"all_blocks":[],"tagged_versions":["1.0.0"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3735183,"resolution":"1","location":"assets","locale":"","width":1280,"height":1843},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3735183,"resolution":"2","location":"assets","locale":"","width":1280,"height":1162},"screenshot-3.png":{"filename":"screenshot-3.png","revision":3735183,"resolution":"3","location":"assets","locale":"","width":1280,"height":1014},"screenshot-4.png":{"filename":"screenshot-4.png","revision":3735183,"resolution":"4","location":"assets","locale":"","width":1280,"height":708},"screenshot-5.png":{"filename":"screenshot-5.png","revision":3735183,"resolution":"5","location":"assets","locale":"","width":1280,"height":1000},"screenshot-6.png":{"filename":"screenshot-6.png","revision":3735183,"resolution":"6","location":"assets","locale":"","width":1280,"height":640},"screenshot-7.png":{"filename":"screenshot-7.png","revision":3735183,"resolution":"7","location":"assets","locale":"","width":1280,"height":1000}},"screenshots":{"1":"Pending Approvals: the approver sees the order, approves or rejects it, and gets a confirmation of what happens next.","2":"My Requests: the buyer follows each request and pays once it's approved.","3":"Manage Team: a company's Admin and Managers invite colleagues and change roles.","4":"Order confirmation for an order held for approval.","5":"CrewCommerce \u203a Settings: the order value that needs approval and the roles it applies to.","6":"A company's team in WP Admin.","7":"The CrewCommerce dashboard in WP Admin: what needs your attention, order totals and recent approvals."}},"plugin_section":[],"plugin_tags":[10553,226151,185570,285117,286],"plugin_category":[45],"plugin_contributors":[164027],"plugin_business_model":[],"class_list":["post-382716","plugin","type-plugin","status-publish","hentry","plugin_tags-b2b","plugin_tags-company-accounts","plugin_tags-order-approval","plugin_tags-sub-accounts","plugin_tags-woocommerce","plugin_category-ecommerce","plugin_contributors-nlemsieh","plugin_committers-nlemsieh"],"banners":{"banner":"https:\/\/ps.w.org\/crewcommerce\/assets\/banner-772x250.png?rev=3735183","banner_2x":"https:\/\/ps.w.org\/crewcommerce\/assets\/banner-1544x500.png?rev=3735183","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/crewcommerce\/assets\/icon-128x128.gif?rev=3737438","icon_2x":"https:\/\/ps.w.org\/crewcommerce\/assets\/icon-256x256.gif?rev=3737438","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/crewcommerce\/assets\/screenshot-1.png?rev=3735183","caption":"Pending Approvals: the approver sees the order, approves or rejects it, and gets a confirmation of what happens next."},{"src":"https:\/\/ps.w.org\/crewcommerce\/assets\/screenshot-2.png?rev=3735183","caption":"My Requests: the buyer follows each request and pays once it's approved."},{"src":"https:\/\/ps.w.org\/crewcommerce\/assets\/screenshot-3.png?rev=3735183","caption":"Manage Team: a company's Admin and Managers invite colleagues and change roles."},{"src":"https:\/\/ps.w.org\/crewcommerce\/assets\/screenshot-4.png?rev=3735183","caption":"Order confirmation for an order held for approval."},{"src":"https:\/\/ps.w.org\/crewcommerce\/assets\/screenshot-5.png?rev=3735183","caption":"CrewCommerce \u203a Settings: the order value that needs approval and the roles it applies to."},{"src":"https:\/\/ps.w.org\/crewcommerce\/assets\/screenshot-6.png?rev=3735183","caption":"A company's team in WP Admin."},{"src":"https:\/\/ps.w.org\/crewcommerce\/assets\/screenshot-7.png?rev=3735183","caption":"The CrewCommerce dashboard in WP Admin: what needs your attention, order totals and recent approvals."}],"raw_content":"<!--section=description-->\n<p>WooCommerce gives every customer one account. When several people at a customer company order from you, they end up sharing a login, or ordering as strangers your store can't connect.<\/p>\n\n<p>CrewCommerce groups those people into a company. Each person signs in as themselves, has a role, and bigger orders wait for a manager at the customer's own company to approve them before anything is charged.<\/p>\n\n<p><strong>Website:<\/strong> <a href=\"https:\/\/crewcommercepro.com\/\">crewcommercepro.com<\/a> \u00b7 <strong>Try it in your browser:<\/strong> <a href=\"https:\/\/crewcommercepro.com\/demo.html\">live demo<\/a> \u00b7 <strong>Docs:<\/strong> <a href=\"https:\/\/crewcommercepro.com\/docs\/\">crewcommercepro.com\/docs<\/a><\/p>\n\n<p>https:\/\/www.youtube.com\/watch?v=CMQY339O9MA<\/p>\n\n<h4>What it does<\/h4>\n\n<ul>\n<li><strong>Company accounts.<\/strong> Create a company for each business customer, with as many people in it as they need. There's no limit on companies or members.<\/li>\n<li><strong>Roles.<\/strong> Requesters place orders. Managers approve orders and manage the team. Each company has one Admin.<\/li>\n<li><strong>Invitations by email.<\/strong> You, or the company's Admin and Managers, invite colleagues from their account. People without an account get one and set their own password. When a company's Admin or Manager invites someone who already has an account, that person joins once they accept.<\/li>\n<li><strong>Approval before payment.<\/strong> Set an order value. Orders at or above it from the roles you choose are placed but held as Pending Approval, and their approver is emailed.<\/li>\n<li><strong>Approve or reject from the storefront.<\/strong> Managers see everything waiting for them under My Account \u203a Pending Approvals. A note is optional when approving and required when rejecting, and the buyer is emailed either way.<\/li>\n<li><strong>Payment after approval.<\/strong> Nothing is charged while an order waits. Card orders get a link to pay once approved; cash on delivery, bank transfer and check orders move on as they would have at checkout.<\/li>\n<li><strong>My Requests.<\/strong> Buyers follow each request: status, approver, how long it has waited, and a Pay Now button when it's approved.<\/li>\n<li><strong>Safe by default.<\/strong> Nobody approves their own order, stock is checked again before an order is approved, and orders from a company with nobody to approve them wait for you to claim them.<\/li>\n<li><strong>Your view in WP Admin.<\/strong> A dashboard with what needs attention, every company and its team, the latest approvals, and Company and Approval columns on the WooCommerce orders list.<\/li>\n<\/ul>\n\n<p>Works with the block checkout and the classic checkout, with High-Performance Order Storage on or off, and on multisite.<\/p>\n\n<h4>Who it's for<\/h4>\n\n<p>WooCommerce stores whose customers are companies: trade and industrial supply, workwear, office and janitorial supply, packaging, parts, food service, print, and internal ordering sites where a company's own staff order supplies.<\/p>\n\n<h4>CrewCommerce Pro<\/h4>\n\n<p>CrewCommerce is complete on its own. <a href=\"https:\/\/crewcommercepro.com\/\">CrewCommerce Pro<\/a> is the paid edition. It includes everything in CrewCommerce, plus more control for stores whose business customers grow:<\/p>\n\n<ul>\n<li>Monthly spending limits per person, enforced at checkout, with Spend Reports.<\/li>\n<li>A different approval threshold for each company, product categories that always need approval, and two approval steps (a Manager, then the Admin).<\/li>\n<li>Comments on each order before it's decided, bulk approve and reject, and reminder emails for approvals left waiting.<\/li>\n<li>Customers create their own company at registration and colleagues join with a private link.<\/li>\n<li>Fast Restock: a one-page reorder list of what each company buys most.<\/li>\n<li>Company Order History for customers' managers, an Activity Log, and CSV export of approvals.<\/li>\n<\/ul>\n\n<h4>Documentation<\/h4>\n\n<p>Setup guides, every setting and common questions: <a href=\"https:\/\/crewcommercepro.com\/docs\/\">crewcommercepro.com\/docs<\/a>.<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Install and activate WooCommerce.<\/li>\n<li>Install CrewCommerce from Plugins \u203a Add New, or upload the zip, then activate it.<\/li>\n<li>Go to CrewCommerce \u203a Companies and add a company. Pick an existing customer account to be its Admin.<\/li>\n<li>Open the company and add its team with Invite Member.<\/li>\n<li>Go to CrewCommerce \u203a Settings and set the order value that needs approval.<\/li>\n<\/ol>\n\n<p>Place a test order as a Requester above that value, then approve it as the Manager under My Account \u203a Pending Approvals.<\/p>\n\n<!--section=faq-->\n<dl>\n<dt id=\"does%20woocommerce%20have%20company%20accounts%20or%20order%20approval%20built%20in%3F\"><h3>Does WooCommerce have company accounts or order approval built in?<\/h3><\/dt>\n<dd><p>No. A WooCommerce customer account belongs to one person, and there's no step where someone at the customer's company reviews an order. CrewCommerce adds both.<\/p><\/dd>\n<dt id=\"who%20approves%20orders%3A%20me%20or%20my%20customer%3F\"><h3>Who approves orders: me or my customer?<\/h3><\/dt>\n<dd><p>Your customer. A Manager or the Admin at the customer's own company approves their colleagues' orders. You only step in when a company has nobody who can approve, and then you can claim the order from CrewCommerce \u203a Approvals.<\/p><\/dd>\n<dt id=\"is%20the%20customer%20charged%20before%20the%20order%20is%20approved%3F\"><h3>Is the customer charged before the order is approved?<\/h3><\/dt>\n<dd><p>No. WooCommerce skips the payment step for an order that is held for approval. Once it's approved, card orders get a payment link by email and a Pay Now button in My Requests. Bank transfer, check and cash on delivery orders continue as they would have at checkout.<\/p><\/dd>\n<dt id=\"can%20a%20manager%20approve%20their%20own%20order%3F\"><h3>Can a Manager approve their own order?<\/h3><\/dt>\n<dd><p>No. If Managers are included in the approval rules, a Manager's order goes to another Manager or the company Admin. Admins never need approval.<\/p><\/dd>\n<dt id=\"what%20happens%20if%20an%20item%20sells%20out%20while%20an%20order%20waits%3F\"><h3>What happens if an item sells out while an order waits?<\/h3><\/dt>\n<dd><p>Stock isn't reserved while an order waits. If there isn't enough stock left when someone approves it, the approval is refused with a message saying how many are left, and a note is added to the order.<\/p><\/dd>\n<dt id=\"does%20it%20work%20with%20the%20block%20checkout%3F\"><h3>Does it work with the block checkout?<\/h3><\/dt>\n<dd><p>Yes. CrewCommerce works with the block checkout and the classic checkout, and with High-Performance Order Storage on or off.<\/p><\/dd>\n<dt id=\"does%20it%20change%20my%20prices%20or%20catalog%3F\"><h3>Does it change my prices or catalog?<\/h3><\/dt>\n<dd><p>No. CrewCommerce doesn't touch prices, products or the catalog. Your customers shop and check out as they do now; the company screens are added to My Account.<\/p><\/dd>\n<dt id=\"can%20customers%20create%20their%20own%20company%3F\"><h3>Can customers create their own company?<\/h3><\/dt>\n<dd><p>In CrewCommerce, you create each company in WP Admin and its Admin invites the team. <a href=\"https:\/\/crewcommercepro.com\/\">CrewCommerce Pro<\/a> adds company sign-up at registration and join links.<\/p><\/dd>\n<dt id=\"is%20there%20a%20limit%20on%20companies%2C%20members%20or%20orders%3F\"><h3>Is there a limit on companies, members or orders?<\/h3><\/dt>\n<dd><p>No.<\/p><\/dd>\n<dt id=\"what%20happens%20to%20my%20data%20if%20i%20deactivate%20or%20delete%20the%20plugin%3F\"><h3>What happens to my data if I deactivate or delete the plugin?<\/h3><\/dt>\n<dd><p>Orders are ordinary WooCommerce orders and logins are ordinary WordPress accounts, so they stay. CrewCommerce keeps its own records too, unless you tick \"Delete all CrewCommerce data when the plugin is deleted\" in CrewCommerce \u203a Settings before deleting it.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0.0<\/h4>\n\n<ul>\n<li>First release on WordPress.org.<\/li>\n<li>Company accounts, roles, email invitations, approval before payment, Pending Approvals, My Requests and the WP Admin screens.<\/li>\n<\/ul>","raw_excerpt":"Let the companies that buy from your WooCommerce store order as a team, with their own logins and approval from their own manager.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/382716","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=382716"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/nlemsieh"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=382716"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=382716"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=382716"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=382716"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=382716"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=382716"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}