Developer forum

Forum » Development » Generating PDF of order confirmation?

Generating PDF of order confirmation?

Yung Yi Wang
Reply

Hello,

Question: I want to generate a PDF file of an order confirmation. Is there a build in function for this? Or do I need to build everything custom?

I noticed there is a class of PDF, but how can I request an order confirmation of an order? Is it possible to request order information in querystring?


Replies

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer

Hi Yung.

If you have a page in DW, you can add &pdf=true to it and Dynamicweb will generate a PDF version of the page.

When you create an order in DW you get a link to the order confirmation with a parameter called "&CompletedOrderSecret={secret}". The {secret} value comes from the completed order, Order.Secret. So you can create a page with the cart module, add a rendering as you want it to look for the entire PDF content, call the page with "&CompletedOrderSecret={secret}&pdf=true" and then you have a PDF file of the order confirmation. When you do this, you have to make sure the server can browse the URL on the server as well (DNS issue sometimes can be a problem)

Because of licensing issues you are not "allowed" to code against the PDF class. Not unless you buy a license.

BR Nicolai

Votes for this answer: 2

 

You must be logged in to post in the forum