Create a PDF e-tickets with QR code for downloading via Zencart
£20-250 GBP
Zamknięte
Opublikowano ponad 9 lat temu
£20-250 GBP
Płatne przy odbiorze
We are a small UK charity. We hold charity concerts and sell tickets for our events via [login to view URL] using Zencart ([login to view URL]) - instead of sending out physical tickets, we would like a purchaser to download a pdf ticket (as per example enclosed which we currently do manually) with a QR code for each of the tickets they have purchased, AND PAID for.
We think the easiest way to do this would be to create PDF(s) with a unique QR code for each ticket ordered which is either downlaoded by the purchaser immediatley (if they pay by Card) or emailed to them as soon as payment is made if for example by direct-bank transfer later, upon order status change.
In both cases the tickets could be stored in .htacess protected directory or database table for pdf creating on the fly, and pointed to from the Customer Purchase history page for reprinting or the like.
Zencart has the ability to mark a product as a "downloadable" product - which this would be.
This could be achieved simply by modifying the current code.
1. Modify file "[login to view URL]" under "\includes\modules\pages\checkout_success" right after the lines:
'products_id'=>$products->fields['products_id'],
'products_name'=>$products->fields['products_name']);
Then retrieve the quantity:
'products_quantity'=>$products->fields['products_quantity']);
Inside that loop, need to insert barcode generation code from something like:
[login to view URL] (but this is not QR (we need QR)
and then generate a code using, say: order_number + products_id + quantity_number + unique_increasing_number in another loop. That way, if someone buys 5 tickets every QR code will be unique.
The pdf then needs to be emailed attached preferrably to the order confirmation email (if payment was made already) else emailed once order status updated from "pending" to "processing" etc..
Another way, less preferred could be:
2. At the end of the Zencart "create-order element of the order class", typically using the notifiers hooks, use PHP to create a JPG/PNG which could be displayed in the browser and printed. The image should be streamed to the browser, and not be a static file anywhere on the server (unless in an .htaccess protected directory); thus it could not be cached easily. Then save the image in the customer's order info page to be reprinted from there if necessary. Problem with this approach is that some customers may not pay immediately, i.e. bank transfer, so they should not be able to print the ticket directly, but we are open to suggestions.
Zencart also has an Developer API section here: [login to view URL]: