Index: openacs-4/packages/ecommerce/tcl/ecommerce-styles-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/Attic/ecommerce-styles-procs.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/tcl/ecommerce-styles-procs.tcl 20 Apr 2001 20:51:13 -0000 1.1 +++ openacs-4/packages/ecommerce/tcl/ecommerce-styles-procs.tcl 21 Feb 2002 21:07:15 -0000 1.2 @@ -36,24 +36,34 @@ eval "uplevel { ec_navbar \[subst \"$string\"\] }" } -ec_register_styletag "ec_footer" "insert the standard ecommerce section footer; the location parameter can be used to specify the current location, either \"Shopping Cart\" or \"Your Account\" or \"Home\", the category parameter can be used to specify the category that is selected in by default, and the text parameter can be used to specify the default search string." { +ec_register_styletag "ec_footer" "insert the standard ecommerce section footer; the location parameter can be used to specify the current location, either \"Shopping Cart\" or \"Your Account\" or \"Home\", the category and subcatory parameters can be used to specify the (sub)category that is selected in by default, and the text parameter can be used to specify the default search string." { upvar category_id category_id + upvar subcategory_id subcategory_id upvar search_text search_text if { ![info exists category_id] || $category_id == ""} { + ns_log debug "BART category_id does not exist or is empty" set category [ns_set get $tagset "category"] if {$category == ""} { set category_id "" } else { set category_id [db_string get_cat_id "select category_id from ec_categories where category_name = :category"] } } + if { ![info exists subcategory_id] || $subcategory_id == ""} { + set subcategory [ns_set get $tagset "subcategory"] + if {$subcategory == ""} { + set subcategory_id "" + } else { + set subcategory_id [db_string get_subcat_id "select subcategory_id from ec_subcategories where category_name = :subcategory"] + } + } if { ![info exists search_text] || $search_text == ""} { set search_text [ns_set get $tagset "text"] - } + } - ec_footer $string $category_id $search_text + ec_footer $string $category_id $subcategory_id $search_text } ec_register_styletag "ec_search" "insert the standard ecommerce search bar; the category parameter can be used to specify the category that is selected in by default, and the text parameter can be used to specify the default search string." {