Jump to content

webtechwhiz

Member
  • Posts

    22
  • Joined

  • Last visited

About webtechwhiz

webtechwhiz's Achievements

Junior Member

Junior Member (1/3)

0

Reputation

  1. Hi Brian, I have added below code and working fine: add_hook('AdminAreaFooterOutput', 1, function($vars) { if($vars['filename'] == 'configpromotions'){ return <<<HTML <b>This is a custom output on the footer</b> <script type="text/javascript"> $('input[name="existingclient"]').change(function() { if(this.checked) { var html='<tr><td class="fieldlabel">Restrict to Specific Client?</td><td class="fieldarea"><label class="checkbox-inline"><input type="checkbox" name="restricted" value="1"> Restricted to selected clients only</label></td></tr>'; var elem= $(this).closest('tr').after(html); } }); $(document).on('change','input[name="restricted"]',function() { if(this.checked) { var html='<tr><td class="fieldlabel">Select Clients</td><td class="fieldarea"><select type="checkbox" name="restrictedto" multiple size="8"><option value="1">Client 1</option><option value="2">Client 2</option><option value="3">Client 3</option> </select></label></td></tr>'; var elem= $(this).closest('tr').after(html); } }); </script> HTML; } }); Now I have to display a list of all existing clients with active order in the list. Currently I have manually displayed Client 1, Client 2, Client 3 in the dropdown list. Also I would like to know how I can store the values to the tblpromotions. I have already created restricted column next to existingclient column with default value 0 and next to restricted column added another column restrictedto to store client's user id. Awaiting for your help on this... Regards, Shubhajeet Saha
  2. Hi Brian, Thanks for your reply. I had also created following ticket with Support was redirected to community. My ticket query was: At first I would like to ask how to add custom html element Checkbox below "Existing Client Apply to existing clients only (must have an active order to qualify)"? When checked this checkbox my custom added check box should open. And when my custom check box is checked a new html element will open Select Existing clients. This will multiselect dropdown list having all existing client value will be userid and display will be client names. How to get existing client list that is my 2nd query. Below is the hook example found at https://developers.whmcs.com/hooks-reference/admin-area/#adminareapage. add_hook('AdminAreaPage', 1, function($vars) { $extraVariables = []; if ($vars['filename'] == 'index.php') { $extraVariables['newVariable1'] = 'thisValue'; $extraVariables['newVariable2'] = 'thatValue'; } return $extraVariables; }); Would like to confirm few things: add_hook('AdminAreaPage', 1, function($vars) { $extraVariables = []; if ($vars['filename'] == 'configpromotions.php?action=manage') { $extraVariables['newCheckBoxValue'] = 'thisValue'; } return $extraVariables; }); Will work on page while creating new coupon? Can you help me to achieve my goal using admin area hooks? I'll post my further queries later since its not allowing to post large text in comment. Will be awaiting your reply. Regards, Shubhajeet Saha
  3. Dear Team, Looking for hook name which works on page configpromotions.php?action=manage add some features to the hook. Awaiting your reply... Regards, Shubhajeet Saha
  4. Find enclosed activity log for hook AfterShoppingCartCheckout Awaiting solution/reply from Developers in WHMCS community . . .
  5. Dear String, I have implemented above code, enabled hook debug mode and display errors. But no variable data is logged in tblactivitylog table. And in WHMCS v8.0+ I am unable to find Configuration > System Logs menu from Admin Dashboard. There are many logs for the hook 1 given below in description column: Hooks Debug: Hook Defined for Point: AfterShoppingCartCheckout - Priority: 1 - Function Name: generate_custom_invoice_number_4Client_hook But no log entries have logged any variables. I think logActivity (json_encode($vars)); didn't worked. Awaiting your reply... Regards, Shubhajeet Saha
  6. Dear Team, In reply to a support ticket #KQX-559385 - How to set invoice number raised on 13/01/2021 support team member John Kipling has given AfterShoppingCartCheckout hook on 21st April 2021. Based on documentation I had written hook code as below: function generate_custom_invoice_number_4Client_hook($vars) { $invoiceid = $vars['InvoiceID']; $customnumber = 'WTW'.date("Y").str_pad($invoiceid,5,"0",STR_PAD_LEFT); if (isset($customnumber)) { try { $updatedInvoiceNumber = Capsule::table('tblinvoices') ->where('id', $invoiceid) ->update(['invoicenum' => $customnumber,]); } catch (\Exception $e) { // Deal with error } } } add_hook('AfterShoppingCartCheckout', 1, "generate_custom_invoice_number_4Client_hook"); But its not working. As given in hook documentation below parameters should be available: Parameters Variable Type Notes OrderID int The Order ID OrderNumber int The randomly generated order number ServiceIDs array An array of Service IDs created by the order AddonIDs array An array of Addon IDs created by the order DomainIDs array An array of Domain IDs created by the order RenewalIDs array An array of Domain Renewal IDs created by the order PaymentMethod string The payment gateway selected InvoiceID int The Invoice ID TotalDue float The total amount due Hence I have fetched InvoiceId as $invoiceid = $vars['InvoiceID']. But not working. Request community members to help me in formatting invoice number with hook AfterShoppingCartCheckout. Unable to find any post related to AfterShoppingCartCheckout which is used to format invoice number. Request to kindly approve this topic. Regards, Shubhajeet Saha
  7. Hi Brian, Now WHMCS support has given hook AfterShoppingCartCheckout to format invoice number when client makes purchases from fontend: I had written hook code as below: function generate_custom_invoice_number_4Client_hook($vars) { $invoiceid = $vars['InvoiceID']; $customnumber = 'WTW'.date("Y").str_pad($invoiceid,5,"0",STR_PAD_LEFT); if (isset($customnumber)) { try { $updatedInvoiceNumber = Capsule::table('tblinvoices') ->where('id', $invoiceid) ->update(['invoicenum' => $customnumber,]); } catch (\Exception $e) { // Deal with error } } } add_hook('AfterShoppingCartCheckout', 1, "generate_custom_invoice_number_4Client_hook"); But its not working. As given in hook documentation below parameters should be available: Parameters Variable Type Notes OrderID int The Order ID OrderNumber int The randomly generated order number ServiceIDs array An array of Service IDs created by the order AddonIDs array An array of Addon IDs created by the order DomainIDs array An array of Domain IDs created by the order RenewalIDs array An array of Domain Renewal IDs created by the order PaymentMethod string The payment gateway selected InvoiceID int The Invoice ID TotalDue float The total amount due Hence I have fetched InvoiceId as $invoiceid = $vars['InvoiceID']. But not working. Awaiting for your reply. Regards, Shubhajeet Saha
  8. Hi Brian, Would like to update that I have reopened ticket with this community post and as suggested by them I have created a new quote from Admin and then converted it into Invoice. Then the hook worked and created unpaid invoices WTW202100027 and WTW202100028 but when I tried to place and order from user login it generated proforma invoice 29. Can you please put some light on this issue? I think if it starts working in PI then it will work for final Invoice too. Request you to make a response. Awaiting your reply... Regards, Shubhajeet Saha
  9. Hi Brian, Sorry for late reply. My site using TwentyOne theme and all its functions, only some design customization is done. I have raised issue with Support tkt number is #KQX-559385 and below was their reply: Now tell me where should I report my issues. Support guys do access our cpanel and admin and fixes the issues. But they redirected me to Developer community. And here you senior developers guides us for any issue, always grateful for your help but you produce instance locally not on our site. Then how this issue will get fixed? The result your are showing is clearly indicating there is no issue with the coding neither with PI or Final Invoice. Now at least guide me whom I should contact for my issue? Who will test the issue on my server and find out why it is not working? Awaiting your reply... Regards, Shubhajeet Saha
  10. Hi Brian, Leading 0 is important to me. I want invoice number in my given format and I can create such invoice number using core PHP, Codeigniter and in Laravel too. But here is no option available for custom coding. Hooks given are not working. If above any option is introduced in next release of WHMCS to check want leading 0 to invoice number and size of invoice then it will be very useful. But my simple question when there is no scope of custom coding and hooks are provided then why it's not working? If any option is given the should work properly. Also I should let know that client who has forgotten his account password is unable to reset his account password. At the reset page client fills his registered email id and a reset link is received. When he clocks the link it again asks for email id. No page appears to enter new password. Though I have created ticket for this but letting you know to check what is the issue with latest version WHMCS and Twenty One theme. Awaiting your reply... Regards, Shubhajeet Saha
  11. Hi Brian, Waiting for your reply... Regards, Shubhajeet Saha
  12. Hi Brian, Thanks for your reply. I'll wait for your investigation report. I have disabled Proforma Invoicing and after disabling proforma invoicing no invoice is created. Is there any hook which can format invoice number in Proforma Invoice? Searching in WHMCS hooks references but unable to find any such hook. It will be better if any such is available or can be provided. Awaiting reply... Regards, Shubhajeet Saha
  13. Hi Brian, Thanks for quick reply, As per your statement hook should work now. But I just tested with an order though its unpaid. Its showing invoice number as #3. Would like to know when Invoice number gets formatted with the above hook at the time of placing order or after Payment. Unpaid invoice is attached for your reference. Kindly guide me so that I can make this hook work. Awaiting for your guidance... Regards, Shubhajeet Saha Invoice-3.pdf
×
×
  • 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