Index: openacs-4/packages/ecommerce/ecommerce.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/ecommerce.info,v diff -u -r1.17 -r1.18 --- openacs-4/packages/ecommerce/ecommerce.info 31 Jan 2002 06:54:34 -0000 1.17 +++ openacs-4/packages/ecommerce/ecommerce.info 16 Feb 2002 23:32:06 -0000 1.18 @@ -753,6 +753,8 @@ + + @@ -831,6 +833,8 @@ + + @@ -890,6 +894,8 @@ + + @@ -955,6 +961,7 @@ + @@ -978,57 +985,57 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Index: openacs-4/packages/ecommerce/tcl/ecommerce-money-computations-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-money-computations-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/ecommerce/tcl/ecommerce-money-computations-procs.tcl 31 Jan 2002 22:43:54 -0000 1.3 +++ openacs-4/packages/ecommerce/tcl/ecommerce-money-computations-procs.tcl 16 Feb 2002 23:32:06 -0000 1.4 @@ -99,7 +99,7 @@ set reg_shipping [expr $weight * $weight_shipping_cost] } else { set reg_shipping 0 - } + } test [list bart tatyana] set total_shipping_cost $reg_shipping # see if we have to add something for express shipping @@ -122,7 +122,7 @@ # because they are constant, so I don't want to have to pull them from the database each # time (this procedure is called from within a loop) # For preconfirmed orders. -ad_proc ec_price_price_name_shipping_price_tax_shipping_tax_for_one_item { product_id offer_code item_id order_id shipping_method user_class_id_list default_shipping_per_item weight_shipping_cost add_exp_amount_per_item add_exp_amount_by_weight tax_rate shipping_p } { Returns price, price_name, shipping, price_tax, and shipping_tax (all in a list) for one item. } { +ad_proc ec_price_price_name_shipping_price_tax_shipping_tax_for_one_item { product_id offer_code item_id order_id {user_class_id_list {}} {shipping_method "no shipping"} {default_shipping_per_item 0} {weight_shipping_cost 0} {add_exp_amount_per_item 0} {add_exp_amount_by_weight 0} {tax_rate 0} {shipping_p "f"}} { Returns price, price_name, shipping, price_tax, and shipping_tax (all in a list) for one item. } { ## ## Part 1: Get Price & Price Name @@ -270,7 +270,4 @@ } return [list $total_price $total_shipping $gift_certificate_amount $total_tax] -} - - - +} \ No newline at end of file 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.9 -r1.10 --- openacs-4/packages/ecommerce/tcl/ecommerce-procs.tcl 31 Jan 2002 22:43:54 -0000 1.9 +++ openacs-4/packages/ecommerce/tcl/ecommerce-procs.tcl 16 Feb 2002 23:32:06 -0000 1.10 @@ -207,10 +207,10 @@ # current_location can be "Shopping Cart", "Your Account", "Home", or # any category_id -ad_proc ec_footer { {current_location ""} {category_id ""} {search_text ""} } { returns the ecommerce footer } { +ad_proc ec_footer { {current_location ""} {category_id ""} {subcategory_id ""} {search_text ""} } { returns the ecommerce footer } { set to_return "
-[ec_search_widget $category_id $search_text] " +[ec_search_widget "$category_id|subcategory_id" $search_text]" if { [string compare $current_location "Shopping Cart"] == 0 } { append to_return "Shopping Cart" } else { @@ -741,9 +741,14 @@ set linked_category_list "" set current_location [lindex $current_location 1] - foreach step {Welcome Address Verify Shipping Payment Confirm} { + set steps {"Select Address" "Verify Order"} + if { [ad_parameter -package_id [ec_id] ExpressShippingP ecommerce] } { + lappend steps "Select Shipping" + } + lappend steps "Payment Info" "Confirm Order" + foreach step $steps { set category_descriptions Checkout: - ns_log debug "ec_navbar $current_location ::: $step" + if {[string equal -nocase $current_location $step]} { lappend linked_category_list "$step" } else { @@ -1407,7 +1412,7 @@ ad_proc ec_get_user_session_id {} { Gets the user session from cookies } { set headers [ns_conn headers] set cookie [ns_set get $headers Cookie] - ns_log notice "cookie : $cookie" + # grab the user_session_id from the cookie if { [regexp {user_session_id=([^;]+)} $cookie match user_session_id] } { return $user_session_id Index: openacs-4/packages/ecommerce/tcl/ecommerce-utilities-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-utilities-procs.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/ecommerce/tcl/ecommerce-utilities-procs.tcl 31 Jan 2002 22:43:54 -0000 1.7 +++ openacs-4/packages/ecommerce/tcl/ecommerce-utilities-procs.tcl 16 Feb 2002 23:32:06 -0000 1.8 @@ -211,11 +211,17 @@ " } elseif { [file exists "$full_dirname/product.gif"] } { - set linked_thumbnail "" + set linked_thumbnail " + + + " } } else { - set linked_thumbnail "" + set linked_thumbnail " + + + " } } Index: openacs-4/packages/ecommerce/tcl/ecommerce-widgets-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/tcl/ecommerce-widgets-procs.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/ecommerce/tcl/ecommerce-widgets-procs.tcl 29 Jan 2002 00:11:46 -0000 1.11 +++ openacs-4/packages/ecommerce/tcl/ecommerce-widgets-procs.tcl 16 Feb 2002 23:32:06 -0000 1.12 @@ -8,34 +8,73 @@ @author ported by Jerry Asher (jerry@theashergroup.com) } -ad_proc ec_search_widget { {category_id ""} {search_text ""} } { creates an ecommerce search widget, using the specified category id and search text if necessary } { +ad_proc ec_search_widget { {combocategory_id ""} {search_text ""} } { creates an ecommerce search widget, using the specified category id and search text if necessary } { return "
-Search: [ec_only_category_widget "f" $category_id] +Search: [ec_combocategory_widget "f" $combocategory_id]
" } +ad_proc ec_combocategory_widget { {multiple_p "f"} {default ""} } { Category widget combining categories and subcategories } { + if { $multiple_p == "f" } { + set select_tag "\n" + } + set to_return "" + set category_counter 0 + set last_category_id "" + + # Get all categories and their subcategories + db_foreach get_combocategories "select s.category_id, s.subcategory_id, category_name, subcategory_name from ec_categories c, ec_subcategories s where c.category_id=s.category_id order by s.category_id, s.subcategory_id" { + + # There is at least one category. Open the select widget on the first pass of the foreach loop + if { $category_counter == 0} { + append to_return $select_tag + } + incr category_counter + if { $category_id != $last_category_id } { + set last_category_id $category_id + + # Check if the category has been selected. + if { [lsearch -exact $default "$category_id|"] != -1 || [lsearch -exact $default $category_name] != -1 } { + append to_return "" + } else { + append to_return "" + } + } + + # Check if the subcategory has been selected. + if { [lsearch -exact $default "$category_id|$subcategory_id"] != -1 || [lsearch -exact $default $subcategory_name] != -1 } { + append to_return "" + } else { + append to_return "" + } + } + if { $category_counter != 0 } { + append to_return "\n" + } + return $to_return +} + ad_proc ec_only_category_widget { {multiple_p "f"} {default ""} } { category widget } { if { $multiple_p == "f" } { - set select_tag "\n" } else { set select_tag "\n" } - set subcategory_counter 0 + set subcategory_counter 0 db_foreach get_subcats_by_name "select subcategory_id, subcategory_name from ec_subcategories where category_id=:category_id order by subcategory_name" { - - incr subcategory_counter - if { [string compare $default $subcategory_id] == 0 || [string compare $default $subcategory_name] == 0 } { append to_return "