|
|
|
Joined: 6/7/2010
Posts: 35
|
|
|
How are the product search results configured and can they be tweaked to include info that is in the product description in addition to the product name (i.e. author name in addition to book title)?
|
|
|
|
| |
|
|
|
Joined: 6/7/2010
Posts: 35
|
| |
| |
|
|
|
|
Joined: 3/11/2010
Posts: 1979
|
|
|
If you open up stored procedure "Smith_ListproductByFilter" and add the filter condition highlighted in yellow below it will search on product description:
ALTER procedure [dbo].[dnn_Smith_ListproductByFilter]
@Page int,
@RecsPerPage int,
@Filter varchar(50),
@searchText varchar(50) ,
@tabModuleId int,
@PortalId int
as
CREATE TABLE #TempItems
(
ProductAutoID int IDENTITY,
ProductID int
)
DECLARE @SearchSQL varchar(5000)
IF(@Filter='All')
SELECT @SearchSQL ='INSERT INTO #TempItems (ProductID) select p.ProductID from dnn_Smith_Products p
WHERE ( p.TabModuleId = ' + CAST ( @tabModuleId AS VARCHAR(10)) + ' OR p.Share = 1 ) AND p.modelName LIKE ''%'+ @searchText+'%'''
ELSE
SELECT @SearchSQL ='INSERT INTO #TempItems (ProductID) SELECT p.ProductID from dnn_Smith_Products p inner join '+
' dnn_Smith_CategoryProduct c ON '+
' c.ProductID=p.ProductID WHERE ( p.TabModuleId = ' + CAST ( @tabModuleId AS VARCHAR(10)) + ' OR p.Share = 1 ) AND c.CategoryID='''+@Filter+''' and p.modelName like ''%'+ @searchText+'%''' and p.description like ''%'+ @searchText+'%'''
--SET @SearchSQL = @SearchSQL + ' AND P.LogicallyDeleted !=''1'' AND Archived != 1 '
SET @SearchSQL = @SearchSQL + ' AND P.LogicallyDeleted !=''1'' AND Archived != 1 AND p.MasterBundleID = 0 order by P.SortOrder'
EXECUTE(@SearchSQL)
DECLARE @FirstRec int, @LastRec int
SELECT @FirstRec = (@Page - 1) * @RecsPerPage
SELECT @LastRec = (@Page * @RecsPerPage + 1)
SELECT *,TotalRecords=(
SELECT COUNT(*)
FROM #TempItems TI),
MoreRecords =
(
SELECT COUNT(*)
FROM #TempItems TI
WHERE TI.ProductAutoID >= @LastRec
)
FROM dnn_Smith_Products B (nolock) RIGHT OUTER JOIN
#TempItems T (nolock) ON B.ProductID = T.ProductID
WHERE ProductAutoID > @FirstRec AND ProductAutoID < @LastRec and b.PortalID = @PortalId
Order By B.SortOrder
Scott Kelly
Project Manager
|
|
|
|
| |
|
|
|
Joined: 6/7/2010
Posts: 35
|
|
|
This didn't work - any other suggestions?
|
|
|
|
| |
|
|
|
Joined: 7/28/2009
Posts: 1452
|
|
|
From the dnn - host - module definitions if you edit the productdetails user control and check the box for "iSearchable" it will make the product description searchable using the standard dnn search. We will look at this stored proc this week and see if we can tweek it to do a wild card search on the product description.
At your service,
Dave Smith
|
|
|
|
| |
|
|
|
Joined: 6/7/2010
Posts: 35
|
|
|
I don't see the check box for "iSearchable" in the module definitions area. The only check box I see there is for Supports Partial Rendering.
|
|
|
|
| |
|
|
|
|
Joined: 3/11/2010
Posts: 1979
|
|
|
Sorry about that it looks like we would need to program the isearchable into the module itself. I will send this into programming to see if they can implement the product description search.
-Scott
Scott Kelly
Project Manager
|
|
|
|
| |
|
|
|
Joined: 6/7/2010
Posts: 35
|
|
|
Thanks - what are the new updates in 2.94? Is the print invoice fixed to include any coupon discounts? Let me know and send me a link...
|
|
|
|
| |
|
|
|
|
Joined: 3/11/2010
Posts: 1979
|
| |
| |
|
|
|
Joined: 6/7/2010
Posts: 35
|
|
|
Ok, so what about the product search fix? Can you send me a DLL file or can you get that done in the next build as well?
|
|
|
|
| |
|
|
|
|
Joined: 3/11/2010
Posts: 1979
|
|
|
Changing the product search to search on product description will most likely just be a stored proc fix so no dll hotfix required.
-Scott
Scott Kelly
Project Manager
|
|
|
|
| |
|
|
|
Joined: 7/28/2009
Posts: 1452
|
|
|
I figured out how to change the stored procedure that allows filtering the product listing page by product name and/or description. If you modify the stored procedure "Smith_ListproductByFilter" and add the filter condition highlighted in yellow below it will search by keyword on model name and/or product description:
ALTER procedure [dbo].[dnn_Smith_ListproductByFilter]
@Page int,
@RecsPerPage int,
@Filter varchar(50),
@searchText varchar(50) ,
@tabModuleId int,
@PortalId int
as
CREATE TABLE #TempItems
(
ProductAutoID int IDENTITY,
ProductID int
)
DECLARE @SearchSQL varchar(5000)
IF(@Filter='All')
SELECT @SearchSQL ='INSERT INTO #TempItems (ProductID) select p.ProductID from dnn_Smith_Products p
WHERE ( p.TabModuleId = ' + CAST ( @tabModuleId AS VARCHAR(10)) + ' OR p.Share = 1 ) AND p.modelName LIKE ''%'+ @searchText+'%'' or p.description like ''%'+ @searchText+'%'''
ELSE
SELECT @SearchSQL ='INSERT INTO #TempItems (ProductID) SELECT p.ProductID from dnn_Smith_Products p inner join '+
' dnn_Smith_CategoryProduct c ON '+
' c.ProductID=p.ProductID WHERE ( p.TabModuleId = ' + CAST ( @tabModuleId AS VARCHAR(10)) + ' OR p.Share = 1 ) AND c.CategoryID='''+@Filter+''' and (p.modelName like ''%'+ @searchText+'%'' or p.description like ''%'+ @searchText+'%'')'
--SET @SearchSQL = @SearchSQL + ' AND P.LogicallyDeleted !=''1'' AND Archived != 1 '
SET @SearchSQL = @SearchSQL + ' AND P.LogicallyDeleted !=''1'' AND Archived != 1 AND p.MasterBundleID = 0 order by P.SortOrder'
EXECUTE(@SearchSQL)
DECLARE @FirstRec int, @LastRec int
SELECT @FirstRec = (@Page - 1) * @RecsPerPage
SELECT @LastRec = (@Page * @RecsPerPage + 1)
SELECT *,TotalRecords=(
SELECT COUNT(*)
FROM #TempItems TI),
MoreRecords =
(
SELECT COUNT(*)
FROM #TempItems TI
WHERE TI.ProductAutoID >= @LastRec
)
FROM dnn_Smith_Products B (nolock) RIGHT OUTER JOIN
#TempItems T (nolock) ON B.ProductID = T.ProductID
WHERE ProductAutoID > @FirstRec AND ProductAutoID < @LastRec and b.PortalID = @PortalId
Order By B.SortOrder
At your service,
Dave Smith
|
|
|
|
| |
|
|
|
Joined: 6/7/2010
Posts: 35
|
|
|
We did this and it works properly now but has somehow duplicated the number of search records (went from 1180 to 2360) even though there are only 1180 products still listed in the "Manage Products" section. Any idea how we can fix this?
|
|
|
|
| |
|
|
|
|
Joined: 3/11/2010
Posts: 1979
|
|
|
I just tested this on my test portal and I couldnt replicate the issue you reported. Are you sure you made the change to the stored proc correctly. Also you might want to try upgrading to the latest version 2.96 availible on the downloads page as we recently made a change to make the product list count start from a one instead of a zero and that may be related to the issue you are having.
-Scott
Scott Kelly
Project Manager
|
|
|
|
| |
|
|
|
Joined: 6/7/2010
Posts: 35
|
|
|
Just installed 2.96 and it's still got the same problem.
|
|
|
|