Contact person in customer

Hello all new the app and forum, love the app so far

It seems that “Customers” module can do with a bit of tlc

Is there any good reason why there is no “contact(s)” in the customers module ?

I created a custom field for this bit it prints new contacts field way down on the invoice after the Notes field

In the edit theme code there is no clear identifier for the newly created contacts field …

Can anyone please help in this regard …?

AB

Yes. Because once you start adding fields, someone will always want something different, and the screen just gets crowded. So instead, you can create any custom field you want.

It is part of the looping through field.label and field.text in the section of code that begins:

{% for field in custom_fields %}

By default, this comes at the end. If you want it elsewhere, you have to furnish the code yourself.

Thanks Tut,

“Yes. Because once you start adding fields, someone will always want something different, and the screen just gets crowded. So instead, you can create any custom field you want”.

One could put that to the vote and I am sure you will find that you are maybe not as right as you think you are, Customer information generally follows a chronological formula

Eg: Account no. - Customer - Contact - Address - Telephone - Mobile - Email - custom fields etc (of course currency etc are necessary bits that hang off this - in my humble opinion of course.

"it is part of the looping through field.label and field.text in the section of code that begins:
{% for field in custom_fields %}
By default, this comes at the end. If you want it elsewhere, you have to furnish the code yourself. "
This is the code after adding the custom “Contact” field

    {% for field in custom_fields %}
    <tr>
        <td colspan="99">
            <div style="font-weight: bold; padding-top: 20px">{{ field.label }}</div>
            <div>{{ field.text | newline_to_br }}</div>
        </td>
    </tr>
    {% endfor %}  

Editing this field or placing it elsewhere in the page script affects BOTH “Notes” and the new “Contacts” field

This is why I said there is no clear field identifiers for the newly created custom fields

Maybe I have explained this dilemma better this time round

Thanks in advance

Have a read here (about half way through) [16.11.1] Added new themes for invoices, quotes, orders, receipts etc
It gives lots of handy tips by Lubos and others.

There are no votes. The developer makes all decisions on program content and design.

What you describe is not a chronological formula, having no relationship to time. If you wish to use a program that accepts customer information in a different order, you are free to do so.

Yes, it does. I never said it did not. Separating one custom field from another could be done, but required more sophisticated programming. If you do not have the skills, you need to hire someone locally who does. The custom theme capability opens the door, but it was not the developer’s intent to customize everyone’s use of the application for them, only to make it possible in a relatively straightforward manner.

Tut

I concede that chronological is the wrong term to use and you are right no time reference -

Re the vote - that is a bit of a dogmatic view, seeing that forum member help you make your product more marketable … not fighting… just saying

So are are you not able to give me a field identifier ? ala custom.contacts surely it must have a database field name

I’m not the developer, @Attila. It’s not my product and I have nothing to do with marketing it. I’m just one of the forum moderators. As for voting, that was actually considered quite a while ago, but rejected because it became apparent it would be a vote-stuffing regime controlled by the noisiest forum members, most of whom would have little context for understanding the impacts of what they were requesting. Suggestions are certainly considered. Often, they appear in the program in relatively short order. But custom fields were intended to allow users to add whatever they wanted, circumventing the need for customization and constant change requests.

On the subject of customer contacts specifically, I hope you realize you could put this information into the customer address field if you always want it to show.

You seem to keep searching for a unique variable title for your customer contact field. There isn’t one. Custom fields, including Notes, are part of an array. As shown in the code you quoted above, the two field names involved are field.label and field.text. The program loops through the array, which is why it takes some measure of sophistication to split locations of various custom fields. But it can be done.

I realise this is an old discussion now but I am playing with just that at the moment so I thought I would post my observations here.

What is described below is based on experimentation and deduction, so with this caveat…

I wanted FAO (as in “for attention of”) line showing above the customer’s name and address on invoices but I did not want it to be part of the customer name itself. I also did not want it to show for the second time at the bottom of the invoice with all the custom fields. I have found that the following seems to work.

In Settings, I added a custom field called “FAO” to “Customer” (ticking “Show custom field on printed documents”)

I have found that this field becomes available as {{ custom_fields.FAO }} within the template code. So I added the line

<div>{{ custom_fields.FAO }}</div>

Just above

<div>{{ recipient.address | newline_to_br }}</div>
<div>{{ recipient.identifier }}</div>

My template is based on the Smooth Navy template. This adds my FAO information above the name / address (without the field name).

As @Attila says above, all custom fields are output together (and with their labels) at the bottom of the invoice by this code:

{% for field in custom_fields %}
<tr>
   <td colspan="99">
      <div style="font-weight: bold; padding-top: 20px">{{ field.label }}</div>
      <div>{{ field.text | newline_to_br }}</div>
   </td>
</tr>
{% endfor %}

In order to avoid having my FAO field printed here as well, I filter it out while iterating through the custom_fields array:

{% for field in custom_fields %}
{% if field.label != "FAO" %} 
<tr>
   <td colspan="99">
      <div style="font-weight: bold; padding-top: 20px">{{ field.label }}</div>
      <div>{{ field.text | newline_to_br }}</div>
   </td>
</tr> 
{% endif %}
{% endfor %}

If you had multiple fields to filter out, you can modify the if statement, for reference see https://shopify.github.io/liquid/tags/control-flow/

What I don’t fully understand is this - when I added a custom field with the same name “FAO” to Sales Invoice, both “FAO” fields were correctly filtered out at the bottom and the “FAO” from “Customer” was still showing on top as before… And the new field was also stored in the custom_fields array as “FAO” because when I removed the “if” filter, both “FAO” fields got printed at the bottom. So avoid having the same custom field names for different objects!

1 Like