GRD_PRODS Grid Component
Purpose
The GRD_PRODS grid component displays an alphabetical list of products. The customer can order a product by clicking the shopping cart image.

The GRD_PRODS grid component [Picture]
Description
The GRD_PRODS component is a read-only grid based on a view incorporating fields from the product, product_category, and specials tables. GRD_PRODS has a search section that is not shown when the component is placed on the page. We created it to establish the proper HTML for the search that is later added to various pages.
The grid has a calculated field.
Sale_Price = if(Specials->Sale_Price> 0 .and. (cdate(Specials->Sale_Until) >= cdate(date()) .or. cdate(Specials->Sale_Until) = ""), alltrim(str(Specials-> Sale_Price, 25, 2, "$")), "") |
Containers
INDEX.A5W, PRODUCTINFO.A5W, PRODUCTLIST.A5W, SHOPCART.A5W, SPECIALS.A5W
Notable Grid Control Property Settings
Control |
Property |
Description |
Product_Id |
Column Properties > Hide column |
"True" |
Thumb |
Image Properties > Image path |
"[PathAlias.ADB_Path]" |
Description |
Display Settings > Control type |
"Link" |
Link Properties > Display what in link |
"Value in Field" | |
Link Properties > Link address type |
"Computed from fields in the grid" | |
Link Properties > Link address |
Opens the PRODUCTINFO.A5W page and displays the data that matches product_id. productinfo.a5w?pid={Product_Id} | |
List |
Display Settings > Display format |
if(<value>=0, "", alltrim(str(<value>, 25, 2, "$"))) |
Retail |
Display Settings > Display format |
if(<value>=0, "", alltrim(str(<value>, 25, 2, "$"))) |
Cart |
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. <a onclick="add_to_cart('{Product_Id}')"><img height=19 alt="Shopping Cart" src="Images/add_cart_mini.png" width=19 border=0></a> |
See Also
Supported By
Alpha Five Version 7 and Above