This is the documentation for LemonStand V1, which has been discontinued. You can learn more and upgrade your store here.

LemonStand Version 1 Has Been Discontinued

This documentation is for LemonStand Version 1. LemonStand is now offered as a cloud-based eCommerce platform.
You can try the new LemonStand and learn about upgrading here.

Adding a Field for Customer Order Notes in Checkout

LemonStand allows customer order notes to be specified on any step of the checkout process. Use the following code snippet to create a text field for entering order notes on any checkout partial:

<textarea name="customer_notes"><?= h(Shop_CheckoutData::get_customer_notes()) ?></textarea>
<textarea name="customer_notes">{{ method('Shop_CheckoutData', 'get_customer_notes') }}</textarea>

Please note the field name: customer_notes. The customer notes field is not required. If you need to force customers to always enter order notes, you can check whether the field is not empty in the page Pre Action PHP code:

if (array_key_exists('customer_notes', $_POST) && !strlen(trim(post('customer_notes'))))
	throw new Phpr_ApplicationException('Please provide order notes');

The code checks whether the customer_notes field is presented in the POST data and if it is presented but empty, throws the exception.

Next: Implementing the Step-By-Step Checkout
Previous: AJAX-driven single-page checkout
Return to Checkout Process