Filippo Posted March 30 Share Posted March 30 Hello, i've try to integrate a hook function but not work: <?php function customAfterInvoicingHook($vars) { $invoiceId = $vars['invoiceid']; $invoiceDetails = localAPI('GetInvoice', array('invoiceid' => $invoiceId)); $xmlContent = '<?xml version="1.0" encoding="UTF-8"?>'; $xmlContent .= '<invoice>'; $xmlContent .= '<invoice_id>' . $invoiceDetails['id'] . '</invoice_id>'; $xmlContent .= '<client_id>' . $invoiceDetails['userid'] . '</client_id>'; $xmlContent .= '</invoice>'; $xmlFilePath = '/fatture/' . $invoiceId . '.xml'; file_put_contents($xmlFilePath, $xmlContent); } add_hook('AfterInvoicingGenerateInvoiceItems', 1, 'customAfterInvoicingHook') I put this inside /includes/hooks/custom_invoice_hook.php but when i generate invoice nothing append, no file generated, no error in the server log, can you help to fix that? Have nice day 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.