Custom database query in nVelocity?

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
mwolf
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 50
Joined: Mon Jul 02, 2007 9:37 pm
Location: Chicago, IL
Contact:

Custom database query in nVelocity?

Post by mwolf » Fri May 28, 2010 11:08 am

I'm trying to write a custom database query in nVelocity to output a custom value on an email template and I am having trouble figuring out how to access the database. In Ablecommerce 5.5, I was able to do the following:

Code: Select all

#set ($discountAmt = ${token.getcnnSG().queryValue("SELECT Price FROM ...")})
Is there an equivalent method in Ablecommerce 7.x?

User avatar
mazhar
Master Yoda
Master Yoda
Posts: 5084
Joined: Wed Jul 09, 2008 8:21 am
Contact:

Re: Custom database query in nVelocity?

Post by mazhar » Mon May 31, 2010 10:49 am

I don't think so you can do that with NVelocity in 7.0. You should better create a conlib control, do what ever you want to do with database in the conlib control. Finally just include that control where you want to put nvelocity code. Have a look at following topic for custom queries. http://wiki.ablecommerce.com/index.php/Custom_Queries

mwolf
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 50
Joined: Mon Jul 02, 2007 9:37 pm
Location: Chicago, IL
Contact:

Re: Custom database query in nVelocity?

Post by mwolf » Wed Jun 02, 2010 2:50 pm

mazhar wrote:I don't think so you can do that with NVelocity in 7.0. You should better create a conlib control, do what ever you want to do with database in the conlib control. Finally just include that control where you want to put nvelocity code. Have a look at following topic for custom queries. http://wiki.ablecommerce.com/index.php/Custom_Queries
Can I include ConLib's within email templates?

Post Reply