Address ToString with pattern

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
isaacdiaz74
Ensign (ENS)
Ensign (ENS)
Posts: 7
Joined: Fri Dec 19, 2008 2:15 pm

Address ToString with pattern

Post by isaacdiaz74 » Fri Aug 06, 2010 1:13 pm

I want to format the address into a specific html format different than the format provided by ToString(). I know I can concatenate a string and geerate the html but I see the Address Object exposes a method ToString(string pattern, bool isHTML).

Could I use that? What's the format for the pattern string? I have searched and can't find any documentation about this method.

thanks a lot.

User avatar
Logan Rhodehamel
Developer
Developer
Posts: 4116
Joined: Wed Dec 10, 2003 5:26 pm

Re: Address ToString with pattern

Post by Logan Rhodehamel » Fri Aug 06, 2010 5:10 pm

Go to Configure -> Regions -> Countries. In the right column is an area to add new countries. By the address format is a link that says "what's this?".

If you click this link it will give you a list of the variables that are supported by the ToString method. It's a simple string substitution. So you could do something like

ToString("[Name]\n[Address]", true)

The boolean ishtml, if true, changes any line break into the <br /> code. If false, it does not do any line break conversions.
Cheers,
Logan
Image.com

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.

isaacdiaz74
Ensign (ENS)
Ensign (ENS)
Posts: 7
Joined: Fri Dec 19, 2008 2:15 pm

Re: Address ToString with pattern

Post by isaacdiaz74 » Wed Sep 01, 2010 1:38 pm

Thanks Logan.

Post Reply