Price, Shipping and Tax Item Rules

Introduction

Rules are algorithms that MGI uses to calculate product price specials, shipping and tax. Rules can be applied on a per item basis (item rules) or across all items in the shopping basket (basket rules). Item rules apply to individual items and are entered in the mgiBuyMe tag for the specific item. Item tax rules also require parameters in the mgiConfirmOrder and mgiSendOrder tags. Basket rules apply across all items in a shopping basket and are entered in the mgiShoppingBasket, mgiConfirmOrder, and mgiSendOrder tags.

Item rules and basket rules are mutually exclusive for each type of rule. For example, you may not have an item price rule and a basket price rule, however you may have an item price rule and a basket shipping rule. All rules are configured in the web-based administration interface of the mgiShoppingBasket tag.

Price rules specific to items include specials such as "buy one get one free" and percentage discounts. Using the mgiBuyMe tag, a shipping price can be specified for each product, but shipping rules allow you to add base shipping costs for each product and shipping charges or for specific items (e.g., "$1 S&H" or "free shipping when you buy 2 or more of this item"). Tax rules help you calculate local, state and federal taxes or any other tax on a specific item based on a customer's location. Tax rules can also be chained in a specific order for multiple taxes.

The following example is a shopping site for art posters that illustrates price, shipping and tax rules for individual items (i.e. "item rules"). This example is hard-coded products. The same principles would apply to mgiBuyMe tags with embedded product information from a database.

MGI Tags

Steps

  1. Create a shopping basket administration page in a text editor.
  2. Insert the mgiShoppingBasket tag in admin mode.
  3. Save the shopping basket administration page.
  4. FTP the shopping basket administration page to the web server running MGI.
  5. View the shopping basket administration page in a web browser.
  6. Create a shopping basket handle.
  7. Configure item price rules.
  8. Configure item shipping rules.
  9. Configure item tax rules.
  10. Create product pages and open them in a text editor.
  11. Insert an mgiBuyMe tag, rule parameters and a submit button for each product.
  12. Save the product pages.
  13. Create a shopping basket page and open it in a text editor.
  14. Insert the mgiShoppingBasket and mgiButton tags.
  15. Save the shopping basket page.
  16. Create a check out page and open it in a text editor.
  17. Insert the mgiCollectUserInfo and mgiButton tags.
  18. Save the check out page.
  19. Create a confirm order page and open it in a text editor.
  20. Insert the mgiConfirmOrder tag, customerLocation parameter and mgiButton tag.
  21. Save the confirm order page.
  22. Create an order processing page and open it in a text editor.
  23. Insert the mgiSendOrder tag and customerLocation parameter.
  24. Save the order processing page.
  25. Tokenize all other pages of the web site.
  26. Save the web site pages.
  27. FTP all pages to the web server running MGI.
  28. View a product page in a web browser and purchase a product.


Step 1: Create a shopping basket administration page in a text editor.

Create a new page in a text editing program to display the web-based, shopping basket administration interface.

Step 2: Insert the mgiShoppingBasket tag in admin mode.

On the shopping basket administration page, enter the mgiShoppingBasket tag and mode parameter. In the mode parameter, enter "admin".
<mgiShoppingBasket mode="admin"> </mgiShoppingBasket>

Step 3: Save the shopping basket administration page.

Save the shopping basket administration page and name it "sbadmin.mgi".

Step 4: FTP the shopping basket administration page to the web server running MGI.

Upload the shopping basket administration page (sbadmin.mgi) from your local computer to the web server using an FTP program.

Step 5: View the shopping basket administration page in a web browser.

View the shopping basket administration page (sbadmin.mgi) in a web browser. The first screen of the web-based, administration interface is displayed.

Step 6: Create a shopping basket handle.

Below the column "Shopping Basket Name", enter the name of a shopping basket handle and click the "Add" button. In this example, the shopping basket handle is named "Posters". The shopping basket handle determines the configuration of a shopping basket (you may have and use multiple shopping basket handles in one region). For a default shopping basket configuration, the handle does not require customization and merely needs to be created. Price, shipping, and tax rules require configuration of the shopping basket handle.

