2

Is there any scenario where the B2B customer can be anonymous as well in Hybris?

The method:

public CustomerModel getAnonymousUser() {
    return (CustomerModel)this.getSessionService().executeInLocalView(new SessionExecutionBody() {
        public Object execute() {
            DefaultUserService.this.searchRestrictionService.disableSearchRestrictions();
            return DefaultUserService.this.getUserForUID(UserConstants.ANONYMOUS_CUSTOMER_UID, CustomerModel.class);
        }
    });
}

in DefaultUserService.java suggests that the anonymous user will be of type Customer.

Is there any scenario where it can be of type B2BCustomer?

Farrukh Chishti
  • 7,652
  • 10
  • 36
  • 60

2 Answers2

2

No. AnonymousUser is the non-authenticated user that just picks up generic site default settings. B2BCustomer is about specific individuals linked to specific B2BUnit (account structure) records, there is no 'generic' B2B user concept.

2

No, it can't.

If you check in Backoffice, under Customers node, you can find an anonymous instance, and its type is Customer (if you check in Administration tab).

B2BCustomer is a subtype of Customer, and they share the same unique attribute: uid. So, you can't have another B2BCustomer instance whose uid is also anonymous.

geffchang
  • 3,279
  • 2
  • 32
  • 58