Bestsellers


The Bestseller feature is usually similar to the Specials feature (see Figure 7.4). Whereas specials are items you want to promote (typically because of reduced prices or other promotions), bestsellers are products that you sell a lot ofand that's exactly the reason you want to call your customers' attention to them. Bestsellers are usually not as important as specials; therefore, their placement is normally not as prominent. Bestsellers can appear in various locations on the home page depending on the design of the store. For most stores, a narrow column along the right side of the home page works well for this purpose. To see an example, go to www.notetools.com.

Figure 7.4. Bestsellers advanced feature.


Setting up the bestsellers is a task with two main parts: identifying and listing the bestsellers, and showing them on the home page. Identifying the bestsellers is very similar to identifying specials. You need a field like the Specials property of the home page. Because the bestsellers will most likely be displayed on the home page only, you can add a new property called bestseller of type references to the home page. To mark an item as a bestseller, simply enter its ID into this new Bestseller box while editing the home page. As in the case of the specials, you can enter the IDs of multiple bestsellers into the Bestsellers box. Multiple IDs must be separated by spaces.

To show the bestsellers, you need a template that will create the thumbnails and links for the bestsellers, and then you need to place this template on the home page. The template that creates the bestseller thumbnails, show-bestsellers, is listed next. For each bestseller, it shows the thumbnail of the bestseller, the name (or label) of the bestseller, and its price. It also hyperlinks both the thumbnail and the name to the bestseller's page:

Show-bestsellers () TABLE border 0       cellspacing 0       cellpadding 0       width "100%"   TABLE-ROW valign :top     TABLE-CELL align :center     TEXT-STYLE :bold       TEXT "BESTSELLERS"    LINEBREAK number 2    FOR-EACH-OBJECT @bestsellers      FONT size 2           face @text-font        WITH-LINK TO WHEN @template                        id          WHEN IF test @icon                   then @icon                   else @image            IMAGE source RENDER image IF test @icon                                           then @icon                                           else @image                                 max-height WITH-OBJECT :index                                               @thumb-height                                 max-width WITH-OBJECT :index                                              @thumb-width                   hspace 3                   alt @name             LINEBREAK         FOR-EACH-BUT variable line                       sequence LINES IF test NONEMPTY @label                                          then @label                                          else @name                        last LINEBREAK            TEXT line         WITH= variable price                value OR                        @sale-price                        @price           WHEN price             LINEBREAK             FONT size 2                   color @emphasis-color                   face @text-font               TEXT PRICE number ELEMENT position 0                                           sequence price                           currency @currency      LINEBREAK number 2 


A number of small details require further explanation:

  • Notice how the thumbnail is created. First, if the item has an icon, it is used as the thumbnail; otherwise, it is the image. The maximum size of the thumbnails is determined by the thumb-width and thumb-height variables as defined on the home page. That's what the WITH-OBJECT:index business is about. There, you take the value of the thumb-width and thumb-height variables from the home page. Without that (if you simply used thumb-width or thumb-height), your bestseller list could end up with various thumbnail sizes if either of these variables was overridden for any of the bestsellers.

  • The way the hyperlink is created (the WITH-LINK TO... part) might seem a bit strange, but here is what's going on: You want to hyperlink to the bestseller only if the bestseller has a page to hyperlink to. Every item in a Yahoo! store that has a page also has a template. Conversely, if an item has no template (if its template is nil), the item has no page generated for it.

  • I use either the label property (if provided) or the name property to show the title of the bestseller. That's what the IF test NONEMPTY @label expression does. This way, you can have different text appear for the bestseller on the home page than on the bestseller's own page. This can come handy if the name of the item is too long.

  • Finally, you can simplify the way prices are displayed. Show the base of either the sale price or the regular price. Don't worry about quantity pricing here, although you can change this if you need to show quantity discounts.

Now that you have a way to display the bestseller block, you need to add it to the home page. You can do this by modifying the copy of the home. template. Where you modify the template depends on the style of your home page: whether it uses top buttons or side buttons. The side button arrangement is easier. In this arrangement, you can simply add a new table cell before the part dealing with RIGHT-MODULES (this section is at the end of the page-body template in the old Yahoo! Store Editor, but it is missing from the new editor) and then call your show-bestsellers template. The entire cell is within a WHEN @bestsellers block so that you show the bestseller block if there are bestsellers to be shown. The relevant part of the template is listed here:

   :side-buttons    TABLE border 0           cellspacing 0          cellpadding 0      TABLE-ROW valign :top        CALL :yourstoreid-side-nav           vnav        TABLE-CELL          FONT size @text-size               face @text-font            WITH= variable wid                  value (@page-width - 26) - vnav-wid             CALL :yourstoreid-home-body               nil               nil                 wid        WHEN @bestsellers          TABLE-CELL           CALL :show-bestsellers   WHEN @right-modules     TABLE-CELL width 10       SHIM height 1            width 10     TABLE-CELL valign :top                 width 150       CALL :yourstoreid-right-modules         @right-modules 


If the store has a top navigation bar, adding the bestseller box is a little trickier. In this case, you want to put the entire page inside the left cell of a table, and put the call to show-bestsellers in the right cell of the same table.




Succeeding At Your Yahoo! Business
Succeeding At Your Yahoo! Business
ISBN: 0789735342
EAN: 2147483647
Year: N/A
Pages: 208

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net