Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "GuestCustomer" property "CustomerLoggedinEvent" #7575

Open
atiq-bs23 opened this issue Feb 13, 2025 · 1 comment
Open

Add "GuestCustomer" property "CustomerLoggedinEvent" #7575

atiq-bs23 opened this issue Feb 13, 2025 · 1 comment

Comments

@atiq-bs23
Copy link
Contributor

Currently, CustomerLoggedinEvent only contains the logged-in customer object. Adding a GuestCustomer field will give developers more flexibility to migrate data from plugins using the event.

CustomerRegistrationService Line 449

@RomanovM RomanovM added this to the Version 4.90 milestone Feb 25, 2025
@AndreiMaz AndreiMaz changed the title Add GuestCustomer Field to CustomerLoggedinEvent Add "GuestCustomer" property "CustomerLoggedinEvent" Feb 25, 2025
@G3r4rd00
Copy link

Refactored the logic for assigning the previous customer when publishing the CustomerLoggedinEvent. Instead of checking if currentCustomer.Id is different from customer.Id, this change ensures that only guest customers are assigned. This makes the logic clearer and aligns better with customer session handling.

Proposed change:


// Check if currentCustomer is a guest
if (await _customerService.IsGuestAsync(currentCustomer))
{
    gestCustomer = currentCustomer;
}

Let me know if you see any concerns!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants