Download webEdition Shop Module

Transcript
Designing a template for the Shop Module 51
4.4 Making a shopping cart
In order to make a shopping cart for your Web site, you must use a webEdition list with
the following we:tag:
<we:repeatShopItem
shopname="shopname">.........</we:repeatShopItem>
Below is an extended example:
<we:createShop shopname="shopers"/><we:addDelShopItem
shopname="shopers"/>
<!—Begin header -->
<table width="100%" border="0">
<tr bgcolor="silver">
<td>Item</td>
<td width="50">Number</td>
<td>Price</td>
<td>Total price</td>
</tr>
<!-- End header -->
<!-- Begin article listing -->
<we:repeatShopItem shopname="shopers">
<tr>
<td class="normal" bgcolor="white"><table
border="0"><tr><td><we:field
name="Bild" type="img" hyperlink="on" border="0" height="30"
width="30"
align="top"/>
</td><td><b><we:field name="Title" alt="we_path"
hyperlink="on"/></b><br><we:field name="Description" alt="we_text"
max="200"/></td>
</tr>
</table>
<!-- Begin possible orders -->
<td align="center"><we:showShopItemNumber
shopname="shopers"/><br>[
<we:a id="148" shop="on" amount="1">+1</we:a>
|<we:a id="148" shop="on" amount="-1">-1</we:a>]</td>
<td></td>
<td align="right">EURO <we:calculate
sum="waren"><we:showShopItemNumber
shopname="shopers">*<we:field name="Price"/></we:calculate></td>
</td>
<!-- End possible orders -->
</tr>
</we:repeatShopitem>
<!—End article listing -->
<tr><td colspan="4"></td></tr>
<tr bgcolor="silver"><td colspan="3">total:</td><td align="right">
EURO <we:sum name="waren"/>
</td></tr>
</table>
The amount attribute is a further enhancement of the <we:a> tag. Here we are using it
in the form:
<we:a id="148" shop="on" amount="5">+five</we:a>
The ID listed is the next page is the same as the calling page in this example. The shop
attribute specifies that this is a Shop function. The amount attribute provides a link that
increases the item number (we:shopItemNumber) by five. Another way to allow
shoppers to change the item quantity is by including select boxes, as shown in the
following example:
<!-- Begin possible orders -->
Shop Module