Index: openacs-4/packages/ecommerce/lib/searchbar-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/lib/searchbar-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/lib/searchbar-postgresql.xql 8 Aug 2008 12:36:51 -0000 1.1 @@ -0,0 +1,16 @@ + + + + + postgresql + 7.1 + + + + + select 1 where exists (select 1 + from ec_categories) + + + + Index: openacs-4/packages/ecommerce/lib/searchbar.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/lib/searchbar.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/lib/searchbar.adp 8 Aug 2008 12:36:51 -0000 1.1 @@ -0,0 +1,4 @@ +@ec_search_widget_fragment;noquote@ + + + Index: openacs-4/packages/ecommerce/lib/searchbar.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/lib/searchbar.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/ecommerce/lib/searchbar.tcl 8 Aug 2008 12:36:51 -0000 1.1 @@ -0,0 +1,30 @@ +# Display the ecommerce toolbar containing a product search widget + +# @param category_id +# @param subcategory_id +# @param search_text +# @current_location + +# Create empty values for each optional parameter that has not been passed from a master template. +foreach parameter {combocategory_id category_id subcategory_id search_text current_location} { + if {![info exists $parameter]} { + set $parameter {} + } +} + +# we'll show a search widget at the top if there are categories to search in +if { ![empty_string_p [db_string get_check_of_categories2 "select 1 from dual where exists (select 1 from ec_categories)" -default ""]] } { + # Create a context aware search widget to search for products. + + # Decode the combo of category and subcategory ids + if { ![empty_string_p $combocategory_id] } { + set category_id [lindex [split $combocategory_id "|"] 0] + set subcategory_id [lindex [split $combocategory_id "|"] 1] + } + set ec_search_widget_fragment [ec_search_widget "$category_id|$subcategory_id" $search_text] +} else { + set ec_search_widget_fragment "" +} + + +