Index: openacs-4/packages/ecommerce/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/index.tcl,v diff -u -r1.6.2.2 -r1.6.2.3 --- openacs-4/packages/ecommerce/www/index.tcl 23 Dec 2004 13:18:23 -0000 1.6.2.2 +++ openacs-4/packages/ecommerce/www/index.tcl 11 Jun 2005 05:39:51 -0000 1.6.2.3 @@ -4,7 +4,7 @@ @param usca_p @param how_many - @param start + @param start_row @author @creation-date @@ -15,7 +15,7 @@ } { usca_p:optional {how_many:naturalnum {[ad_parameter -package_id [ec_id] ProductsToDisplayPerPage ecommerce]}} - {start "0"} + {start_row "0"} } # see if they're logged in @@ -95,54 +95,58 @@ set count 0 # find all top-level products (those that are uncategorized) +db_1row get_tl_product_count " + select count(*) as product_count + from ec_products_searchable p left outer join ec_user_session_offer_codes o on (p.product_id = o.product_id and user_session_id = :user_session_id) + where not exists (select 1 + from ec_category_product_map m + where p.product_id = m.product_id)" db_foreach get_tl_products " select p.product_id, p.product_name, p.one_line_description, o.offer_code from ec_products_searchable p left outer join ec_user_session_offer_codes o on (p.product_id = o.product_id and user_session_id = :user_session_id) where not exists (select 1 from ec_category_product_map m where p.product_id = m.product_id) - order by p.product_name" { + order by p.product_name limit :how_many offset :start_row" { + append products " +