Index: openacs-4/packages/ecommerce/www/category-browse.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/ecommerce/www/category-browse.xql,v diff -u -r1.1 -r1.2 --- openacs-4/packages/ecommerce/www/category-browse.xql 10 Jul 2001 20:42:02 -0000 1.1 +++ openacs-4/packages/ecommerce/www/category-browse.xql 26 May 2002 04:36:50 -0000 1.2 @@ -1,86 +1,86 @@ + - - - select first_names || ' ' || last_name from cc_users where user_id=:user_id - - + + + select first_names || ' ' || last_name + from cc_users + where user_id=:user_id + + - - - - insert into ec_user_session_info (user_session_id, category_id) values (:user_session_id, :category_id) - - + + + insert into ec_user_session_info + (user_session_id, category_id) + values + (:user_session_id, :category_id) + + - - - - select category_name from ec_categories where category_id=:category_id - - + + + select category_name + from ec_categories + where category_id=:category_id + + - - - - select subcategory_name from ec_subcategories where subcategory_id=:subcategory_id - - + + + select subcategory_name + from ec_subcategories + where subcategory_id=:subcategory_id + + - - - - select subsubcategory_name from ec_subsubcategories where subsubcategory_id=:subsubcategory_id - - + + + select subsubcategory_name + from ec_subsubcategories + where subsubcategory_id=:subsubcategory_id + + - - - - select - p.product_name, p.product_id, p.dirname, r.recommendation_text -from ec_products_displayable p, ec_product_recommendations r -where p.product_id = r.product_id -and r.${sub}category_id=:${sub}category_id -and r.active_p='t' -and (r.user_class_id is null or r.user_class_id in - (select user_class_id - from ec_user_class_user_map m - where user_id=:user_id - $user_class_approved_p_clause)) -order by p.product_name - - + + + select p.product_id, p.product_name, p.dirname, r.recommendation_text, o.offer_code + from ec_product_recommendations r, + ec_products_displayable 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 p.product_id = r.product_id + and r.${sub}category_id=:${sub}category_id + and r.active_p='t' + and (r.user_class_id is null or r.user_class_id in (select user_class_id + from ec_user_class_user_map m + where user_id=:user_id + $user_class_approved_p_clause)) + order by p.product_name + + - - - - select p.product_id, p.product_name, p.one_line_description -from ec_products_searchable p, $product_map($sub) m -where p.product_id = m.product_id -and m.${sub}category_id = :${sub}category_id -$exclude_subproducts -order by p.product_name + + + select p.product_id, p.product_name, p.one_line_description, o.offer_code + from $product_map($sub) m, 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 p.product_id = m.product_id + and m.${sub}category_id = :${sub}category_id + $exclude_subproducts + order by p.product_name + + - - + + + select * from ec_sub${sub}categories c + where ${sub}category_id = :${sub}category_id + and exists (select 'x' + from ec_products_displayable p, $product_map(sub$sub) s + where p.product_id = s.product_id + and s.sub${sub}category_id = c.sub${sub}category_id) + order by sort_key, sub${sub}category_name + + - - - - -SELECT * from ec_sub${sub}categories c - WHERE ${sub}category_id = :${sub}category_id - AND exists ( - SELECT 'x' from ec_products_displayable p, $product_map(sub$sub) s - where p.product_id = s.product_id - and s.sub${sub}category_id = c.sub${sub}category_id - ) - ORDER BY sort_key, sub${sub}category_name - - - - -