Step 7: Configure item price rules.

To configure the shopping basket handle (name), click the "Edit" button beside the shopping basket name to display the configuration interface:

Click the "Edit" button beside "Price Rules" to display the price rules interface. Notice there are six pre-configured price rules. All pre-configured price rules are item rules and can be entered in the mgiBuyMe tag. In this example, one item is discounted with the pre-configured "buyOneGetOneFree" price rule.
 
To create a custom price rule, enter a name for the price rule and click the "Add Rule" button. For this example, create a price rule named "percentDiscount" to use for specific item discounts.

To configure the price rule, click the "Edit" button beside the price rule to display the price rule configuration interface. The price rule configuration provides selections for almost any price rule algorithm. The options for a price rule segment are the scope of the price rule (item or basket), the beginning and ending break points of the price rule, the dollar or percentage discount, the units required for the discount, and the unit of measurement for the discount (item quantity, item price or item weight). Multiple segments of a price rule allow you to configure multiple break points or multiple conditions. Price rules are performed as they are entered from top to bottom.
 
In this example, the "percentDiscount" price rule will discount an item 5% for the first purchase and discount the item 15% percent for all additional purchases (i.e., "5% for 1 and 15% for 2 or more"). The separate discounts and associated conditions are configured in two separate segments of the "percentDiscount" price rule.
 
First, configure the 5% discount segment of the price rule. The scope of the discount is a specific item. The beginning and ending break points of the discount are a purchase of 1 item (i.e., beginning at 1 and ending at 1). The discount itself is 5 percent. The discount is not applied to each item from the beginning break point to the ending break point (the discount only applies once when the beginning break point is reached), therefore the discount applies to zero units of quantity.

Next, configure the 15% discount segment of the price rule. To add a new segment to the price rule, click the "Add Segment" button. The scope of the additional discount is a specific item. The beginning break point of the discount is the second item purchased (i.e., "2") and there is not an ending break point (i.e., "0"). The discount itself is 15 percent. The discount is not applied to each item from the beginning break point to the ending break point (the discount only applies once when the beginning break point is reached), therefore the discount applies to zero units of quantity.

Click the "Save" button to save the price rule configuration and return to the price rules interface.

Step 8: Configure item shipping rules.

Return to the main configuration interface for the "Posters" shopping basket handle by clicking the "Back" button under the "Operation" column. Click the "Edit" button beside "Shipping Rules" to display the shipping rules interface.
 
To create a custom shipping rule, enter a name for the shipping rule and click the "Add Rule" button. For this example, create a shipping rule named "freeShipping" to offer free shipping for multiple quantity purchases.

To configure the shipping rule, click the "Edit" button beside the shipping rule to display the shipping rule configuration interface.
 
The shipping rule configuration provides a selection for an overall base shipping cost (in addition to other item or basket shipping charges). The options for a shipping rule segment are the scope of the shipping rule (item or basket), the base shipping cost, the beginning and ending break points of the shipping rule, the dollar or percentage shipping charge, the units required to incur the shipping charge and the unit of measurement basis of the shipping charge. Multiple segments of a shipping rule allow you to configure multiple break points or multiple conditions. Shipping rules are performed as they are entered from top to bottom.
 
For this example, the shipping charge for some items is "free shipping for purchasing 2 or more of an item". To configure this shipping charge, add 2 segments, the first to configure the shipping charges for purchasing only 1 of an item and the second to configure the shipping charges for purchasing 2 or more of an item.
 
In the first segment, configure the shipping charges for a single purchase of an item. The scope of the shipping charge is an item. The base shipping cost is zero. The beginning and ending break points of the shipping charge are a purchase of 1 item (i.e., beginning at 1 and ending at 1). The shipping charge is 2 dollars for the first item and the shipping charge applies to each quantity unit (1) that is purchased.

