14 hours ago, ps8moduly.cz said:In the console I can see the response from the module and the customer data correctly.
a:9:{s:9:"firstname";s:7:"scarlet";s:8:"lastname";s:8:"johansan";s:5:"email";s:18:"[email protected]";s:8:"password";s:60:"$2y$10$vT7lJl6p67gfZq4Kt5j3Ye2.R/RTnWmvC1c1wEsxi6TLwSN6gfHg6";s:14:"plain_password";s:15:"AAAbbb@1234$$$$";s:7:"company";s:0:"";s:5:"siret";s:0:"";s:3:"ape";s:0:"";s:8:"is_guest";s:1:"0";}a:9:{s:9:"firstname";s:7:"scarlet";s:8:"lastname";s:8:"johansan";s:5:"email";s:18:"[email protected]";s:8:"password";s:60:"$2y$10$vT7lJl6p67gfZq4Kt5j3Ye2.R/RTnWmvC1c1wEsxi6TLwSN6gfHg6";s:14:"plain_password";s:11:"Abcd@1234$$";s:7:"company";s:0:"";s:5:"siret";s:0:"";s:3:"ape";s:0:"";s:8:"is_guest";s:1:"0";}a:9:{s:9:"firstname";s:4:"Test";s:8:"lastname";s:6:"Tester";s:5:"email";s:14:"[email protected]";s:8:"password";s:60:"$2y$10$VGPDPJv.TMc/1K/RzuntueKWyhD/haVygAXconepjGpVVrSeNsjIK";s:14:"plain_password";s:9:"undefined";s:7:"company";s:0:"";s:5:"siret";s:0:"";s:3:"ape";s:0:"";s:8:"is_guest";s:1:"0";}
@ps8moduly.cz you are getting this customer object because I have hardcoded a customerId to test remaining code part. Scarlet Johansan customer's customerId 72. Let me remove that hardcoded value.
After remove it, customer object doesn't receive in this context.
And if you refer to that customer data printed in console, CustomerId is missing in that object.
a:9:{s:9:"firstname";s:7:"scarlet";s:8:"lastname";s:8:"johansan";s:5:"email";s:18:"[email protected]";s:8:"password";s:60:"$2y$10$vT7lJl6p67gfZq4Kt5j3Ye2.R/RTnWmvC1c1wEsxi6TLwSN6gfHg6";s:14:"plain_password";s:15:"AAAbbb@1234$$$$";s:7:"company";s:0:"";s:5:"siret";s:0:"";s:3:"ape";s:0:"";s:8:"is_guest";s:1:"0";}a:9:{s:9:"firstname";s:7:"scarlet";s:8:"lastname";s:8:"johansan";s:5:"email";s:18:"[email protected]";s:8:"password";s:60:"$2y$10$vT7lJl6p67gfZq4Kt5j3Ye2.R/RTnWmvC1c1wEsxi6TLwSN6gfHg6";s:14:"plain_password";s:11:"Abcd@1234$$";s:7:"company";s:0:"";s:5:"siret";s:0:"";s:3:"ape";s:0:"";s:8:"is_guest";s:1:"0";}a:9:{s:9:"firstname";s:4:"Test";s:8:"lastname";s:6:"Tester";s:5:"email";s:14:"[email protected]";s:8:"password";s:60:"$2y$10$VGPDPJv.TMc/1K/RzuntueKWyhD/haVygAXconepjGpVVrSeNsjIK";s:14:"plain_password";s:9:"undefined";s:7:"company";s:0:"";s:5:"siret";s:0:"";s:3:"ape";s:0:"";s:8:"is_guest";s:1:"0";}
$currentCustomer = $context->customer; //$response = $module->newRegisteredCustomer($email, $pwd, $idCustomer); if ($idCustomer) { $response = $module->newRegisteredCustomer($email, $pwd, $idCustomer); } else { $response = $module->l(serialize($currentCustomer)); }