Table of Contents

The Receipt...

...And All the Wonderful Things You Can Do With It

The FoxyCart receipt is much like the checkout in terms of how it can be customized, but obviously the function of the receipt is to display the information about the successful transaction that just took place on the checkout. While it might sound rather dull, the receipt is actually quite an exciting place to be, for a few reasons:

While you may not need to ever touch the receipt, it is important to understand how it functions so that you can be prepared if you do need to track marketing activities in the future.

What's Included on the Receipt

The receipt will generally contain nearly all the information about a transaction, with a few exceptions. The information displayed is grouped into a few containers on the receipt.

What's Not Included on the Receipt

Where the Receipt Fits Into the Order Flow

The receipt happens after the checkout, but it's worth noting that the datafeed happens before the receipt is loaded. So by the time the receipt is loaded, the datafeed has already been sent to your endpoint (if configured).

  1. Your site
  2. The cart
  3. The transaction datafeed (if configured)
  4. The receipt
  5. Back to your site.

Also worth noting is that you can configure the “continue” link that's displayed on the receipt in your store's “settings” page. If the continue link is not explicitly set in your store's settings it will use the most recent referring page (ie. the last page that the customer visited before the cart or checkout). If you'd like to set the href of that link dynamically you can do so with a bit of javascript and the JSON cart object, which is available on the receipt.

Revisiting the Receipt

The receipt can be revisited by your customers (or by store admins for viewing or printing orders) using the receipt's unique URL. Here's a quick example, showing a downloadable product in addition to non-downloadable products.

The URL to the receipt is available via the ^^receipt_url^^ placeholder in your email receipts, and in the responses you'll get from the API and the datafeed. You can also get the URL from the “print” link in your FoxyCart admin's transaction history view, which may be the easiest way if you just want to view a past transaction.

Receipt Placeholders

Note: the entire receipt template is optional. You can just use the checkout template if you like.

^^receipt^^
Description: This will be replaced with the receipt contents.
Notes: Required. ^^checkout^^ may also be used, and behaves identically to ^^receipt^^.
^^cart^^
Description: See the Cart Placeholders section above.
Notes: Should be considered a required placeholder unless you have a compelling reason to exclude it.
^^store_domain^^
Description: See the Cart Placeholders section above.
^^store_name^^
Description: See the Cart Placeholders section above.

Analytics & Order Tracking

All analytics and order tracking scripts should be placed inside of ^^receipt_only_begin^^ and ^^receipt_only_end^^ tags. If tracking scripts are not placed within these tags they could be loaded multiple times, causing the data collected to be inaccurate.

^^receipt_only_begin^^
^^receipt_only_end^^
Description: Any code placed between these two placeholders will only be loaded once, on the very first load of the receipt. This can be useful if you'd like to include affiliate tracking info or other scripts to systems that might be confused with multiple submissions of identical data. Place all tracking scripts in between these two tags.
^^order_id^^
Description: If you're using an affiliate system like iDevAffiliate, or another analytics app, this place holder might come in handy.
^^subtotal^^
Description: Products subtotal (without tax or shipping).
^^subtotal_with_tax^^
Description: Products subtotal with tax.
^^order_total^^
Description: Order total (including tax and shipping).

Google Analytics Placeholders

^^analytics_google_ga_async^^
Description: Outputs the full _addTrans(), _addItem(), and _trackTrans() for the asynchronous Google Analytics approach, outlined here.
^^analytics_google_ga^^
Description: “New” version of Google Analytics (ga.js). Details.
^^analytics_google_urchin^^
Description: “Old” version of Google Analytics (urchin.js). Details.
Note: Deprecated. This placeholder will be removed in a future version.