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.

How to use --open-- in HMAC?

EpotratzEpotratz Member
Guys,

I'm not understanding the help documentation on this...

I have a variable image URL that changes in my Buy Button form, so I need to keep it out of the HMAC validation.

Here is the current code for the image:
<input type="hidden" name="image||89d4a42b026bad37a51866f78ba6a80b9dc775e10f4bd4322c1a0cd29f387bbd" value="https://daks2k3a4ib2z.cloudfront.net/57fa771f45bf29a4636b6816/5a274a4246ed9b000152452a_palm_fruit_60_capsules-(for-cart).png">

How does the code need to look before it goes into the HMAC encoder? (open, -open-, --open--, -OPEN-, --OPEN-- ?? And input where??)

And how does the code need to look when it goes onto my website with the image URL? (still need open, -open-, --open--, -OPEN-, --OPEN-- ??)

Thanks,
Comments
  • fc_adamfc_adam FoxyCart Team
    @Epotratz,

    I believe we got you squared away on this in our email thread - but to follow up here too in case anyone else finds this thread:

    If you have a text input within an add to cart form that you need to allow a dynamic value for, whether that is because the user is able to change the value, or you're changing it using javascript, it can't be signed as normal as once it's changed it will fail validations.

    To allow for that, we do support an "open" setting for form signing that allows for the value to be changed. To trigger that, when signing the form, you would pass a value of --OPEN-- in the form fields value.

    For example, as an input, that would look like this:
    <input type="text" name="my_open_field" value="--OPEN--"
    After signing, you'll notice that any "open" fields will have ||open appended to the signature, which identifies those fields that are open. To confirm, you don't need to add that suffix to the signature, it will get added by the signing process.

    After signing the form, if you're handling it manually, you can then replace the --OPEN-- value with whatever you need it to be.

    I hope that helps! We've also updated the documentation for this to hopefully make things a little clearer.
Sign In or Register to comment.