Index: openacs.org-dev/packages/ecommerce/tcl/ecommerce-scheduled-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs.org-dev/packages/ecommerce/tcl/ecommerce-scheduled-procs.xql,v diff -u -r1.1.1.1 -r1.1.1.2 --- openacs.org-dev/packages/ecommerce/tcl/ecommerce-scheduled-procs.xql 9 Jul 2002 17:35:05 -0000 1.1.1.1 +++ openacs.org-dev/packages/ecommerce/tcl/ecommerce-scheduled-procs.xql 8 Oct 2002 15:47:06 -0000 1.1.1.2 @@ -4,23 +4,25 @@ - select product_id from ec_products + select product_id from ec_products where active_p = 't' select i2.product_id as correlated_product_id, count(*) as n_product_occurrences - from ec_items i2 + from ec_items i2, ec_products p where i2.order_id in (select o2.order_id from ec_orders o2 where o2.user_id in (select user_id from ec_orders o where o.order_id in (select i.order_id from ec_items i where product_id = :product_id))) - and i2.product_id <> :product_id + and i2.product_id = p.product_id + and p.active_p = 't' + and i2.product_id <> :product_id group by i2.product_id order by n_product_occurrences desc