- Marketing Nation
- :
- Products
- :
- Product Discussions
- :
- Velocity Scripting an Equation

Your Achievements

Next /

Sign inSign in to Community to gain points, level up, and earn exciting badges like the new Applaud 5 BadgeLearn more!

View All BadgesSign in to view all badges
SOLVED
#
Velocity Scripting an Equation

Go to solution

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Anonymous

Not applicable

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-14-2017
02:07 PM

07-14-2017
02:07 PM

Hi all,

We want to show our leads how much they could save for a certain transaction. The transaction is a custom object field and I believe this can be done with velocity scripting but am unsure of what tool to be using.

Example: Lead custom object field is $500 want to show a 5% savings ($25).

I'm new to email scripting so thank you in advance!!!

Solved! Go to Solution.

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-14-2017
02:30 PM

07-14-2017
02:30 PM

You have to know more about how your CO is set up to know exactly how to fit this for your situation, but for a generic CO *Product *with the numeric field *Price, *the approach is like this:

#if( !$Product__cList.isEmpty() )

#set( $firstProductPrice = $Product__cList[0].Price )

#set( $savingsAmount = $math.mul($firstProductPrice, .05) )

#set( $discountedPrice = $math.sub($firstProductPrice, $savingsAmount) )

Pay only ${number.currency($discountedPrice)}!

That's ${number.currency($savingsAmount)}

under the regular price of ${number.currency($firstProductPrice)}!

#end

2 REPLIES 2

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-14-2017
02:30 PM

07-14-2017
02:30 PM

You have to know more about how your CO is set up to know exactly how to fit this for your situation, but for a generic CO *Product *with the numeric field *Price, *the approach is like this:

#if( !$Product__cList.isEmpty() )

#set( $firstProductPrice = $Product__cList[0].Price )

#set( $savingsAmount = $math.mul($firstProductPrice, .05) )

#set( $discountedPrice = $math.sub($firstProductPrice, $savingsAmount) )

Pay only ${number.currency($discountedPrice)}!

That's ${number.currency($savingsAmount)}

under the regular price of ${number.currency($firstProductPrice)}!

#end

Anonymous

Not applicable

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

07-14-2017
03:13 PM

07-14-2017
03:13 PM

Re: Velocity Scripting an Equation

Thank you!