The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

Hiding a custom field ... not showing in cart or checkout, but only on receipt page/email

We're building a site where we're needing to pass a serial number to the cart and only have it show up on the receipt page and receipt email. Ideally I'd like to stay away from making it a hidden field as well in the HTML on the product page in case someone smart enough looks at the source code and grabs it. We're building a site that is selling downloadable products. Upon purchase, they'll be provided a download link and the serial number. Without the serial number, the product will not work.

One thing to note, the user must have a membership before they can go to the checkout, so on this Foxycart forum posting, https://forum.foxycart.com/discussion/5736/i-need-to-pass-a-custom-hidden-field-to-foxycart-so-its-included-in-the-data-feed, I found someone with a similar question. They were trying to pass hidden values and get it back in the datafeed (if I'm understanding it correctly). So if we can't pass a hidden field to the receipt page, would it be possible to pass hidden information and have it returned in the Foxycart API? If so, we could pass the serial number back via the API to the CMS we're using (MODX) and the user could see the serial number in their membership account.

I don't know if that last part is making it more complicated than need be, but just trying to work through some options.

We're using PHP/Foxycart 2.0/MODX 2.3.3
Tagged:
Comments
  • I did run across this posting:

    https://forum.foxycart.com/discussion/5736/i-need-to-pass-a-custom-hidden-field-to-foxycart-so-its-included-in-the-data-feed

    It appears we can pass hidden information back to the data feed. Based on my request above, would it make sense to pass all information back to a custom receipt page we build on our server (not using the Foxycart receipt template) and grab that information via the Foxycart API and show the information (the serial number we have been passing over to the checkout that is hidden) on the new receipt page we built. Is this possible?
  • brettbrett FoxyCart Team
    @flinx777, I think I'd probably approach it differently than you are. As I understand it, you have a serial that's generated somewhere on your end. You want that serial displayed on the receipt when a customer makes the purchase.

    So far, that's correct, yes?

    So given that, I'd probably do something like this:
    1. Serials exist in MODX.
    2. On purchase, send the datafeed to MODX. That'll include everything you need to process the order.
    3. In processing the order, assign a serial # to that transaction ID.
    4. On the receipt, … you've got a few options. Use a JSONP call (with a "reverse SSO" token to authenticate) to retrieve and display the serial number. Or simply redirect using the reverse SSO token to a page in MODX that displays their serial (which I'm guessing you might want anyway, in a sort of "Your Purchases" customer section (which I know you've done in the past with MODX and the FC API).

    Thoughts?
  • flinx777flinx777 Member
    edited May 2015
    @brett yeh, that makes sense and yes you are correct. The goal is provide the customer with a serial number upon a successful transaction.

    So on step #4 above, you're saying we could "pull" the serial number via the "reverse SSO" token? So effectively on the Foxycart checkout page, we'd "pull" that serial number in to display it on the receipt page hosted on Foxycart. Is that correct?

    I was thinking of taking the approach on the second part of your recommendation, but now we're getting into a situation where the user has to visit 2 pages effectively to get all the information. Ideally we'd have that in 1 place. But I follow you.
  • brettbrett FoxyCart Team
    With step #4, it's … it's basically just saying, "Hey, I've got this order ID, give me my serial."
    But for security, you could use the reverse SSO token so it's "Hey, I've got this order ID _and_ I'm the customer who just actually made that purchase. Now give me my serial."

    As far as 2 pages: Either way (JSONP or a redirect) you could just do it all on one page. If you redirect, that'd happen immediately and automatically.
Sign In or Register to comment.