I work at a library and want to add a small message to checkout receipts showing something like, "You saved $XX by using the library today!" The amount only needs to cover the items checked out during that transaction; we do not retain long-term checkout histories for privacy reasons. Our library uses Evergreen, which stores each book's MSRP, and its receipt templates can be edited locally. The receipts print through a Star receipt printer, but there is no separate printer-specific program involved. I know a little coding but am unsure how to access the MSRP values in Evergreen, add them together for the current checkout, and display the total in the receipt footer. What would the general approach be?
2 Answers
Because the receipt template is stored and edited within Evergreen, the printer itself probably is not where the calculation needs to happen. You’ll need to confirm that the checkout data passed into the template includes MSRP for every item, then find out whether Evergreen templates can perform a sum over those values. If they cannot, the calculation would likely require changing Evergreen’s checkout or receipt-generation code rather than just editing the printed layout. Start with a test template that displays one item’s MSRP, then investigate how existing totals are calculated before attempting the final footer.
The first thing to determine is how Evergreen’s receipt template exposes item data. If the template can already print fields such as title, author, price, or fees, look for the field that contains each item’s MSRP and test printing it for individual checkout lines. After that, check whether the template system supports calculated or aggregate fields, such as summing a value across all items in the current transaction. You would then place that total in a footer with the savings message. The exact syntax depends on Evergreen’s template system, so its template documentation or existing examples involving totals and fees will be important.

Since the Star printer only receives the finished receipt content, it should not need to know anything about the prices or the calculation. The important part is the Evergreen data and template engine that generate that content.