Jump to content

How to remove Country code in {$clientsdetails.phonenumber}


altomarketing

Recommended Posts

Since 6.x version, we had modified our clientsummary.tpl admin file from {$clientsdetails.phonenumber}  to <a href="callto:{$clientsdetails.phonenumber}">{$clientsdetails.phonenumber}</a>

So we can with our app, with just one clic call to our customers from browser, but in last update 7.4 adds automatically +54 (countrycode) to the phonenumber,

how can i remove countrycode ? because our call should not include country code.

Thanks !!

Link to comment
Share on other sites

20 minutes ago, altomarketing said:

how can i remove countrycode ? because our call should not include country code.

if all your clients are in Argentina, then you could do (i'm changing both the link and the shown number, but I guess only changing the link is important for your purpose)...

<a href="callto:{$clientsdetails.phonenumber|replace:'+54.':'0'}">{$clientsdetails.phonenumber|replace:'+54.':'0'}</a> 

if you need to do it for all worldwide telephone numbers, then you could do...

<a href="callto:{$clientsdetails.phonenumber|strstr:'.':false|replace:'.':'0'}">{$clientsdetails.phonenumber|strstr:'.':false|replace:'.':'0'}</a>

 

using regular expressions might be another solution.

also, if you have this feature disabled in the settings, setup -> general settings -> localisation (and haven't changed any numbers while it has been enabled), then the number stored in the tblclients database table should still be the same as you entered it... if that is the case, then you could use an AdminAreaPage to pass the correctly formatted phone field as a variable back to the template, or perhaps use an actionlinks hook to query the db and add a callto link directly, using the correctly formatted number, in the summary page.

but if you've already edited the template to add the callto link, you might as well just use one of the Smarty solutions. :idea:

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • 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