Index: openacs-4/packages/ecommerce/www/toolbar.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/Attic/toolbar.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/ecommerce/www/toolbar.tcl 13 Jan 2005 13:58:01 -0000 1.4 +++ openacs-4/packages/ecommerce/www/toolbar.tcl 24 Feb 2005 13:33:14 -0000 1.5 @@ -11,44 +11,37 @@ # @cvs-id $Id$ # @creation-date September 2002 -# Create empty lists for each optional parameter that has not been -# passed in. +# 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_categories "select 1 from dual where exists (select 1 from ec_categories)" -default ""]] } { + # Create a context aware search widget to search for products. -foreach parameter {category_id subcategory_id 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 {} } } - - -# Get the ecommerce package url - -set ecommerce_base_url [ec_url] - -# 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_categories "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 [ec_search_widget "$category_id|$subcategory_id" $search_text] } else { set ec_search_widget "" } - - # Determine the URLs to the Shopping Cart and store Account. +# Get the ecommerce package url +set ecommerce_base_url [ec_url] -# set ec_cart_link (ec_insecurelink (ad_parameter -package_id (ec_id) EcommercePath)shopping-cart) -# set ec_account_link (ec_insecurelink (ad_parameter -package_id (ec_id) EcommercePath)account) set ec_cart_link [ec_insecurelink [file join $ecommerce_base_url "shopping-cart"]] set ec_account_link [ec_insecurelink [file join $ecommerce_base_url "account"]] set ec_gift_cert_order_link [ec_insecurelink [file join $ecommerce_base_url "gift-certificate-order"]] # Get the name of the ecommerce package - set ec_system_name [ec_system_name] # Check if gift certificates can be bought. - set gift_certificates_are_allowed [ad_parameter -package_id [ec_id] SellGiftCertificatesP ecommerce] - -