Jump to content

Custom Field Help


TGK

Recommended Posts

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.

Link to comment
Share on other sites

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 by Kian
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

 

 

 

Link to comment
Share on other sites

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.

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