Q:

How To Store Custom Field Data in CartThrob Session

I have a "gift message" custom fields setup on the last page of my CartThrob checkout process.  Here's my code sample:
{exp:cartthrob:checkout_form return="/checkout/billing/process"}
    <textarea id="gift_message" name="gift_message">
         {if gift_message}
              {gift_message}
         {/if}
    </textarea>
{/exp:cartthrob:checkout_form}

If the order is submitted and there's an error, the "gift message" data isn't retained.  How can I force it to save to the CartThrob session? 

A:

With custom data, you have to prefix the names to save to the session:
ie.  <textarea id="gift_message" name="custom_data[gift_message]"> You may need to change the conditional to: {if custom_data:gift_message}{custom_data:gift_message}{/if}