In the second segment, configure the free shipping charges for multiple quantities purchased. To add a new segment to the shipping rule, click the "Add Segment" button. The scope of the free shipping is an item. The base shipping cost is zero. The beginning break point of the free shipping is the second item purchased (i.e., "2") and there is not an ending break point (i.e., "0"). The shipping charge is zero dollars and that free shipping applies to each quantity unit (1) that is purchased.

Click the "Save" button to save the shipping rule configuration and return to the shipping rules interface.

Step 9: Configure item tax rules.

Return to the main configuration interface for the "Posters" shopping basket handle by clicking the "Back" button under the "Operation" column. Click the "Edit" button beside "Tax Rules" to display the tax rules interface.
 
For this example, the tax charge is 1% for city sales tax and 3% for state sales tax on selected items. Customers pay no tax charges on other items. Each tax charge is entered as a separate tax rule, but the tax rules can be "chained" together to charge multiple taxes. Multiple segments of a tax rule can be added to charge taxes for multiple locations. For example, if you are charging a different state tax for North Carolina and South Carolina, you would enter two segments to the "state" tax rule.
 
Create two new tax rules. Name the first tax rule, "city" and the second tax rule "state". To create a custom tax rule, enter a name for the tax rule and click the "Add Rule" button.

To configure a tax rule, click the "Edit" button beside the tax rule. The options for a tax rule are the scope of the tax rule (item or basket), the percentage tax charge, the location(s) receiving the tax charge and the next tax rule to apply in the chain.
 
Configure the "state" tax rule as a 3% tax for residents of North Carolina (NC). The scope of the tax charge is an item. The tax charge is 3 percent. The location of the tax charge is North Carolina. Multiple locations or multiple values should be entered as a comma-delimited list (e.g., "North Carolina, NC"). After the "state" tax is applied for North Carolina, continue to the "city" tax rule. Click "Save" to save the tax rule and return to the tax rules interface.

Configure the "city" tax rule as a 1% tax for residents of Raleigh. The scope of the tax charge is an item. The tax charge is 1 percent. The location of the tax charge is Raleigh. Multiple locations or multiple values should be entered as a comma-delimited list. After the "city" tax is applied for North Carolina, no additional taxes are charged. Click "Save" to save the tax rule and return to the tax rules interface.

Close the shopping basket admin page.

Step 10: Create product pages and open them in a text editor.

Create pages to display products for sale. You may choose any design and layout for products including pictures, descriptions, pricing information, etc. Insert placeholders for a quantity box for each product and a submit button. The default quantity box is 3 characters wide. Finally, open your product pages in a text editing program that allows you to view and modify the HTML and code of the page.

Step 11: Insert an mgiBuyMe tag, rule parameters and a submit button for each product.

Replace the quantity box placeholder for each product with an mgiBuyMe tag, productID parameter, name parameter, price parameter, and shipping parameter. For products with special pricing, shipping charges, or tax charges, enter the priceRule parameter, shippingRule parameter, and taxRule parameter, respectively.
In the productID parameter, enter a unique code for the product or embed the product's unique ID from a database search. Product information is tracked through the shopping basket by the productID. In the name parameter, enter a short description of the product or embed the product's short description from a database search. In the price parameter, enter the per item price of each product as a decimal number or embed the product's price from a database search. Do not enter characters such as dollar signs in the price parameter. In the shipping parameter, enter the per item shipping cost of each product as a decimal number or embed the product's shipping cost from a database search. Do not enter characters such as dollar signs in the shipping parameter.
 
If the product receives special pricing (e.g., "Buy one get one free"), include the priceRule parameter in the mgiBuyMe tag. In the priceRule parameter, enter the name of the price rule to apply to the item.
 
If the product incurs a shipping charge, include the shippingRule parameter in the mgiBuyMe tag. In the shippingRule parameter, enter the name of the shipping rule to apply to the item. With the specified shipping rule, the "shipping" parameter does not need to be entered.
 
