In the previous examples we've built a complete checkout form that utilized all of MemberMouse's checkout form SmartTags to collect account, billing and shipping information, display order information and allow customers to pay using their credit card or an offsite payment method like PayPal. In some cases there may be data that you're not interested in collecting and would like to remove it from the form so that the customer can checkout as quickly as possible.
In this example, we'll create a minimal checkout form that just collects account information, credit card information and billing zip code. In the finished example you'll notice that the account information and order information sections are exactly the same as they were in previous examples so you can check out those examples for more details. For account information fields, note that by placing them within the
accountInfo MM_Form_Section they will only be shown when the customer is creating a new account. MemberMouse will automatically hide these fields when a current member is making a purchase ensuring that customers will always be presented with the minimal amount of fields to fill out.
MemberMouse's checkout forms have intelligent validation built in which allows us to inform the customer if they're trying to submit an order with incomplete information. In creating a minimal checkout form we want to make it so that the customer is not responsible for filling out certain fields. The way we do this is with hidden fields. Using hidden fields lets MemberMouse know that the customer will not be filling out these fields so it's okay if there's no data provided. Here's how you would create a billing section that just collects billing zip code and credit card information:
Zip Code: [MM_Form_Field name="billingZipCode"]
Credit Card Number: [MM_Form_Field name="ccNumber"]
Exp. Date: [MM_Form_Field name="ccExpirationDate"]
Security Code: [MM_Form_Field name="ccSecurityCode"]
[MM_Form_Field type="hidden" name="billingAddress"]
[MM_Form_Field type="hidden" name="billingCity"]
[MM_Form_Field type="hidden" name="billingState"]
[MM_Form_Field type="hidden" name="billingCountry" value="US"]
The zip code and credit information are added in the same way they were in the billing information example. The remainder of the billing fields are added as hidden form fields. Notice that it's also possible to pass a default value for a hidden form field by setting the
NOTE: The payment method you're using (i.e. Authorize.net, Stripe, etc) may have its own validation requirements so it's possible that when submitting a minimal checkout form you may get an error informing you that a certain billing field is required. In this case you just need to set the
value attribute for the hidden field that's required to a default value. For example, if the payment method you're using requires a billing state, you could do the following:
[MM_Form_Field type="hidden" name="billingState" value="NA"]
Minimal Checkout Form Example
Below is what the form looks like using the default styling on a random WordPress Theme. Note: Your viewing experience may be different.
Note: The form will look different depending on the theme you've chosen.
Checkout Page Examples Overview