This is the API docs for LemonStand V1, which has been discontinued. LemonStand is now a cloud based platform, available at lemonstand.com.

LemonStand API

shop:on_setCouponCode AJAX handler

Defined in /modules/shop/classes/shop_actions.php, lines 892-919
Author LemonStand eCommerce Inc.
Allows to create a text field for entering a coupon code and a button for processing the code and redirecting the browser to a specific page. Usually this AJAX handler used on the Cart page together with shop:cart action. You can use this handler for creating the AJAX driven Checkout button on the Cart page. Example:
  <label for="coupon_code">Do you have a coupon?</label> <input id="coupon_code" type="text" name="coupon"/>
  <input type="button" value="Checkout!" onclick="return $(this).getForm().sendRequest('shop:on_setCouponCode')"/>
  <input type="hidden" name="redirect" value="/checkout_start"/>

See Also

Supported form fields

Field Type Description
coupon string specifies the coupon code, required.
redirect string specifies an URL to redirect the browser to, optional.

Supported form field details

coupon form field

Specifies the coupon code, required.

redirect form field

Specifies an URL to redirect the browser to, optional. Note that if your copy of LemonStand is installed in a subdirectory, you need to use the root_url() function in the redirect field value.