saveCustomer example

/** * @throws Exception */
    public function register(
        ShopStruct $shop,
        Customer $customer,
        Address $billing,
        ?Address $shipping = null
    ) {
        $this->modelManager->beginTransaction();
        try {
            $this->saveCustomer($shop$customer);

            $this->addressService->create($billing$customer);
            $this->addressService->setDefaultBillingAddress($billing);

            if ($shipping !== null) {
                $this->addressService->create($shipping$customer);
                $this->addressService->setDefaultShippingAddress($shipping);
            } else {
                $this->addressService->setDefaultShippingAddress($billing);
            }

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