• Toll-free  888-665-8637
  • International  +1 717-220-0012
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

CorneliuTusnea
#1 Posted : Monday, January 1, 2007 8:55:17 PM(UTC)
CorneliuTusnea

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.
http://www.bestgames.com.au
http://www.bestchess.com.au



BV Product Links, Details and Signatures: Improve your customer experience:

http://www.acorns.com.au/projects/bv/quicklink/

Marcus
#2 Posted : Monday, January 1, 2007 8:56:22 PM(UTC)
Marcus

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.
CorneliuTusnea
#3 Posted : Wednesday, January 3, 2007 7:26:51 PM(UTC)
CorneliuTusnea

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.
http://www.bestgames.com.au
http://www.bestchess.com.au



BV Product Links, Details and Signatures: Improve your customer experience:

http://www.acorns.com.au/projects/bv/quicklink/

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.

©2024 Develisys. All rights reserved.
  • Toll-free  888-665-8637
  • International  +1 717-220-0012