Index: openacs-4/packages/ecommerce/tcl/ecommerce-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-procs.tcl,v diff -u -N -r1.2 -r1.3 --- openacs-4/packages/ecommerce/tcl/ecommerce-procs.tcl 15 Jul 2001 05:47:18 -0000 1.2 +++ openacs-4/packages/ecommerce/tcl/ecommerce-procs.tcl 18 Jul 2001 18:19:01 -0000 1.3 @@ -212,7 +212,7 @@ # current_location can be "Shopping Cart", "Your Account", "Home", or # any category_id -proc ec_footer { {current_location ""} {category_id ""} {search_text ""} } { +ad_proc ec_footer { {current_location ""} {category_id ""} {search_text ""} } { returns the ecommerce footer } { set to_return "
[ec_search_widget $category_id $search_text] " @@ -250,7 +250,7 @@ } # For administrators -proc ec_shipping_cost_summary { base_shipping_cost default_shipping_per_item weight_shipping_cost add_exp_base_shipping_cost add_exp_amount_per_item add_exp_amount_by_weight } { +ad_proc ec_shipping_cost_summary { base_shipping_cost default_shipping_per_item weight_shipping_cost add_exp_base_shipping_cost add_exp_amount_per_item add_exp_amount_by_weight } { returns cost summary } { set currency [util_memoize {ad_parameter -package_id [ec_id] Currency ecommerce} [ec_cache_refresh]] @@ -301,7 +301,7 @@ } # for one product, displays the sub/sub/category info in a table. -proc_doc ec_category_subcategory_and_subsubcategory_display { category_list subcategory_list subsubcategory_list } "Returns an HTML table of category, subcategory, and subsubcategory information" { +ad_proc ec_category_subcategory_and_subsubcategory_display { category_list subcategory_list subsubcategory_list } "Returns an HTML table of category, subcategory, and subsubcategory information" { if { [empty_string_p $category_list] } { return "None Defined" @@ -364,13 +364,13 @@ return $to_return } -proc ec_product_name_internal {product_id} { +ad_proc ec_product_name_internal {product_id} { returns product name } { return [db_string product_name_select { select product_name from ec_products where product_id = :product_id } -default ""] } -proc_doc ec_product_name {product_id {value_if_not_found ""}} "Returns product name from product_id, memoized for efficiency" { +ad_proc ec_product_name {product_id {value_if_not_found ""}} "Returns product name from product_id, memoized for efficiency" { # throw an error if this isn't an integer (don't want security risk of user-entered # data being eval'd) validate_integer "product_id" $product_id @@ -382,12 +382,13 @@ } } -# given a category_id, subcategory_id, and subsubcategory_id -# (can be null), displays the full categorization, e.g. -# category_name: subcategory_name: subsubcategory_name. -# If you have a subcategory_id but not a category_id, this -# will look up the category_id to find the category_name. -proc ec_full_categorization_display { {category_id ""} {subcategory_id ""} {subsubcategory_id ""} } { +ad_proc ec_full_categorization_display { {category_id ""} {subcategory_id ""} {subsubcategory_id ""} } { +given a category_id, subcategory_id, and subsubcategory_id +(can be null), displays the full categorization, e.g. +category_name: subcategory_name: subsubcategory_name. +If you have a subcategory_id but not a category_id, this +will look up the category_id to find the category_name. +} { if { [empty_string_p $category_id] && [empty_string_p $subcategory_id] && [empty_string_p $subsubcategory_id] } { return "" } elseif { ![empty_string_p $subsubcategory_id] } { @@ -427,7 +428,10 @@ # subcategory/subsubcategory a product is in. # If the product is multiply categorized, this will just use the first categorization that # Oracle finds for this product. -proc ec_mailing_list_link_for_a_product { product_id } { +ad_proc ec_mailing_list_link_for_a_product { product_id } { +returns a link for the user to add him/herself to the mailing list for whatever category/subcategory/subsubcategory a product is in. +If the product is multiply categorized, this will just use the first categorization that Oracle finds for this product. +} { set category_id "" set subcategory_id "" set subsubcategory_id "" @@ -463,18 +467,19 @@ } } -proc ec_space_to_nbsp { the_string } { +ad_proc ec_space_to_nbsp { the_string } { converts space to html nbsp } { regsub -all " " $the_string "\\ " new_string return $new_string } -# Given a product's rating, if the star gifs exist, it will -# print out the appropriate # (to the nearest half); otherwise -# it will just say what the rating is (to the nearest half). -# The stars should be in the subdirectory /graphics of the ecommerce -# user pages and they should be named star-full.gif, star-empty.gif, -# star-half.gif -proc ec_display_rating { rating } { +ad_proc ec_display_rating { rating } { +Given a product's rating, if the star gifs exist, it will +print out the appropriate # (to the nearest half); otherwise +it will just say what the rating is (to the nearest half). +The stars should be in the subdirectory /graphics of the ecommerce +user pages and they should be named star-full.gif, star-empty.gif, +star-half.gif +} { set double_ave_rating [expr $rating * 2] set double_rounded_rating [expr round($double_ave_rating)] set rating_to_nearest_half [expr double($double_rounded_rating)/2] @@ -527,7 +532,7 @@ return $rating_to_print } -proc ec_product_links_if_they_exist { product_id } { +ad_proc ec_product_links_if_they_exist { product_id } { return product links } { set to_return "

We think you may also be interested in: