Jump to content

Hook to pre-defined country phone number on page View/Search clients


zitu4life

Recommended Posts

Hello there

I would like to have View/search clients page on phone number country to show always selected country rather USA first. A template edit is need or a hook can make it possible? How!

image.thumb.png.0388e2952841c1c5839ddd5196147d40.png

Look for to change USA country code +1 to my default country to avoid every time need to change it again.

Example:

image.thumb.png.21b5c3f2604b92ac7fbb5c887145fac7.png

PS: WHMCS by default will show random number like pictures above +1 201-555-0123 or +238 991 12 34 can we change those random number to +1 000-000-000  or +238 000 00 00

those random number will be displayed on add new client

image.thumb.png.3c321e8887d100dbe911136a6fc6fdbf.png

 

PS: My idea is that phone number country default should be linked to setting, so if we have in SETTINGS selected country, means That country code default number should be the same as selected country in settings 🙄

image.thumb.png.18402d65f2f2047f0460c89c72ccb04b.png

thank you!

Link to comment
Share on other sites

13 hours ago, zitu4life said:

I would like to have View/search clients page on phone number country to show always selected country rather USA first. A template edit is need or a hook can make it possible? How!

you could change references (I think there are around 5) within /blend/js/scripts,min.js of "us" to "cv" and that would default the telephone country setting in the search field to Cape Verde.

as a hook, that would probably require an admin area output hook (header or footer) - though that's not one for me to work on. 🙂

13 hours ago, zitu4life said:

PS: WHMCS by default will show random number like pictures above +1 201-555-0123 or +238 991 12 34 can we change those random number to +1 000-000-000  or +238 000 00 00

they're not random, they're predefined, along with the telephone format for that country, in blend/js/scripts/vendor.min.js - so again, could be edited in there if required.

when adding new clients, the country telephone choice should default to the default country defined in the localisation tab.

14 hours ago, zitu4life said:

PS: My idea is that phone number country default should be linked to setting, so if we have in SETTINGS selected country, means That country code default number should be the same as selected country in settings 🙄

the requests already exists...

https://requests.whmcs.com/topic/phone-number-area-code-should-be-shown-by-default-country-on-view-search-clients-from-admin-panel

.... almost 3 years old, 1 vote and now archived - so even if I could post a solution hook here, I couldn't update the request to show that..... welcome to the joined-up thinking of WHMCS. 🙄

Link to comment
Share on other sites

4 hours ago, brian! said:

you could change references (I think there are around 5) within /blend/js/scripts,min.js of "us" to "cv" and that would default the telephone country setting in the search field to Cape Verde.

Hi @brian! thank you for pointing me on the right direction, appreciate that!

I have been able to reproduce it on blend and it works, but not work on Lara admin theme, doing the same on same Lara theme files 🤪 I do not know why it works on blend and not on Lara, I will contact Lara developer, but if you have any idea it is welcome.

image.thumb.png.7a8778fa3bcf885a4e41e8d835f05d67.png

4 hours ago, brian! said:

they're not random, they're predefined, along with the telephone format for that country, in blend/js/scripts/vendor.min.js - so again, could be edited in there if required.

when adding new clients, the country telephone choice should default to the default country defined in the localisation tab.

I find out those pre-defined number and edited them but it do not change on WHMCS admin even in blend. For Lara theme  nothing work.

 image.png.37080ac45ddeb93ecd1f60af178b6ec5.png

image.png.ac9af3f92e685147f568d186747d925e.png

Link to comment
Share on other sites

18 minutes ago, zitu4life said:

I find out those pre-defined number and edited them but it do not change on WHMCS admin even in blend.

it definitely works in blend....

Z8kxVtj.png

but if you were changing the actual format of that number, you would also need to adjust the regex for that country.

Link to comment
Share on other sites

i've got some weird issues going on with lara... it's not showing the phone flags in the search... it's really weird as other things are not working either.... i've deleted and reinstalled, cleared cache, disabled hooks... it feels cs/js related, but i've no ideas as to the cause!

Link to comment
Share on other sites

6 minutes ago, brian! said:

intellisearch would already search for phone numbers.

no. it does not.. I tested on blend and Lara. Ops it does but I have to insert space on number🤔
if search 1234567 it will not find it
but if insert 123 45 67 it wil find it
1234567 is not same as 123 45 67

Edited by zitu4life
Link to comment
Share on other sites

16 minutes ago, zitu4life said:

no. it does not.. I tested on blend and Lara. Ops it does but I have to insert space on number🤔

well you have to search for either an exact match or a smaller search term - these are strings in the database, so there is a difference between searching for "hello world" and "helloworld".

if you're searching with a known phone number, then surely you just search for the smallest term possible until you see the correct result.

20 minutes ago, zitu4life said:

Who will remember that is mandatory to write 123 45 67 instead of 1234567  These things are not designed right..

it's not mandatory - you're just searching for what's in the field.... you have enabled the feature that formats telephone numbers!

35 minutes ago, zitu4life said:

Intelligent search should be able to detect both formats

intellisearch scans multiple fields at the same time - to search multiple fields in multiple formats... eek.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • 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