Hi guys,
I'm wondering if it's possible to render an Order based on a template, by using some of the standard functions in the API.
I basicly need to make a module that can render all order informations from a given order, to the frontend, and i'd like to define which template it should be based on.
I don't need to trigger any payment or save options, i just need the actual rendering of the order.
Hope that maybe some of you know how to do this.
//Martin
Developer forum
E-mail notifications
Override DWs standard order mail
Posted on 15/02/2010 11:37:31
Replies
Posted on 16/02/2010 15:49:22
Okay.
I found that i could use this code to generate the order:
Dynamicweb.Frontend.PageView pv = Dynamicweb.Frontend.PageView.Current();
Dynamicweb.Templatev2.Template tmpl = new Dynamicweb.Templatev2.Template( OrderMailTemplate );
Dynamicweb.eCommerce.Frontend.Renderer Renderer = new Dynamicweb.eCommerce.Frontend.Renderer( pv );
Renderer.RenderOrder( order, tmpl, true, 2 );
// My renderered order
string htmlOrder = tmpl.Output();
where 'OrderMailTemplate' is the path to my template and 'order' is the order i want to render.
My next problem is that i'd like to stop Dynamicwebs standard order mail, and send out my own with a file attached, is that possible?
//Martin
I found that i could use this code to generate the order:
Dynamicweb.Frontend.PageView pv = Dynamicweb.Frontend.PageView.Current();
Dynamicweb.Templatev2.Template tmpl = new Dynamicweb.Templatev2.Template( OrderMailTemplate );
Dynamicweb.eCommerce.Frontend.Renderer Renderer = new Dynamicweb.eCommerce.Frontend.Renderer( pv );
Renderer.RenderOrder( order, tmpl, true, 2 );
// My renderered order
string htmlOrder = tmpl.Output();
where 'OrderMailTemplate' is the path to my template and 'order' is the order i want to render.
My next problem is that i'd like to stop Dynamicwebs standard order mail, and send out my own with a file attached, is that possible?
//Martin
Posted on 09/03/2010 08:36:01
Hi Martin
You can stop DW from sending the order mail by setting the Order.TransactionMailSend to true. If you're using a gateway, you should listen to the notification event Notifications.eCommerce.Order.Steps.PaymentSucceded, otherwise use Notifications.eCommerce.Order.Steps.Confimed.
- Lasse
You can stop DW from sending the order mail by setting the Order.TransactionMailSend to true. If you're using a gateway, you should listen to the notification event Notifications.eCommerce.Order.Steps.PaymentSucceded, otherwise use Notifications.eCommerce.Order.Steps.Confimed.
- Lasse
You must be logged in to post in the forum