0

I face strange problem after I create remotely customer via Prestashop 1.6 Webservice and try to login (to Prestashop frontend) with his email and password.

Customer is logged in correctly but page is displayed without content, just empty layout divs. No menu, footer, hooks... Only the logo:

enter image description here

When I replace URL to get into "My account", it works, but no header/footer is displayed.

Other users that were created in standard way can log in correctly and all the content is displayed.

What could be the problem? Did I forget to fill some of the madatory fields for customer when using webservice?

I created customer with these fields filled:

lastname
firstname
email
passwd
active
note

PS: I also found out, that last visit of this user in Prestashop admin remains blank after login...

Thank you :)

2
  • Which version of PrestaShop? Have you activated the debug mode?
    – marsaldev
    Jun 27, 2017 at 13:49
  • @sarcom Prestashop 1.6.1.9, and yes, despite debug mode is on, no error appears. I think it has something to do with customer rights or something. Can you help or at least navigate me closer to the solution? Thanks! Jun 28, 2017 at 7:30

1 Answer 1

1

I did it! :)

I found out that customer_group isn't set correctly in the database. All the customers have customer_group set to 3 but this one (created via webservice) has 0.

After a while I found an answer in the Prestashop forum: https://www.prestashop.com/forums/topic/290508-customer-group-webservice-acccess/

When creating customer via Webservice these parameters must be set:

$this->xml->customer[0]->id_default_group = 3;
$this->xml->customer[0]->associations->groups->group->id = 3;

The second line is more important. First I thought that setting id_default_group is enough but it is not. You need also to set assocations like this to insert record into customer_group table.

Now it works like a freaking charm! :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.