0

I can capture custom order data as per the instructions at http://cartthrob.com/docs/tutorials/adding_custom_data_to_purchased_items_and_orders/ by using a field like this:

{exp:cartthrob:save_customer_info_form}
    <textarea name="delivery_note" id="txt-delivery-note" placeholder="Delivery note"></textarea>
{exp:cartthrob:customer_info}

That gets captured fine but I have a multi-step checkout and when you go back to the page this is on, I can't work out how to populate the field with the data that's been submitted.

It's on a page that has billing and shipping address fields and they all populate as expected but when I try to populate this custom data field as follows, the tag doesn't render:

<textarea name="delivery_note" id="txt-delivery-note" placeholder="Delivery note">{delivery_note}</textarea>

Any suggestions?

This is on EE 2.7.2, CT Pro 2.4.

Thanks

  • Have you tried prefixing? e.g., {order_delivery_note} or {customer_delivery_note}? – Derek Hogue Jan 9 '14 at 13:09
  • Yep - neither variation are parsed. – Russ Back Jan 9 '14 at 15:29
0

Try adding custom_data[] to the name of your textarea.

{exp:cartthrob:save_customer_info_form}
    <textarea name="custom_data[delivery_note]" id="txt-delivery-note" placeholder="Delivery note"></textarea><br />
    <input type="submit" value="submit" />
{/exp:cartthrob:save_customer_info_form}

Then when you're recalling the value use {custom_data:delivery_note}.

{exp:cartthrob:customer_info}
    <textarea name="custom_data[delivery_note]" id="txt-delivery-note" placeholder="Delivery note">{custom_data:delivery_note}</textarea>
{/exp:cartthrob:customer_info}
| improve this answer | |
  • Chris, I tried to use {custom_data:delivery_note} on the order notification templates but although they get sent OK, I get a Template class error. Any suggestions? – Russ Back Jan 21 '14 at 17:09
  • What is the template class error you're receiving? If you're using a {submitted_order_info} tag in your notification template, you should be able to use the short name of your delivery note field without the custom_data: prefix. Try using {delivery_note} instead of {custom_data:delivery_note} and see if the template class errors persist. – CartThrob - Barrett Jan 22 '14 at 22:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.