if ( ! empty($pattern_info['cat_id'])) {
            $cat_ids = _class('cats')->_get_recursive_cat_ids($row_info['cat_id']);
            $where = ' AND (cat_id IN (' . implode(',', $cat_ids) . ') OR id IN (SELECT product_id FROM ' . db('shop_product_to_category') . ' WHERE category_id IN (' . implode(',', $cat_ids) . ')))';
        }