GRD_PRODONE Grid Component

Purpose

The GRD_PRODONE grid component on the PRODUCTINFO.A5W page allows a customer to view the detailed description of a product before ordering it.  The customer can order a product by clicking the shopping cart image.

The GRD_PRODONE grid component [Picture]

Description

The GRD_PRODONE component is a read-only grid component based on a view that incorporates fields from the product and specials tables. The filter for the grid is passed to the PRODUCTINFO.A5W in the calling URL. Most of the controls on this component are freeform templates.

The grid has five calculated fields.

Special = if(Specials->Sale_Price > 0 .and. (cdate(Specials->Sale_Until) >= cdate(date()) .or. cdate(Specials->Sale_Until) = ""), "Special!", "")

Sale_Price = if(Specials->Sale_Price > 0 .and. (cdate(Specials->Sale_Until) >= cdate(date()) .or. cdate(Specials->Sale_Until) = ""), alltrim(str(Specials->Sale_Price, 10, 2, "$")), "")

regular = if(List=0, "", "Regular Price")

reg_price = if(List=0, "", alltrim(str(List, 12, 2, "$,")))

avail = if(Qty_In_Sto > 0, "In Stock!", "Available in " + Ship_Avail)

Containers

PRODUCTINFO.A5W

Notable Grid Control Property Settings

Control

Property

Description

Picture

Image Properties > Image Path

"[PathAlias.ADB_Path]"

Description

Column Properties > Hide column

"True"

Detail

Column Properties > Freeform layout

"True"

Column Properties > Freeform template

<p><br><h4><font color=#000080>{Description}</font></h4>

<p></p>

<p>{Detail}</p>

<p><strong><font

color=#ff0000>{Avail}</font>

</strong></p>

Regular

Column Properties > Hide column

"True"

Reg_Price

Column Properties > Hide column

"True"

Retail

Column Properties > Hide column

"True"

Special

Column Properties > Hide column

"True"

Sale_Price

Column Properties > Freeform layout

"True"

Column Properties > Freeform template

When the customer clicks the image, the script calls the add_to_cart() function, passing the product_id as a parameter.

<p><br><font size=1>

{Regular}<br>

{Reg_Price}</font>

</p>

<p><font size=2><strong><font color=#000080>

Our Price<br>

{Retail}</font>

</strong>

</font>

</p>

<p><font color=#ff0000 size=3><strong>{Special}<br>

{Sale_Price}</strong></font> </p>

<a onclick="add_to_cart('{Product_Id}')">

<img height=19 alt="Add to Shopping Cart" src="Images/add_cart_mini.png" width=19 border=0></a>

Product_Id

Column Properties > Hide column

"True"

Avail

Column Properties > Hide column

"True"

Notable Component Property Settings

Property

Description

Layout Options > Rows of data

1

See Also

Web Publishing Components

Supported By

Alpha Five Version 7 and Above