[Previous] [Contents] [Next]
Displaying Search Results
Now that you've seen how to set up the search pages, you need to figure out how to display the results from the search operation. To display results, you need a few more MiniVend tags that enable you to display a list of items. This page, coded in Listing 13.4, can be kept fairly generic as you will see. Most of the text on the page is filled in by MiniVend based on the contents of your product database.
Listing 13.4. The results display page.
Matches [matches] of
<TH>Item #</TH><TH>Description</TH><TH></TH><TH></TH><TH>Everyday Low Price</TH>
<TD><B>Our Everyday Low Price $[item-price]</B><p></TD>
<B>There's even more to choose from!:</B><BR>
<TD>[page browse]Browse by Category[/page]</TD>
The first tag that needs explanation here is the
[finish-order] tag. This tag inserts a link to the order page, giving the customer a quick way to place his or her order. If no items are in the customer's shopping cart, this tag is ignored. Another interesting tag in this page is
[more-list]. This tag directly relates to the
mv_matchlimit of the previous page. It provides the user with a scrollable list of items. Of course, this list comes into play only if the
mv_matchlimit value is exceeded. The
[matches] tag displays the current range the customer is viewing. If you've done any kind of Web searching, you should already be familiar with this concept.
After displaying the number of items found using the
[value] tag along with the
mv_search_match_count variable, you begin listing the items by using the
[search-list] tag. Once inside the
[search-list], you can represent each item in any way that HTML allows. One of the best ways to display this type of list is to use a table, as done in Listing 13.4.
[item-increment] specifies the index number of the item within the search results.
[item-description] displays the item's Description field value from your product database.
[item-link] provides a quick link to more information about that item. The way this link works is pretty cool. You can create a page called
flypage.html, which will be the template for generating this page on the fly from the information in your database. The next column gives the user a link to be able to order the item. It uses the
[order] tag together with the
[item-code] tag. The
[order] tag provides a link to the order page, enabling the user to place his or her order. The
[item-code] is a necessary parameter to the
[order] tag, which is extracted from the product database. This parameter tells MiniVend which item is being ordered. The last tag within the search list is
[item-price], which, of course, displays the price of the item as listed in the product database. Figure 13.4 shows search results using a textual search on the database, and Figure 13.5 shows results using a category search.
Figure 13.4. The search results from a textual search.
Figure 13.5. The search results from a category search.
You are now close to finished with your shopping site. The last major page to define is your order page. On this page, you specify what information you want to obtain from the customers when they place their orders and get information about items in their virtual shopping carts.
[Previous] [Contents] [Next]