gsouza Posted August 25, 2017 Share Posted August 25, 2017 Olá Pessoal! Estou com uma pequena dúvida e gostaria do auxilio de vocês para corrigir. O Gancho abaixo, deveria modificar o botão de pagamento, quando a fatura esta vencida, porem, não esta funcionando. Poderia me ajudar a encontrar o erro ? <?php function invoice_hide_button_hook($vars) { $today = strtotime($vars['today']); $duedate = strtotime($vars['duedate']); if($today > $duedate) { return array("paymentbutton" => '<a href="submitticket.php?step=2&deptid=2" class="btn btn-danger">Contate-nos</a>'); } } add_hook("ClientAreaPageViewInvoice", 1, "invoice_hide_button_hook"); 0 Quote Link to comment Share on other sites More sharing options...
edvan Posted August 25, 2017 Share Posted August 25, 2017 40 minutos atrás, suportgc disse: Olá Pessoal! Estou com uma pequena dúvida e gostaria do auxilio de vocês para corrigir. O Gancho abaixo, deveria modificar o botão de pagamento, quando a fatura esta vencida, porem, não esta funcionando. Poderia me ajudar a encontrar o erro ? <?php function invoice_hide_button_hook($vars) { $today = strtotime($vars['today']); $duedate = strtotime($vars['duedate']); if($today > $duedate) { return array("paymentbutton" => '<a href="submitticket.php?step=2&deptid=2" class="btn btn-danger">Contate-nos</a>'); } } add_hook("ClientAreaPageViewInvoice", 1, "invoice_hide_button_hook"); Até via sua resposta no tópico original https://forum.whmcs.com/showthread.php?132365-Hide-Pay-button-on-invoice-when-due Utilize o código abaixo: <?php function invoice_hide_button_hook($vars) { if (new DateTime() > DateTime::createFromFormat('d/m/Y', $vars['duedate'])) { return array("paymentbutton" => '<a href="submitticket.php?step=2&deptid=2" class="btn btn-danger">Contate-nos</a>'); } } add_hook("ClientAreaPageViewInvoice", 1, "invoice_hide_button_hook"); Teste OK http://prntscr.com/gcz5ux 1 Quote Link to comment Share on other sites More sharing options...
gsouza Posted August 25, 2017 Author Share Posted August 25, 2017 2 minutos atrás, edvan disse: Até via sua resposta no tópico original https://forum.whmcs.com/showthread.php?132365-Hide-Pay-button-on-invoice-when-due Utilize o código abaixo: <?php function invoice_hide_button_hook($vars) { if (new DateTime() > DateTime::createFromFormat('d/m/Y', $vars['duedate'])) { return array("paymentbutton" => '<a href="submitticket.php?step=2&deptid=2" class="btn btn-danger">Contate-nos</a>'); } } add_hook("ClientAreaPageViewInvoice", 1, "invoice_hide_button_hook"); Teste OK http://prntscr.com/gcz5ux Incrível. Resolvido em segundos. Haha Obrigado mestre. 0 Quote Link to comment Share on other sites More sharing options...
edvan Posted August 25, 2017 Share Posted August 25, 2017 2 minutos atrás, suportgc disse: Incrível. Resolvido em segundos. Haha Obrigado mestre. Não foi resolvido em segundos, eu já conhecia a customização e percebi o problema desde que o Brian! compartilhou... provavelmente para ele não teve erro pois a data/hora do WHMCS que ele efetuou o teste estava em YYYY/MM/DD e para ele funcionou! 0 Quote Link to comment Share on other sites More sharing options...
gsouza Posted August 25, 2017 Author Share Posted August 25, 2017 1 minuto atrás, edvan disse: Não foi resolvido em segundos, eu já conhecia a customização e percebi o problema desde que o Brian! compartilhou... provavelmente para ele não teve erro pois a data/hora do WHMCS que ele efetuou o teste estava em YYYY/MM/DD e para ele funcionou! Entendi. Então provavelmente funcionaria se o meu estivesse em versão americana. Muito legal. Obrigado 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.