Jump to content

Craft

Senior Member
  • Content count

    115
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Craft

  1. There are some logs appears on Domain Register or Transfer How to hide it?
  2. Craft

    Some logs appears on Domain Register

    @brian! any help here? :)
  3. I would like to remove some SidebarNav using this hook (https://developers.whmcs.com/themes/sidebars/) I tried to remove "My Account" section in "Account Details" page with menuitemname "My Account" using the following code and it WORKS FINE :) <?php use WHMCS\View\Menu\Item as MenuItem; add_hook('ClientAreaPrimarySidebar', 1, function(MenuItem $primarySidebar) { if (!is_null($primarySidebar->getChild('My Account'))) { $primarySidebar->removeChild('My Account'); } }); My issue that I would like to remove the following sections from other pages but it doesn't work. It doesn't work for "Contacts" section in "Home" page with menuitemname "Client Contacts" It doesn't work for "Shortcuts" section in "Home" page with menuitemname "Client Shortcuts" It doesn't work for "Actions" section in "Services" page with menuitemname "My Services Actions" It doesn't work for "Actions" section in "My Domains" page with menuitemname "My Domains Actions" It doesn't work for "Billing" section in "Billing" page with menuitemname "Billing" It doesn't work for "Support" section in "Support Tickets" page with menuitemname "Support" It doesn't work for "Actions" section in "View Cart" page with menuitemname "Actions" Example: if (!is_null($primarySidebar->getChild('My Services Actions'))) { $primarySidebar->removeChild('My Services Actions'); }
  4. That's what I need exactly, thank you :)
  5. Ok fine, I found this hook to add anything to (Open Ticket) page add_hook('ClientAreaPageSubmitTicket', 1, function($vars) { if (!is_null($secondarySidebar->addChild('Test'))) { $secondarySidebar->getChild('Test') ->addChild('Test'); } }); But it doesn't work, I think I need to edit something in the code :) I tried also add_hook('ClientAreaPageSubmitTicket', 1, function(MenuItem $secondarySidebar) But doesn't work too. Reference: https://developers.whmcs.com/hooks-reference/ticket/
  6. Regarding to "Open Ticket" page, the secondary sidebar nav "Support" is only appearing when there a "Recent Tickets" available. And if there is no any "Recent Tickets", the "Support" nav is disappeared. How can I show "Support" nav all the time?
  7. Perfect I did it, thank you :)
  8. Craft

    Auto Accept Order

    Hi I would like to auto accept any order on payment, so I did the following: General Settings >> Ordering >> Auto Provision Products/Services >> Module Settings >> Auto setup as soon as first payment is received I added this hook (jetserver_AutoAcceptOrders.php) and I set everything to true (Check the screenshot) When I Pay using (promo code with amount ZERO) or (amount $$ but paid from my account balance), I see the hosting is setup successfully, the order is accepted and status is Active. But when I pay using Paypal, I see the hosting is setup successfully and order status is Pending. (Order Accepted is not mentioned at the Activity log).
  9. Your way of thinking is correct.. But I remember when I was using the old code for the old whmcs versions, there was no any updating to client domain status. Kindly find the attached old code for the old whmcs versions, it's nearby to the new code. jetserver_AutoAcceptOrders.php
  10. When I try to transfer a domain, it doesn't choose the Registrar automatic (Already set at "Domain Pricing"). I see the Registrar (None). The system accepts the order, mark it as paid, change the domain status to Active (It should be Pending Transfer) It works and start transferring when I select the Registrar manual and click on "Transfer" module.
  11. Haha don't worry, I'm not a noobie :) Yes, I changed to "true" when I tried yesterday. I tried this also now, and unfortunately same issue The problem is we shouldn't set the domain's status to "Active" until it's actually been registered.
  12. The registrar I'm using (registercom)
  13. I tried that but nothing happened, same issue :)
  14. This is the hook code, how can I pass it? function AutoAcceptOrders_settings() { return array( 'apiuser' => '', // one of the admins username 'autosetup' => true, // determines whether product provisioning is performed 'sendregistrar' => false, // determines whether domain automation is performed 'sendemail' => true, // sets if welcome emails for products and registration confirmation emails for domains should be sent 'ispaid' => true, // set to true if you want to accept only paid orders ); } function AutoAcceptOrders_accept($vars) { $settings = AutoAcceptOrders_settings(); $ispaid = true; if($vars['InvoiceID']) { $result = localAPI('GetInvoice', array( 'invoiceid' => $vars['invoiceId'], ), $settings['apiuser']); $ispaid = ($result['result'] == 'success' && $result['balance'] <= 0) ? true : false; } logActivity("Order isPaid: ".$ispaid,0); if(( $settings['ispaid'] && $ispaid)) { $result = localAPI('AcceptOrder', array( 'orderid' => $vars['orderId'], 'autosetup' => $settings['autosetup'], 'sendemail' => $settings['sendemail'], ), $settings['apiuser']); logActivity("Order Accept", 0); if(is_array($result)){ foreach($result as $index=>$value){ logActivity("$index:$value",0); } } } } add_hook('OrderPaid', 1, 'AutoAcceptOrders_accept');`
  15. Craft

    Discount for the first term only

    I solved it with an easier way :) I will use promocode in the product links, so: I will create a separate promocode for all my terms for each plan and the customer will choose the term from the beginning (from my website which is not related to whmcs), then I will redirect him with the product link with the specific promocode regarding to his selected term. Also I should use "&skipconfig=1" to not open the "Configure" page to the customer and use "&billingcycle=annually" to redirect him to the checkout page direct.
  16. I would like to offer my customers a discount for hosting plans for the first term only then renews at another rate (fixed for all the terms). Example: ( 6 months term: $4.99 for the first time per month then renews at $6.99), (12 months term: $3.99 for the first time per month then renews at $6.99) I don't want to do it with coupon code, I need it to be automatic in the system if possible, because I don't want to ask my customers to use this coupon code (***) to get this discount! And if I was forced to use a coupon code to be applied for the order once (first time), then I should set the price ($6.99) for all the terms (1 - 3 - 6 -12 months) for renewals, then the customers will see this screenshot at the Cart "Configure" step before seeing the discount at "Checkout" step.
  17. Craft

    Auto Accept Order

    Make sure that you are using a valid emails here: Setup >> General Settings >> General tab >> (Email Address) field Setup >> General Settings >> Mail tab >> (System Emails From Email) field
  18. Craft

    Auto Accept Order

    That’s correct because the order should be paid first then it will accept the order Now you need to solve the payment issue first
  19. Craft

    Auto Accept Order

    This issue is not related to the hook by the way. Your order is now "Active" or still pending? I'm asking about the Order Status not the Order Item! You can check it from the main page of "Orders" tab >> List All Orders
  20. Craft

    Auto Accept Order

    Yea because (isPaid) function doesn't run successfully. Can you share a screenshot from the Activity log (Utilities >> Log >> Activity Log)
  21. Craft

    Auto Accept Order

    Share a screenshot to understand you better and try to solve the issue
  22. Craft

    Auto Accept Order

    same file .. take a backup from your current file then replace the code
  23. Craft

    Auto Accept Order

    Yea this is the old hook which working on the old versions on WHMCS But you need to replace this code with the updated one to be compatible with the new version of WHMCS But take care, it's working only for hosting orders not for domain registration/transfer orders Here is the update code: <?php /* * * Auto Accept Orders * Created By Idan Ben-Ezra * * Copyrights @ Jetserver Web Hosting * www.jetserver.net * * Hook version 1.0.1 * **/ if (!defined("WHMCS")) die("This file cannot be accessed directly"); /********************* Auto Accept Orders Settings *********************/ function AutoAcceptOrders_settings() { return array( 'apiuser' => 'admin', // one of the admins username 'autosetup' => true, // determines whether product provisioning is performed 'sendregistrar' => false, // determines whether domain automation is performed 'sendemail' => true, // sets if welcome emails for products and registration confirmation emails for domains should be sent 'ispaid' => true, // set to true if you want to accept only paid orders ); } function AutoAcceptOrders_accept($vars) { $settings = AutoAcceptOrders_settings(); $ispaid = true; if($vars['InvoiceID']) { $result = localAPI('GetInvoice', array( 'invoiceid' => $vars['invoiceId'], ), $settings['apiuser']); $ispaid = ($result['result'] == 'success' && $result['balance'] <= 0) ? true : false; } logActivity("Order isPaid: ".$ispaid,0); if(( $settings['ispaid'] && $ispaid)) { $result = localAPI('AcceptOrder', array( 'orderid' => $vars['orderId'], 'autosetup' => $settings['autosetup'], 'sendemail' => $settings['sendemail'], ), $settings['apiuser']); logActivity("Order Accept", 0); if(is_array($result)){ foreach($result as $index=>$value){ logActivity("$index:$value",0); } } } } add_hook('OrderPaid', 1, 'AutoAcceptOrders_accept'); ?> Reference: https://github.com/Jetserver/WHMCS-Auto-Accept-Orders/issues/1
  24. Craft

    Auto Accept Order

    It's working only for hosting order not for domain registration/transfer Share the code you are using if you still facing the issue
  25. I just notices where is the issue .. here (Automatic Domain Registration Suppressed as Domain Is Already Active) The issue is in the hook file (Auto Accept Orders), which is works for the hosting orders but doesn't work for domain :(
×

Important Information

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