Adding a conditional 2nd line for street address

  • Posts: 153
  • Thank you received: 7
  • Hikashop Business
12 years 10 months ago #34075

I have a need to use a second line for the street address. I have a custom field setup for the second line for the street address. That is working perfectly. I found the address_template in Display->Views that I need to change to display the second line for the address. However when I add the new field there, and people don't add a second line to the address since it is optional, I end up up with a blank space in the display of the address.

Is there an easy way to make the display conditional? I tried adding a PHP if statement wrapped around the tag, but it seems to be evaluating the tag, not what the tag gets replaced with.

Any thoughts on how to do this?

Please Log in or Create an account to join the conversation.

  • Posts: 82909
  • Thank you received: 13379
  • MODERATOR
12 years 10 months ago #34088

That's indeed the case. The php in that file is evaluated before the tags are replaced. You would have to edit each place where the address_template file is used to do your modification:
in the file show of the view order
in the file address_view of the view checkout
in the file listing of the view address
in the file invoice of the view order
that you can edit via the menu Display->Views.
Also, you will have to edit each email via the menu System->Emails (Business edition only) if you want to change the display there too.

Please Log in or Create an account to join the conversation.

Time to create page: 0.050 seconds
Powered by Kunena Forum