Foxy Forum Status

We're no longer responding to questions via our forum, but we will keep it up for historical reasons. If you can't find the answer you're looking for, please visit our knowledge base or contact us. If there's enough interest in the future, we may bring the forum back.

Possible bug in not honoring changes to address labels?

I have changed the field labels of "Address 1" and "Address 2" to "Address line 1" and "Address line 2 (if needed)" within the admin section of Language.

When I look at the source code for the resultant checkout page I see that the JSON is correctly set to the above changes like so...(at least I think such is indicating this)...

"checkout_address1":"Address line 1","checkout_address2":"Address line 2 (if needed)"

But...inside the code of page the address labels are indicated as such within the HTML...

<label for="shipping_address1" class="fc-form-label fc-form-label--shipping-address1">Address 1</label>
<label for="shipping_address2" class="fc-form-label fc-form-label--shipping-address1">Address 2</label>

And they are rendered as such. Without the changes I indicated being output.

I can easily just hard code this in place and will but I wonder if this is a bug of some sort?

  • fc_adamfc_adam FoxyCart Team

    The address fields label uses a slightly different language string than what you're editing. Specifically the label element uses the language string for "Address", and then hard codes the 1 and 2 after it. You can see that in the address twig template as follows:

    <label for="{{ field_name }}" class="fc-form-label fc-form-label--{{ address.prefix }}-address1">{{ config.lang.checkout_address|raw }} 1</label>

    The language string you're editing there is used for the placeholder attribute for the input itself.
  • Hi Adam,

    I am not sure I explained myself clearly enough as I was showing an apparent descrepancy between what the JSON variables indicated as being the text I had set the address field labels to and what was actually appearing in the generated HTML of the checkout page.

    I wasn't really referring to editing the twig code at all.

    In other words the text I had set the address field labels to through the admin interface was not making it into the generated HTML put out for the checkout page.

    I saw this only because I have been making the field labels appear (which they normally don't by default).

    Anyway...I'll let this be Adam since I decided to just hard code the Address label text I wanted.

    Thanks for getting back to me on this!

  • fc_adamfc_adam FoxyCart Team
    edited July 2015

    Not at all - you explained yourself clearly. I may have not been clear in my response though. The language strings you're referring to in the JSON are not the language strings that are used for the label. They are used for the placeholder attribute of the input. For the label, it uses the language string for just "Checkout" - note that the language string name is different in the line of code I pasted showing the label output than the language string name you're referencing from the JSON.
  • Oh...sorry Adam.

    I misunderstood the purpose of the JSON variables in the source code as I assumed that they were used (among other things) to set the strings for the address labels.

    I'll have to take another look at the source code though at this point...given that I decided to just hard code the labels I's not a high priority for me.

    I do appreciate you getting back to me with your clarification Adam. I have to say that you are OUTSTANDING in how you deal with me and others on this forum.

    It will be a GREAT loss I think if you ever leave FoxyCart. Your presence on this forum and the outstanding responses you give here are one of the main reasons I stay willing to continue working with FoxyCart to meet my clients needs.

Sign In or Register to comment.