Index: openacs-4/packages/ecommerce/www/category-browse.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/category-browse.tcl,v diff -u -r1.17 -r1.18 --- openacs-4/packages/ecommerce/www/category-browse.tcl 11 Aug 2008 13:01:09 -0000 1.17 +++ openacs-4/packages/ecommerce/www/category-browse.tcl 12 Aug 2008 12:23:58 -0000 1.18 @@ -6,7 +6,7 @@ @param subcategory_id The ID of the subcategory @param subsubcategory_id The possible ID of any subsubcategory @param how_many How many products to display on the page - @param start Where to begin from + @param start_row Where to begin from @param usca_p User session begun or not @author @@ -19,7 +19,7 @@ subcategory_id:optional,naturalnum subsubcategory_id:optional,naturalnum {how_many:naturalnum {[ad_parameter -package_id [ec_id] ProductsToDisplayPerPage ecommerce]}} - {start:naturalnum "1"} + {start_row:naturalnum "1"} usca_p:optional } @@ -68,7 +68,7 @@ # want their offer price # 4. Log this category_id into the user session -ec_create_new_session_if_necessary [export_url_vars category_id subcategory_id subsubcategory_id how_many start] cookies_are_not_required +ec_create_new_session_if_necessary [export_url_vars category_id subcategory_id subsubcategory_id how_many start_row] cookies_are_not_required # this is expensive - do we really need to log this every time? can we write to a file for batched reading later? if { [string compare $user_session_id "0"] != 0 } { @@ -177,15 +177,15 @@ } -# what if start is < how many? shouldn't happen I guess... -if { $start >= $how_many } { - set prev_url [export_vars -base [ad_conn url] -override {{start {[expr $start - $how_many]}}} {category_id subsubcategory_id how_many}] +# what if start_row is < how many? shouldn't happen I guess... +if { $start_row >= $how_many } { + set prev_url [export_vars -base [ad_conn url] -override {{start_row {[expr $start_row - $how_many]}}} {category_id subsubcategory_id how_many}] } -set how_many_more [expr ${products:rowcount} - $start - $how_many + 1] +set how_many_more [expr ${products:rowcount} - $start_row - $how_many + 1] if { $how_many_more > 0 } { - set next_url [export_vars -base [ad_conn url] -override {{start {[expr $start + $how_many]}}} {category_id subsubcategory_id how_many}] + set next_url [export_vars -base [ad_conn url] -override {{start_row {[expr $start_row + $how_many]}}} {category_id subsubcategory_id how_many}] if { $how_many_more >= $how_many } { set how_many_next $how_many @@ -194,7 +194,7 @@ } } -set end [expr $start + $how_many - 1] +set end [expr $start_row + $how_many - 1] #============================== # subcategories