Luigi Donato Posted August 23, 2017 Share Posted August 23, 2017 (edited) Hi, new question, new function .. I want to import orders and customer details at the time of creation.. Could you tell me the name of the class that adds the order and the name of the class that adds the customer details to the PS?I want to export just when the order was paid Edited August 23, 2017 by LuigiD (see edit history) Link to comment Share on other sites More sharing options...
Scully Posted August 23, 2017 Share Posted August 23, 2017 To mention your prestashop version could be helpful. However, assuming classes do not change that much, the names are quite self-explanatory. Order.php and Customer.php are the classes - valid for PS 1.6.xx. Note that classes are controlled by the corresponding controllers. Link to comment Share on other sites More sharing options...
Luigi Donato Posted August 23, 2017 Author Share Posted August 23, 2017 (edited) Version 1.6, I'm trying to create a module, I have find the hook hookActionValidateOrder and this work when the order has completed, but I can not access specific values.I have tried this code: public function hookActionValidateOrder($params) { $value = $params['customer']['firstname']; $fp = fopen("log.txt", "a+"); fwrite($fp, "$value\r"); fclose($fp); } And this: public function hookActionValidateOrder($params) { $value = $params->customer; $value = $values['firstname']; $fp = fopen("log.txt", "a+"); fwrite($fp, "$value\r"); fclose($fp); } An array's print_r example result: Array ( [cart] => Cart Object ( [id] => 22 ) [customer] => Customer Object ( [firstname] => John ) ) Edited August 23, 2017 by LuigiD (see edit history) Link to comment Share on other sites More sharing options...
Luigi Donato Posted August 23, 2017 Author Share Posted August 23, 2017 Solved with this: $value = $params['customer']->firstname; Link to comment Share on other sites More sharing options...
Scully Posted August 23, 2017 Share Posted August 23, 2017 Please add 'SOLVED' to the topic title by editing your first post if your issue has been solved. Thank you. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now