Jump to content

Desabilitar Faturas Grátis 0.00


Recommended Posts

Pessoal, se alguém já sabia, ou já tinha postado.

Peço desculpas, mas não achei na busca.

Arquivo para não enviar faturas de produtos grátis com 0.00

Salve com o nome que desejar em includes/hooks


<?php

function disable_00_invoices($vars) {


$email_template_name = $vars['messagename']; # Email template name being sent

$relid = $vars['relid']; # Related ID it's being sent for - client ID, invoice ID, etc...


//Checking for certain template name, if so - this is our case

if ($email_template_name == "Invoice Created" || $email_template_name == "Invoice Payment Confirmation")

{

//getting total of the invoice

$result = select_query('tblinvoices', 'total', array("id" => $relid));

$data = mysql_fetch_assoc($result);

//if it is equal to '0.00' we disable email sending

if (isset($data['total']) && $data['total'] == '0.00')

$merge_fields['abortsend'] = true;

}


return $merge_fields;

}


add_hook("EmailPreSend",1,"disable_00_invoices");

?>

Abxx

fonte: http://www.whmcsjet.com/how-to-disable-invoice-generation-for-0-00-invoices/

:P

Link to comment
Share on other sites

certo dentro do includes/hooks tem arquivo php chamado exemple é para adicionar dentro dele ou criar novo arquivo?

Criar novo arquivo, observe q ele diz:

Arquivo para não enviar faturas de produtos grátis com 0.00

Salve com o nome que desejar em includes/hooks

Boa sorte!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.

×
×
  • Create New...

Important Information

Do you agree with our terms?