The mgiSBQuantity Tag

Tag Behavior

The mgiSBQuantity tag creates a quantity text box or checkbox that adds products to a database-driven shopping basket.

Tag Syntax

The mgiSBQuantity tag has 2 required parameters and 5 optional parameters. The tag form is:

<mgiSBQuantity name="Name" productID="ProductID"
units="Multiplier" fieldSize="Number"
singleItemCheckbox="Yes/No" defaultValue="Integer" hidden="Yes/No">

Required Parameters:

  • name="Name" where "Name" is the unique name of the mgiSBQuantity tag. This name is used only by MGI and is not visible to visitors.
  • productID="ProductID" where "ProductID" is the unique product identification of the product in the shopping basket.

Optional Parameters:

  • units="Multiplier" where "Multiplier" is a number which multiplies by the single-unit price of a product (e.g. the pricing scheme is listed per item, but products are only sold as a case of 12. In this example, when a web site visitor enters a quantity of "1" case, the units multiplier of "12" gives the correct price in the shopping basket). The default is "1".
  • fieldSize="Number" where "Number" is the size of the quantity field in characters. The default field size is 6 characters.
  • singleItemCheckbox="Yes" or "No" where "Yes" indicates that a single-item checkbox rather than a text field appears at the location of the mgiSBQuantity tag and where "No" indicates that a text field appears at the location of the mgiSBQuantity tag. The default is "No". When an item is added to a shopping basket using a checkbox, a quantity of one for the specified product is added to the shopping basket
  • defaultValue="Integer" where "Integer" is a default whole number that appears in the quantity field that is displayed by the mgiBuyMe tag. If the quantity box is hidden, the default value is added to the shopping basket for the product. If the defaultValue parameter is not included, the quantity field is empty.
  • hidden="Yes" or "No" where "Yes" indicates that the quantity field is hidden and "No" indicates that the quantity field is displayed. If the quantity field is hidden, a default value of "1" is added to the shopping basket. Unless the singleItemCheckbox parameter is included, the default value of the hidden field can be customized with the defaultValue parameter.

Example Usage and Output

<mgiSBQuantity name="unitQuantity" 
productID="<mgiGet name="Product ID">" 
units="1" fieldSize="4" singleItemCheckbox="No">

In this example, the quantity box is 4 characters in length and appears as a text field. The productID is entered in mgiSBQuantity dynamically from the "Product ID" database field.

Suggested Usage

  • Database-Driven Shopping Basket

[Return to the Referencing MGI Menu]

[User Guide Main Menu] [Understanding MGI Menu] [Using MGI Menu] [Referencing MGI Menu]