If the product incurs a tax charge (or multiple tax charges), include the taxRule parameter in the mgiBuyMe tag. In the taxRule parameter, enter the name of the tax rule to apply. If tax rules are "chained" together, only enter the top-level tax rule. For example, if a tax rule is chained from "state" to "county" to "city", you would enter only the "state" tax rule.
 
Replace the submit button placeholder for each item (or for all items) with an mgiButton tag and value parameter. In the value parameter, enter the value that will display on the submit button (e.g., "Add to Shopping Basket").
 
A form action adds the quantity entered in the quantity box(s) to the shopping basket page for processing when the submit button is clicked. Enter the name of the shopping basket page (basket.mgi) in the action parameter of the <FORM> tag. Enter "post" in the method parameter of the <FORM> tag. Enclose the mgiBuyMe tag and "Add to Shopping Basket" submit button for each item with HTML form tags. If you want to allow customers to add multiple items to a shopping basket at one time, enclose all mgiBuyMe tags and a single submit button or multiple submit buttons with HTML form tags.
 
The default shopping basket uses tokens to track the purchases of individual customers. Enter one beginning mgiToken tag before all products and submit buttons, and enter one ending mgiToken tag after all products and submit buttons. The mgiToken tags should enclose all links on the page including HREFs and FORM actions.
 
The following are several examples of products with special item pricing, item shipping charges and item tax charges. One product may have pricing, shipping and/or a tax rule applied. You may not apply more than one of a single rule type to a product. For example, you may not apply three pricing rules to an individual product.
<mgiToken>

<mgiComment>Product with no price, 
shipping or tax rules</mgiComment>

<FORM ACTION="basket.mgi" METHOD="post">
<P><CENTER>
<B><FONT SIZE="+1">Waterlilies</FONT></B>
</CENTER></P>
<P><CENTER><IMG SRC="images/GCL522S.JPG" BORDER="0" 
WIDTH="150" HEIGHT="100" ALIGN="BOTTOM">
<BR>Item: GCL522
<BR>Artist: Monet
<BR>24&quot; x 36&quot;
<BR><MGIBUYME PRODUCTID="GCL522" NAME="Waterlilies" 
PRICE="20.00" SHIPPING="1.00"> @ $20.00 ea.
<BR><MGIBUTTON VALUE="Buy Now!">
</CENTER>
</FORM>

<mgiComment>Product with the pre-configured buy 
one get one free price rule</mgiComment>

<FORM ACTION="basket.mgi" METHOD="post">
<P><CENTER>
<B><FONT SIZE="+1">Bassin aux Nympheas</FONT></B>
</CENTER></P>
<P><CENTER>
<B><FONT COLOR="#ff0000" SIZE="+1">
Special: Buy 1 Get 1 FREE</FONT></B>
</CENTER></P>
<P><CENTER><IMG SRC="images/GCL593S.JPG" BORDER="0" 
WIDTH="96" HEIGHT="144" ALIGN="BOTTOM">
<BR>Item: GCL593
<BR>Artist: Monet
<BR>24&quot; x 36&quot;
<BR><MGIBUYME PRODUCTID="GCL593" 
NAME="Bassin aux Nympheas" PRICE="20.00" 
SHIPPING="1.00" PRICERULE="buyOneGetOneFree">
@ $20.00 ea.
<BR><MGIBUTTON VALUE="Buy Now!">
</CENTER>
</FORM>

<mgiComment>Product with price rule of 5% 
discount for purchasing 1 of th item and 15%
discount for purchasing 2 or more of the item
</mgiComment>

