setCustomerType example

$this->connection->insert('s_emarketing_referer', [
            'userID' => $customer->getId(),
            'referer' => $customer->getReferer(),
            'date' => date('Y-m-d H:i:s'),
        ]);
    }

    private function saveCustomer(ShopStruct $shop, Customer $customer): void
    {
        if ($customer->getValidation() !== ContextService::FALLBACK_CUSTOMER_GROUP) {
            $customer->setCustomerType(Customer::CUSTOMER_TYPE_BUSINESS);
        }

        $customerConfirmed = !$customer->getDoubleOptinRegister() || $customer->getDoubleOptinConfirmDate() !== null;
        $customer->setActive($customerConfirmed);

        if (!$customerConfirmed) {
            // Reset login information if Double-Opt-In is active             $customer->setFirstLogin(null);
            $customer->setLastLogin(null);
            $customer->setDoubleOptinEmailSentDate(new DateTime());
        }

        
Home | Imprint | This part of the site doesn't use cookies.