Hi,

Well yes, your suggestion makes sense, but on the other hand it is
convenient to detect if the user is logged in or not just by using
 if ($this->getUser()){}
or in templates:
 [{ if $oxcmp_user }]

For your isBigCustomer() case I can at least suggest to save one if and
do something like:
if ($user && $user->isBigCustomer()) {
    //do smthing
}

Regards
Tomas Liubinas

> -----Original Message-----
> From: [email protected] [mailto:dev-general-
> [email protected]] On Behalf Of Christopher Simon
> Sent: Monday, November 02, 2009 2:18 PM
> To: [email protected]
> Subject: [oxid-dev-general] alternative user handling
> 
> Hi,
> 
> i have a suggestion for an alternative way to handle users in eShop:
> 
> Currently, if a user is registered you have the oxcmp_user object and
> the "getUser()" method of oxsession return a user. If a user isn't
> registered, you get "null".
> 
> What if we would have a user object which is permanently there,
> regardless of the login state. If a user isn't logged in, you have an
> dummy user which doesn't appear in db and which only purpose is to
> represent unregistered users.
> 
> Now you have to implement user dependant stuff like this:
> 
> $user = oxSession::getInstance()->getUser();
> 
> if ($user === null) {
>      if($user->isBigCustomer() === true) {
>          // do something big
>      }
> }
> 
> with a dummy:
> 
> if (oxSession::getInstance()->getUser()->isBigCustomer() === true) {
>     // do something big
> }
> 
> Even further, you could assign Shipping Sets much better (with the
> addition of an "unregistered" usergroup which every unregistered
> customer).
> 
> If you want to  assign a shipping set to unregistered users and to
users
> which are in the group "not yet ordered" you have to create 2 shipping
> rules for the same purpose. With the dummy user and his group, this
> isn't necessary anymore.
> 
> Feel free to discuss :)
> 
> 
> _______________________________________________
> dev-general mailing list
> [email protected]
> http://dir.gmane.org/gmane.comp.php.oxid.general
_______________________________________________
dev-general mailing list
[email protected]
http://dir.gmane.org/gmane.comp.php.oxid.general

Reply via email to