Jump to content

need help with Correct PHP code for customizing a module


Andrew Watson

Recommended Posts

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

Guest
This topic is now closed to further replies.
×
×
  • Create New...