{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} {$_config.block_name}: {$contact.name|escape} [`Logout`] {else} {$_config.block_name} {if $wa->isAuthEnabled()} [`Log in or sign up`] {/if} {/if} {* BODY *} {if !empty($_error_text)} {$_error_text} {else} {if !empty($_show_types_toggle)} [`Customer type`] {foreach $_types as $_type} {$_is_active = false} {if $_active_type.id == $_type.id}{$_is_active = true}{/if} {$_type.name|escape} {/foreach} {/if} {if !empty($_is_company) && !empty($_config["company_hint"])} {$_config["company_hint"]|escape} {/if} {if !empty($auth.fields_order)} {* shop_order_render_field function here *} {include file="./render_field.function.html" inline} {foreach $auth.fields_order as $_field_id} {if !empty($auth.fields[$_field_id])} {$_field = $auth.fields[$_field_id]} {else} {continue} {/if} {shop_order_render_field _field=$_field} {/foreach} {/if} {if !empty($_config["service_agreement"]) && !empty($_config["service_agreement_hint"])} {if ($_config["service_agreement"] == "checkbox")} {$_config["service_agreement_hint"]} {else} {$_config["service_agreement_hint"]} {/if} {/if} {if !empty($_is_company) && !empty($_config["company_terms"])} {$_config["company_terms"]} {/if} {/if} {* @event checkout_render_auth *} {foreach $event_hook.auth as $_} {$_} {/foreach} {$wa->globals("wa_order_form", $_form_globals)} {/strip}