TGK Posted July 27, 2018 Share Posted July 27, 2018 Hi, im trying to things: 1- i created a custom field from Setup > Custom Client Fields. and i need that custom field client can fill only once after that only can view. or 2- i need that custom fields appear in template/clientareacontacts.tpl and i need that custom field client can fill only once after that only can view. thats is cool for me if someone help me ill be very greatful. 0 Quote Link to comment Share on other sites More sharing options...
Kian Posted July 28, 2018 Share Posted July 28, 2018 (edited) Edit clientareacontacts.tpl and locate the foreach that iterates all custom fields. Inside this foreach put a simple if condition that skips the iteration ({continue} should work fine) when your "special" custom field ID is found. This is the easiest way I can think. The most elegant way would be with an action hook that removes the custom fields directly from the array. Edited July 28, 2018 by Kian 1 Quote Link to comment Share on other sites More sharing options...
TGK Posted July 28, 2018 Author Share Posted July 28, 2018 Really i dont have idea how do it. when put custom field code on clientareacontacts.tpl nothing happned it only work if i use it on clientareadetails.tpl with this code clients can view only for now.. but is not so much elegant and it required admin fill from Admin panel, will be good if client can fill once {if $customfields} <div class="tab-pane fade{if !$domain && !$moduleclientarea && !$configurableoptions} in active{/if} text-center" id="additionalinfo"> {foreach from=$customfields item=field} <div class="row"> <div class="col-sm-5"> <strong>{$field.name}</strong> </div> <div class="col-sm-7 text-left"> {$field.value} </div> </div> {/foreach}<br> </div> {/if} thanks for you help 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 28, 2018 Share Posted July 28, 2018 13 hours ago, TGK said: i created a custom field from Setup > Custom Client Fields. and i need that custom field client can fill only once after that only can view. as Kian hints at, the usual way would be to allow them to enter the value during ordering/registration, but then make it the field read only in clientareadetails. 13 hours ago, TGK said: i need that custom fields appear in template/clientareacontacts.tpl and i need that custom field client can fill only once after that only can view. clientareacontacts.tpl wouldn't have a customfields array by default... it has cf values of the client, but no customfield name against the values... you'd likely end up having to use a hook to query the db to create the array if you need to do this. 1 Quote Link to comment Share on other sites More sharing options...
TGK Posted July 28, 2018 Author Share Posted July 28, 2018 well i dont have idea how do it by hook so ill try to do how Kian as said.. thanks you 0 Quote Link to comment Share on other sites More sharing options...
brian! Posted July 29, 2018 Share Posted July 29, 2018 15 hours ago, TGK said: well i dont have idea how do it by hook so ill try to do how Kian as said.. you can't loop through an array if it doesn't exist. 😀 you can make the fields readonly on clientareadetails, but that's because the customfields array exists and you can modify it. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.