Page 1 of 1
Custom database query in nVelocity?
Posted: Fri May 28, 2010 11:08 am
by mwolf
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?
Re: Custom database query in nVelocity?
Posted: Mon May 31, 2010 10:49 am
by mazhar
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
Re: Custom database query in nVelocity?
Posted: Wed Jun 02, 2010 2:50 pm
by mwolf
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?