logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
Joe Payne2  
#1 Posted : Thursday, June 30, 2022 10:19:13 AM(UTC)
Joe Payne2

Rank: Advanced Member

Groups: HelpDesk, Developers
Joined: 11/9/2018(UTC)
Posts: 564

Thanks: 122 times
Was thanked: 26 time(s) in 25 post(s)
I need to format a date passed as a parameter to an email template. I see references to some sort of nVelocity helper routine $helper.LSCurrencyFormat() but I don't know if that same helper will work for dates.

How would I format a date value, or where is the $helper code?

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

nadeem  
#2 Posted : Thursday, June 30, 2022 12:33:15 PM(UTC)
nadeem

Rank: Advanced Member

Groups: Administrators, Developers, Registered, HelpDesk, Authorized User, Admin, System
Joined: 10/11/2018(UTC)
Posts: 109

Thanks: 17 times
Was thanked: 18 time(s) in 18 post(s)
Quote:
I see references to some sort of nVelocity helper routine $helper.LSCurrencyFormat() but I don't know if that same helper will work for dates.


No, the LSCurrencyFormat helper will not work for date formatting. This is a currency formatter. The code for this extension is under CommerceBuilder/Extensions/DecimalExtension.cs. There is a nvelocity accessible for datetime CommerceBuilder/Common/DateTimeExtension.cs but this has limited functions. You can add your function inside this class and use from there.

Quote:
How would I format a date value, or where is the $helper code?


The $helper is added to the VelocityContext which is available for all nvelocity accessible classes. You might also format your date something like $date.Tostring("G") in the email template.
Users browsing this topic
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.