BV Commerce Forum
»
BV Commerce Support
»
General Support
»
FEATURE REQUEST: Shipping Address formatting
Rank: Member
Joined: 8/17/2006(UTC) Posts: 681
|
Hi, I'd like to customize (or just change) the Html format of the [[Order.ShippingAddress]].
Right now it includes stuff like Nick Name and Phone and email and website.
I don't want these printed on the packing slips.
How can I do this without having to "compose" my own address by merging the fields.
Can you guys provide a delegate + callback function that I can register to do the formatting of these addresses? I could then register my own function in the Global.asax when the app starts, function that does my custom formatting.
Thanks,
Corneliu. |
|
|
|
|
Rank: Member
Joined: 11/5/2003(UTC) Posts: 1,786
|
All the replacements take place in the core source so you'll either need to modify the Address class or modify the email template class and add your own tag. If you add your own tag like [[Corneliu.ShipAddress]] then you can use your own formatting function.
|
|
|
|
Rank: Member
Joined: 8/17/2006(UTC) Posts: 681
|
Marcus, How can I add my own tag and get it formatted the way I want without modifying the source code?
My proposal was for you to change the code in something similar to this: (coded in browser not in the IDE): In the address class declare: Public Delegate Function FormatAddressHander(Byref addr As Address) As String Public Static ToHtmlStringFormatter As FormatAddressHandle
Then i the ToHtmlString of the Address class you would do as the first line: If ToHtmlStringFormatter IsNot Nothing Then Return ToHtmlStringFormatter(Me) End If [...] original formattting code [...]
In the global.asax I can now change the HtmlFormatting of the Address to be: Address.ToHtmlStringFormatter = AddressOf MyAddressHtmlFormatter
and implement the function: Public Shared Function MyAddressHtmlFormatter(ByRef addr As Address) As String Return " ... " End Function
For you it's a 5 line code change. For me is a superb extensibility point where I can change formatting of the Address without altering your code and still be future proof.
Thanks, Corneliu. |
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.