In the previous example we built a checkout form that collected account, billing and shipping information, displayed order information and allowed customers to pay using their credit card or an offsite payment method like PayPal. In this example we'll extend that by adding form elements that allow the customer to apply a coupon to their order.
The first thing we'll do is create a form section where we can put Form SmartTags related to coupons. Creating this form section is not required but is recommended. Doing this allows MemberMouse to only show the coupon section when coupons are active and available on your MemberMouse site. Using this example as a starting point you'll add the following below the shipping information section:
<!-- all coupon Form SmartTags and design elements go here -->
Next, we'll add a form field and a button inside the
MM_Form_Sectionblock so that the user can enter in a coupon code and apply in it to the order. Here's what you'll add:
Coupon Code: [MM_Form_Field name="couponCode"]
<a href="[MM_Form_Button type='applyCoupon']">Apply Coupon</a>
Now the customer can enter in a coupon code in the
couponCodeform field and click the Apply Coupon button to apply it to the order.
Next, we'll add a couple of form messages so that the user can be provided with feedback after applying a coupon. Here's what you'll add:
[MM_Form_Message type="couponSuccess"] [MM_Form_Message type="couponError"]
Coupon Support Example
Below is an example of what a coupon area will look like. Note: The "Apply Coupon" field will only show if there are active and available coupons.
Note: The form will look different depending on the theme you've chosen.
Previous Example - Display Order Information Next Example - Minimal Checkout Form