Jump to content

sonuyos

Member
  • Content Count

    125
  • Joined

  • Last visited

Community Reputation

0 Neutral

About sonuyos

  • Rank
    Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Can we manipulate thr session cookie? I will check the method you posted shortly. Thanks.
  2. See, honestly it shouldnt matter why i need to access the page, the functionality should be there to access any page that one like. There are certain variables that i would like to fetch.
  3. Fr fetching the variables on the page and verifying everything is working fine.
  4. I wanted to know how i can access the complete page without having to place a new order? Even after placing a new order, that page is accessible for like couple of hours, what flag/cookie do I have to set in order to access the page without needing to place a new order every time.?
  5. Ioncube 12.0 is out with PHP 8.1 Support for almost 16hours, where is our WHMCS PHP 8.1 support at? /s
  6. I have written this code and the print_r output it correct and shows the valid username and password of the service in the - https:// domain. com /billing/ADMIN/orders.php?action=view&id=ORDERID However i want to have it displayed in a table format here - Can anyone help me? I have no idea how to put the HTML code output at that location, or to be honest in any location on the WHMCS admin order page. There are multiple output, depending on the number of orders/service the order page has. Hence why i am using foreach. Location of the place i want output. My code - https://3v4l.org/bFpOT (unable to post here).
  7. I wonder why my code isnt working with cron.
  8. YESSS THAT WORKS. However now, when i try to terminate it from the panel, it works fine and marks invoice cancelled, but if i run cron, it doesnt, shouldnt it mark it cancelled even with cron?
  9. @brian! According to this page - https://developers.whmcs.com/hooks-reference/module/#aftermoduleterminate and this - https://developers.whmcs.com/provisioning-modules/module-parameters/ The module should provide serviceid by defualt and producttype too, but it does not. i am doing something wrong?
  10. No no, you got that wrong, my code works completely, its just that i am unable to pass $serviceid & $producttype from vars. This section does not work. add_hook('AfterModuleTerminate', 1, function($vars) { $serviceid=$vars['serviceid']; $producttype=$vars['producttype'];
  11. <?php if (!defined("WHMCS")) die("This file cannot be accessed directly"); use WHMCS\Database\Capsule; add_hook('AfterModuleTerminate', 1, function($vars) { $serviceid=$vars['serviceid']; $producttype=$vars['producttype']; $invoices=Capsule::table("tblinvoiceitems")->where("relid","$serviceid")->where("type","$producttype")->get(); foreach($invoices as $invoice) { $results = localAPI("GetInvoice",array("invoiceid"=>$invoice->invoiceid,"status"=>"Unpaid")); if ($results["status"]=="Unpaid") { $cancelinvoiceid=$results["invoiceid"]; $results = localAPI("UpdateInvoice",array("invoiceid"=>"$cancelinvoiceid","status"=>"Cancelled")); logactivity("[INVOICECANCELHOOK] has cancelled Invoice ID: $cancelinvoiceid automatically."); } } }); Updated the code a litter bit to make sure it works if serviceid is provided. The code is working now, but still unable to set it to cancel automatically becausse there is way i can pass serviceid variable.
  12. This is my code, it is in WIP, and i am facing issue. Theorotically it works fine, however for some reason the vars are not passing thru, the service id & product type are empty, causing ALL the invoices to get cancelled, anyway to solve this? I do not know what i am doing wrong, it should work. <?php if (!defined("WHMCS")) die("This file cannot be accessed directly"); use WHMCS\Database\Capsule; add_hook('AfterModuleTerminate', 1, function($vars) { $serviceid=$vars['serviceid']; $producttype=$vars['producttype']; $invoices=Capsule::table("tblinvoiceitems")->where("relid","$serviceid")->where("type","$producttype")->get(); foreach($invoices as $invoice) { $results = localAPI("GetInvoice",array("invoiceid"=>$invoice->id); if ($results["status"]=="Unpaid") { $cancelinvoiceid=$results["invoiceid"]; $results = localAPI("UpdateInvoice",array("invoiceid"=>"$cancelinvoiceid","status"=>"Cancelled")); logactivity("[INVOICECANCELHOOK] has cancelled Invoice ID: $cancelinvoiceid automatically."); } } });
  13. New prices are In effect from July 1st 2021.
  14. So i updated WHMCS to latest this week, waited long enough for all the issues to iron out. but now i am facing this issue. I have a custom script that uses variables which is passed on the client area by template. "$template->tpl_vars" and to be able to use this, i had added a code in configuration.php $smarty_security_policy = array( 'system' => array( 'disabled_tags' => [], 'enabled_special_smarty_vars' => array( 'template_object', ), ), ); However in latest update, if i have this added, the site does not work, throws random error like Smarty Error: Syntax error in template "file:/home/USER/public_html/billing/templates/orderforms/standard_cart_twenty_one_point_oh/checkout.tpl" on line 53 "<form method="post" action="{$smarty.server.PHP_SELF}?a=checkout" name="orderfrm" id="frmCheckout">" special variable '$smarty.server' not allowed by security setting How can i make sure that both, the WHMCS and the custom script works here?
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated