| 123456789101112131415161718 |
- <?php
- // this hook sets the order status to accepted if order is free
- if (!defined("WHMCS"))
- die("This file cannot be accessed directly");
- add_hook('AfterShoppingCartCheckout', 1, function($vars) {
- if($vars['TotalDue'] == 0) {
- $api = localAPI('acceptorder', array('orderid' => $vars['OrderID']));
- if ($api['result'] == 'success') {
- return true;
- } else {
- $errormessage .= $api['message'];
- return false;
- }
- }
- });
|