In the previous example we built a checkout form that collected account, billing and shipping 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 display information about the order on screen such as the name, price and description of the product being purchased, shipping price, discount amount and total price of the order.
To display data on the screen we'll use the
MM_Form_Data SmartTag and set the
name attribute to indicate which data the field is displaying. For example, to display the product price on screen you'll set the
name attribute to
productPrice. Using this example as a starting point, you'll add the following after the
MM_Form_Message tag to display order information on the screen:
Product Name: [MM_Form_Data name="productName"]
Product Description: [MM_Form_Data name="productDescription"]
Product Price: [MM_Form_Data name="productPrice"]
Shipping Price: [MM_Form_Data name="shippingPrice"]
Discount: [MM_Form_Data name="discount"]
Total Price: [MM_Form_Data name="totalPrice"]
Now order information will be displayed on screen. Everything related to the product will come from the product configuration in MemberMouse. The shipping price will dynamically change based on what shipping method is selected. The discount amount will dynamically change based on what coupon is applied to the order. The total price is dynamically calculated based on the current values of product price, shipping price and discount amount.
Display Order Information Example
Below is an example of what the order information might look like using the code above:
Note: The information here will look different depending on the theme you've chosen, and the product that the customer is purchasing.
Checkout Page Examples Overview