<FORM ACTION="basket.mgi" METHOD="POST">
<P><CENTER>
<B><FONT SIZE="+1">The Starry Night</FONT></B>
</CENTER></P>
<P><CENTER>
<B><FONT COLOR="#ff0000" SIZE="+1">
Special: 5% Discount on 1 &amp;
<BR>15% discount on 2 or more</FONT></B>
</CENTER></P>
<P><CENTER><IMG SRC="images/GCM550S.JPG" BORDER="0" 
WIDTH="124" HEIGHT="100" ALIGN="BOTTOM">
<BR>Item: GCM550
<BR>Artist: Van Gogh
<BR>16 x 20
<BR><MGIBUYME PRODUCTID="GCM550" 
NAME="The Starry Night" PRICE="14.00" 
SHIPPING="1.00" PRICERULE="percentDiscount">
@ $14.00 ea.
<BR><MGIBUTTON VALUE="Buy Now!">
</CENTER>
</FORM>

<mgiComment>Product with free shipping rule 
for purchasing 2 or more of the item</mgiComment>

<FORM ACTION="basket.mgi" METHOD="post">
<P><CENTER>
<B><FONT SIZE="+1">Sailboats at Argenteuil</FONT></B>
</CENTER></P>
<P><CENTER>
<B><FONT COLOR="#ff0000" SIZE="+1">
Special: Purchase 2 or more and receive FREE 
shipping on this item</FONT></B>
</CENTER></P>
<P><CENTER><IMG SRC="images/ARV759S.JPG" BORDER="0" 
WIDTH="215" HEIGHT="70" ALIGN="BOTTOM">
<BR>Item: ARV759
<BR>Artist: Monet
<BR>11-3/4&quot; x 36&quot;
<BR><MGIBUYME PRODUCTID="ARV759" 
NAME="Sailboats at Argenteuil" PRICE="12.00" 
SHIPPINGRULE="freeShipping">
@ $12.00 ea.
<BR><MGIBUTTON VALUE="Buy Now!">
</CENTER>
</FORM>

<mgiComment>Product with chained tax rule 
for state taxes and city taxes</mgiComment>

<FORM ACTION="basket.mgi" METHOD="POST">
<P><CENTER>
<B><FONT SIZE="+1">Composition No. 6</FONT></B>
</CENTER></P>
<P><CENTER><IMG SRC="images/GCL641S.JPG" BORDER="0" 
WIDTH="150" HEIGHT="100" ALIGN="BOTTOM">
<BR>Item: GCL641
<BR>Artist: Kandinsky
<BR>24&quot; x 36&quot;
<BR><MGIBUYME PRODUCTID="GCL641" 
NAME="Composition No. 6" PRICE="16.00" 
SHIPPING="1.00" TAXRULE="state">
@ $16.00 ea. + <B><FONT COLOR="#ff0000">Tax</FONT></B>
<BR><MGIBUTTON VALUE="Buy Now!">
</CENTER>
</FORM>

</mgiToken>

Step 12: Save the product pages.

Save the changes you have made to the product pages.

Step 13: Create a shopping basket page and open it in a text editor.

Create a page named "basket.mgi" to display the contents of a customer's shopping basket and open the page in a text editing program that allows you to view and modify the HTML and code.

Step 14: Insert the mgiShoppingBasket and mgiButton tags.

Insert your cursor in the HTML of the shopping basket page where you want the shopping basket to display and enter the beginning mgiShoppingBasket tag, handle parameter and ending mgiShoppingBasket tag. In the handle parameter, enter the name of the shopping basket handle you created in the shopping basket administration (i.e., "Posters").
 
Below the mgiShopping basket tag, enter an mgiButton tag and value parameter. In the value parameter, enter the value that will display on the submit button to modify shopping basket quantities (e.g., "Modify Quantity").
 
Below the mgiShoppingBasket tag and modify quantity button, enter a second mgiButton tag and value parameter. In the value parameter, enter the value that will display on the submit button to proceed to the check out page (e.g., "Check Out").
 
On the shopping basket page, form actions perform two functions. One form action modifies the contents of the shopping basket (i.e., changes quantities). Enclose the mgiShoppingBasket tag and mgiButton tag used to modify the shopping basket with HTML form tags. Enter the name of the shopping basket page (basket.mgi) in the action parameter of the <FORM> tag and enter "post" in the method parameter of the <FORM> tag.
 
