Andrew Watson Posted October 24, 2014 Share Posted October 24, 2014 I have a module which creates a text file for new customer and new orders. This text file is used to sync with our accounting program. But what I want its that whenever it creates the text file for new orders, it ALSO creates a txt file for the customer. The php is here: public function hookCreateAccount($params) { include_once('classes/Factusol.php' ); return Factusol::createCustomerFile($params['newCustomer']); } public function hookOrderConfirmation($params) { include_once('classes/Factusol.php' ); $order = $params['objOrder']; if($order->valid == '1') return Factusol::createOrderFile($order); return false; } So basically I want what happens in hookCreateAccount to also happen in hookOrderConfirmation. The twist is that the customer is not new. I figure I just need to add the following line to hookOrderConfirmation, but I don't know what syntax would be correct for an existing customer. return Factusol::createCustomerFile($params['newCustomer']); Does anyone have any thoughts? Or do you need additional info? Link to comment Share on other sites More sharing options...
Andrew Watson Posted October 28, 2014 Author Share Posted October 28, 2014 (edited) This post is in the wrong place (I think) ... I moved it here (I hopt that was the right thing to do..) http://www.prestashop.com/forums/topic/374056-need-help-with-correct-php-code-for-customizing-a-module/ Can an Admin or Mod delete this post. I am unable to. Edited October 28, 2014 by Andrew Watson (see edit history) Link to comment Share on other sites More sharing options...
vekia Posted October 28, 2014 Share Posted October 28, 2014 okay, thanks for informations im closing it continue discussion below: http://www.prestashop.com/forums/topic/374056-need-help-with-correct-php-code-for-customizing-a-module/ Link to comment Share on other sites More sharing options...
Recommended Posts