{strip} {$_form_globals = $wa->globals("wa_order_form")} {$_form_globals["auth"] = [ "locked" => false ]} {$_config = $config.customer} {$_errors = []} {if !empty($error_step_id) && $error_step_id === "auth"}{$_errors = $errors}{/if} {$_person = shopCheckoutConfig::CUSTOMER_TYPE_PERSON} {$_company = shopCheckoutConfig::CUSTOMER_TYPE_COMPANY} {$_show_types_toggle = ($_config.type == shopCheckoutConfig::CUSTOMER_TYPE_PERSON_AND_COMPANY)} {if !empty($auth.contact_id)} {$_show_types_toggle = false} {/if} {$_error_text = null} {$_me_is_person = null} {$_me_is_company = null} {if !empty($auth.contact_id)} {$_me_is_person = empty($contact["is_company"])} {$_me_is_company = !empty($contact["is_company"])} {/if} {if $_config.type == shopCheckoutConfig::CUSTOMER_TYPE_PERSON} {if !empty($_me_is_company)} {$_form_globals["auth"]["locked"] = true} {$_error_text = sprintf('[`You are authorized as a company, and orders can be placed only by persons. Please %slog out%s of your account to check out as a person.`]', "", "")} {/if} {elseif $_config.type == shopCheckoutConfig::CUSTOMER_TYPE_COMPANY} {if !empty($_me_is_person)} {$_form_globals["auth"]["locked"] = true} {$_error_text = sprintf('[`You are authorized as a person, and orders can be placed only by companies. Please %slog out%s of your account to check out as a company.`]', "", "")} {/if} {elseif $_config.type == shopCheckoutConfig::CUSTOMER_TYPE_PERSON_AND_COMPANY} {if !empty($_me_is_person) || !empty($_me_is_company)} {$_show_types_toggle = false} {/if} {/if} {$_types = [ "`$_person`" => [ id => $_person, name => $_config.person_mode_name ], "`$_company`" => [ id => $_company, name => $_config.company_mode_name ] ]} {$_active_type = $_types["person"]} {if !empty($auth.selected_mode) && !empty($_types[$auth.selected_mode])} {$_active_type = $_types[$auth.selected_mode]} {/if} {$_is_company = ($_active_type.id == "company")}
{* HEADER *}
{if !empty($auth.contact_id)} {$_hint = $_config.offer_logout} {if !empty($_is_company)} {$_hint = $_config.company_hint} {/if} {else} {if $wa->isAuthEnabled()} {/if} {/if}
{* BODY *}
{if !empty($_error_text)} {else} {if !empty($_show_types_toggle)} {/if} {if !empty($_is_company) && !empty($_config["company_hint"])} {/if} {if !empty($auth.fields_order)} {/if} {if !empty($_config["service_agreement"]) && !empty($_config["service_agreement_hint"])} {/if} {if !empty($_is_company) && !empty($_config["company_terms"])} {/if} {/if} {* @event checkout_render_auth *} {foreach $event_hook.auth as $_} {/foreach}
{$wa->globals("wa_order_form", $_form_globals)} {/strip}