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 -r1.22.2.1 -r1.22.2.2 --- openacs-4/packages/ecommerce/tcl/ecommerce-procs.tcl 14 Nov 2004 11:02:50 -0000 1.22.2.1 +++ openacs-4/packages/ecommerce/tcl/ecommerce-procs.tcl 19 Dec 2004 11:06:33 -0000 1.22.2.2 @@ -1418,7 +1418,7 @@ db_dml insert_user_session $__sql - set cookie_name user_session_id + set cookie_name "user_session_id" set cookie_value $user_session_id set usca_p "t" @@ -1439,22 +1439,25 @@ # cookies haven't been set! visitor has been here # before previous attempt made - if {[string compare $_ec_cookie_requirement "cookies_are_required"] ==0} { - + if {[string compare $_ec_cookie_requirement "cookies_are_required"] == 0} { + + ns_log Notice "ec_create_new_session_if_necessary(ref 1): requested user to accept cookies." + ad_return_complaint 1 " You need to have cookies turned on so that we can remember what you have in your shopping cart. Please turn on cookies in your browser. - " } elseif {[string compare $_ec_cookie_requirement "cookies_are_not_required"] == 0} { # For this page continue - ns_log debug "ec_create_session cookies are off but that's okay, they aren't required" + ns_log Notice "ec_create_new_session_if_necessary: ec_create_session cookies are off but that's okay, they aren't required." } elseif {[string compare $_ec_cookie_requirement "shopping_cart_required"] == 0} { - + + ns_log Warning "ec_create_new_session_if_necessary(ref 2): requested user to accept cookies, nothing found in cart." + ad_return_error "No Cart Found" "
We could not find any shopping cart for you. This may be because you have cookies @@ -1534,3 +1537,17 @@ } +ad_proc ec_max_of_list { + listofargs +} { + finds max value from a list of values +} { + set args [split $listofargs] + set max [lindex $args 0] + foreach arg $args { + if { $arg > $max } { + set max $arg + } + } + return $max +}