Jump to content

Customer object is empty


Recommended Posts

Hello, 

I have an multistore with 3 shops. For one of them I need have validation for customer logged in. I created 2 accounts and I logged in.

I override indexcontroller.php and I put this:

if($this->context->shop->id == 1)
        {
            if($this->context->customer->id == '')
            {
                Tools::redirect('index.php?controller=authentication'); 
            }
        }

When I enter in index page, the customer object is empty and I got redirrect to my-account page. (Here I see my addresses, name, etc - the customer is 100% logged). Can you help me? What is wrong?

This is the customer object:

 

Customer Object ( [id] => [id_shop] => [id_shop_group] => [secure_key] => [note] => [id_gender] => 0 [id_default_group] => 3 [id_lang] => [lastname] => [firstname] => [birthday] => => [newsletter] => [ip_registration_newsletter] => [newsletter_date_add] => [optin] => [website] => [company] => [siret] => [ape] => [outstanding_allow_amount] => 0 [show_public_prices] => 0 [id_risk] => [max_payment_days] => 0 [passwd] => [last_passwd_gen] => [active] => 1 [is_guest] => 0 [deleted] => 0 [date_add] => [date_upd] => [years] => [days] => [months] => [geoloc_id_country] => [geoloc_id_state] => [geoloc_postcode] => [logged] => 0 [id_guest] => [groupBox] =>.....)

 

Thank you!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...