Page 1 of 1

Get customfield in the admin area

Posted: Fri Sep 14, 2018 5:19 pm
by elpidios
OC Version: 3.0.2.0
Theme: default

Hi
I am trying to do something like the below in the admin dashboard but unfortunately is not working. I want to print the custom field number --> Customers --> Customers.
Until now I done
This one is working fine {% if email %}{{ email }}{% endif %} for email
This not working {% if custom_field[13] %}{{ custom_field[13] }}{% custom_field[13] %}

Re: Get customfield in the admin area

Posted: Fri Sep 14, 2018 7:51 pm
by straightlight
elpidios wrote:
Fri Sep 14, 2018 5:19 pm
This one is working fine {% if email %}{{ email }}{% endif %} for email
Unrelated to the topic.
elpidios wrote:
Fri Sep 14, 2018 5:19 pm
This not working {% if custom_field[13] %}{{ custom_field[13] }}{% custom_field[13] %}
Related to topic. However, custom fields are defined by array key names and not by numbers. It would also be needed to switch your [] to . (dots) to call your indexes in TWIG files.

Re: Get customfield in the admin area

Posted: Fri Sep 14, 2018 8:58 pm
by elpidios
so can you give me an example please?

Re: Get customfield in the admin area

Posted: Fri Sep 14, 2018 9:10 pm
by straightlight
Use TextCrawler or see the codes on GitHub. Lots of examples are already provided.