CustomerSetDefaultShippingAddressEvent example

$event = new CustomerSetDefaultBillingAddressEvent($context$customer$addressId);
                $this->eventDispatcher->dispatch($event);

                break;
            default:
                $data = [
                    'id' => $customer->getId(),
                    'defaultShippingAddressId' => $addressId,
                ];

                $event = new CustomerSetDefaultShippingAddressEvent($context$customer$addressId);
                $this->eventDispatcher->dispatch($event);

                break;
        }

        $this->customerRepository->update([$data]$context->getContext());

        return new NoContentResponse();
    }
}
Home | Imprint | This part of the site doesn't use cookies.