Another form action links customers to the check out page to enter payment, billing and shipping information. Enclose the mgiButton tag used to check out with HTML form tags. Enter the name of the check out page (checkout.mgi) in the action parameter of the <FORM> tag and enter "post" in the method parameter of the <FORM> tag. Note: To use a secure server to collect payment information, enter the URL to a secure server running MGI in the action parameter of the <FORM> tag (e.g., https://secure.domain.com/checkout.mgi). You may substitute a text link for the check out button and form tags.
 
The default shopping basket uses tokens to track the purchases of individual customers. Enter a beginning mgiToken tag before the first HTML form tag and enter an ending mgiToken tag after the last closing HTML form tag. The mgiToken tags should enclose all links on the page including HREFs and FORM actions.
 
The following is an example shopping basket page.
<mgiToken>

<center>

<h2>Shopping Basket</h2>

<form action="basket.mgi" method="post">

<p><mgiShoppingBasket handle="Posters">
</mgiShoppingBasket>

<p><mgiButton value="Modify Quantity">

</form>

<form action="checkout.mgi" method="post">

<mgiButton value="Check Out">

</form>

</center>

</mgiToken>
The default shopping basket contents display in a table with columns for product removal, product quantity, product ID, product name, product price, multiplied product subtotals and order total. Price discounts are deducted and displayed in the "Total Price" column.

Step 15: Save the shopping basket page.

Save the changes you have made to the shopping basket page (basket.mgi).

Step 16: Create a check out page and open it in a text editor.

Create a page named "checkout.mgi" to collect payment, billing and shipping information from the customer and open the page in a text editing program that allows you to modify the HTML and code of the page.

Step 17: Insert the mgiCollectUserInfo and mgiButton tags.

Insert your cursor in the HTML of the check out page where you want the payment, billing and shipping information tables to display and enter the mgiCollectUserInfo tag, handle parameter and shoppingBasketURL parameter. In the handle parameter, enter the name of the shopping basket handle you created in the shopping basket administration (i.e., "Posters"). In the shoppingBasketURL parameter, enter the full URL to the region where items were added to the shopping basket (and thus where the internal MGI shopping basket database was created and populated).
 
Below the mgiCollectUserInfo tag, enter an mgiButton tag and value parameter. In the value parameter, enter the value that will display on the submit button to proceed to the order confirmation page (e.g., "Confirm Order").
 
Form actions on the check out page link customers to the order confirmation page to review their order and customer information. Enclose the mgiCollectUserInfo tag, mgiButton tag, and any custom form elements with HTML form tags. Enter the name of the order confirmation page (confirm.mgi) in the action parameter of the <FORM> tag and enter "post" in the method parameter of the <FORM> tag.
 
The default shopping basket uses tokens to track the purchases of individual customers. Enter a beginning mgiToken tag before the beginning HTML form tag and enter an ending mgiToken tag after the ending HTML form tag. The mgiToken tags should enclose all links on the page including HREFs and FORM actions.
 
The following is an example check out page.
<mgiToken>

<form action="confirm.mgi" method="post">

<center>

<mgiCollectUserInfo handle="Posters" 
shoppingBasketURL="http://www.domain.com/shop/">

<p><mgiButton value="Confirm Order">

</center>

</form>

</mgiToken>
The default check out page display payment, billing and shipping information in tables. Custom form elements appear as you format them.

Step 18: Save the check out page.

Save the changes you have made to the check out page.

Step 19: Create a confirm order page and open it in a text editor.

Create a page named "confirm.mgi" to present the final shopping basket, payment information, billing information, and shipping information for review. Open the confirm order page in a text editing program that allows you to view and modify the HTML and code of the page.

Step 20: Insert the mgiConfirmOrder tag, customerLocation parameter and mgiButton tag.

Insert your cursor in the HTML of the confirm order page where you want the shopping basket, payment, billing, shipping, and additional information tables to display and enter the beginning mgiConfirmOrder tag, handle parameter, shoppingBasketURL parameter, customerLocation parameter and ending mgiConfirmOrder tag.
 
In the handle parameter, enter the name of the shopping basket handle you created in the shopping basket administration (i.e., "Posters"). In the shoppingBasketURL parameter, enter the full URL to the region where items were added to the shopping basket (and thus where the internal MGI shopping basket database was created and populated).
 
When implementing a tax rule, you must collect the customer's location(s) from their billing information and embed it in the customerLocation parameter of the mgiConfirmOrder parameter. For "chained" tax rules, embed a comma-delimited list of the customer's location from the top-level tax rule to the bottom-level tax rule. The location list must be in the same order as the tax rule chain. Create the comma-delimited list in a variable (using mgiSet) before the mgiConfirmOrder tag and embed the variable in the customerLocation parameter of the mgiConfirmOrder tag (using mgiGet). In this example, the customer's state and city are compiled in a variable and embedded in the customerLocation parameter.
 
Below the mgiConfirmOrder tag, enter an mgiButton tag and value parameter. In the value parameter, enter the value that will display on the submit button to proceed to the final order processing page (e.g., "Complete Order").
 
Form actions on the confirm order page link customers to the order processing page to complete and send their order. Enclose the mgiConfirmOrder tag and mgiButton tag with HTML form tags. Enter the name of the order processing page (process.mgi) in the action parameter of the <FORM> tag and enter "post" in the method parameter of the <FORM> tag.
 
The default shopping basket uses tokens to track the purchases of individual customers. Enter a beginning mgiToken tag before the beginning HTML form tag and enter an ending mgiToken tag after the ending HTML form tag. The mgiToken tags should enclose all links on the page including HREFs and FORM actions.
 
The following is an example confirm order page.
<mgiToken>

<form action="process.mgi" method="post">

<center>

<mgiSet name="locations">
<mgiPostArgument name="bSTATE">,<mgiPostArgument 
name="bCITY">
</mgiSet>

<mgiConfirmOrder handle="Posters" 
shoppingBasketURL="http://www.domain.com/shop/" 
customerLocation={mgiGet name="locations"}>
</mgiConfirmOrder>

<p><mgiButton value="Complete Order">

</center>

</form>

</mgiToken>
The default confirm order page displays completed elements of the payment, billing and shipping information. The confirm order page also displays the calculated shipping and total item tax charges.

Step 21: Save the confirm order page.

Save the changes you have made to the confirm order page.

Step 22: Create an order processing page and open it in a text editor.

Create an page named "process.mgi" to present a "thank you for purchasing" message to customers and to send a formatted email of the order to a specified address. Open the order processing page in a text editing program that allows you to view and modify the HTML and code of the page.

Step 23: Insert the mgiSendOrder tag and customerLocation parameter.

Enter a "thank you" message to display to customers when they complete their order.
 
At any place on the order processing page, enter a beginning mgiSendOrder tag, handle parameter, shoppingBasketURL parameter, customerLocation parameter, to parameter, from parameter, mailServer parameter, subject parameter, and ending mgiSendOrder tag.
 
In the handle parameter, enter the name of the default handle you created in the shopping basket administration (i.e., "Posters"). In the shoppingBasketURL parameter, enter the full URL to the region where items were added to the shopping basket (and thus where the internal MGI shopping basket database was created and populated).
 
When implementing a tax rule, you must collect the customer's location(s) from their billing information and embed it in the customerLocation parameter of the mgiSendOrder parameter. For "chained" tax rules, embed a comma-delimited list of the customer's location from the top-level tax rule to the bottom-level tax rule. The location list must be in the same order as the tax rule chain. Create the comma-delimited list in a variable (using mgiSet) before the mgiSendOrder tag and embed the variable in the customerLocation parameter of the mgiSendOrder tag (using mgiGet). In this example, the customer's state and city are compiled in a variable and embedded in the customerLocation parameter.
 
In the "to" parameter, enter the email address to receive shopping basket orders. In the "from" parameter, enter the email address that appears in the "from" line of shopping basket orders. In the mailServer parameter, enter the address for the outgoing SMTP mail server of your domain (e.g., mail.domain.com). In the subject parameter, enter the subject of the order email. The mgiSendOrder tag does not display information to the customer.
 
The following is an example order processing page.
<center>

<h2>Order Complete</h2>

<p>Thank you for ordering.  Your order has been 
processed and you should receive the merchandise 
within 2 to 4 weeks.

<mgiSet name="locations">
<mgiPostArgument name="bSTATE">,<mgiPostArgument 
name="bCITY">
</mgiSet>

<mgiSendOrder handle="Posters"
shoppingBasketURL="http://www.domain.com/shop/" 
to="sales@domain.com" from="webmaster@domain.com" 
mailServer="mail.domain.com"
subject="Online Order" 
customerLocation={mgiGet name="locations"}>
</mgiSendOrder>

</center>
The default order email is formatted with payment, billing, shipping, and order information.
Payment Information
-------------------
 Payment Method:  Credit Card
           Type:  VISA
         Number:  1234657895641234
Expiration Date:  12/2004
           Name:  Glen Redding

Billing Information
-------------------
           Name:  Glen Redding
        Company:  Art Store
        Address:  1128 Main Street
           City:  Raleigh
          State:  North Carolina
       Zip Code:  27648
        Country:  US
          Phone:  919-265-4485
            Fax:  919-265-4486
          Email:  glen@artstore.net

Product Information
--------------------
       Quantity:  2
     Product ID:  GCL522
           Name:  Waterlilies
    Total Price:  $40.00
 
       Quantity:  1
     Product ID:  BV260
           Name:  Monets Bridge, Giverny
    Total Price:  $20.00
 
       Quantity:  2
     Product ID:  ARV759
           Name:  Sailboats at Argenteuil
    Total Price:  $24.00
 
       Quantity:  1
     Product ID:  GCM550
           Name:  The Starry Night
    Total Price:  $13.30
 
       Quantity:  1
     Product ID:  GCL641
           Name:  Composition No. 6
    Total Price:  $16.00
 
       Subtotal:  $113.30
            Tax:  $0.64
       Shipping:  $5.00
          Total:  $118.94

Step 24: Save the order processing page.

Save the changes you have made to the order processing page.

Step 25: Tokenize all pages of the web site.

The default shopping basket uses tokens to track the purchases of individual customers. Using a text editor, enter a beginning mgiToken tag and ending mgiToken tag on all additional pages of the web site. The mgiToken tags should enclose all links on the pages including HREFs and FORM actions.
<mgiToken>
All tags and links appear here.
</mgiToken>

Step 26: Save the web site pages.

Save the changes that you make as you tokenize each page.

Step 27: FTP all pages to the web server running MGI.

Upload all pages of the web site to the web server using an FTP program. If you are using a secure server, upload only the check out, order confirmation and order processing pages to the secure portion of your web site. Do not attempt to use the shopping basket page on a secure server.

Step 28: View a product page in a web browser and purchase a product.

View a product page in a web browser. Enter a quantity to purchase in the quantity text field and click the "Add to Shopping Basket" button. The item(s) appears in the shopping basket display on the shopping basket page. Click the "Check Out" button to proceed to the check out page. On the check out page, enter a payment choice, billing information and shipping information (if it is different). Click the "Confirm Order" button to proceed to the confirm order page. On the confirm order page, review your order, payment information, billing information and shipping information, then click the "Complete Order" button to complete the ordering process. The message from the order processing page is displayed and the shopping basket order is formatted and emailed.


[Return to the Shopping Online Menu]


[Understanding MGI Menu] [Using MGI Menu] [Referencing MGI Menu]


[MGI Guides Main Menu] [User Guide Main Menu]