less than a minute read • Updated 6 days ago
Pre-populate custom checkout fields
How to have a custom checkout field come pre-filled for the customer using a hidden session value passed in with the add-to-cart link — handy for known info like a referral source or account ID.
Unlike Foxy’s standard checkout fields, custom fields you create aren’t prepopulated automatically. You can add that behavior yourself using Twig, pulling the value from a hidden session attribute passed in through the cart.
Steps
Notes
This is a separate mechanism from keeping a field’s value in place when the checkout re-renders after the customer has already typed something in — see Keep custom field values when the checkout re-renders for that.