What I have done:
- Modified dbo.nopCommerce > Stored Procedures > dbo.ProductLoadAllPaged
- Upon finishing the modification, I executed the query (to update the Stored Prodcedure)
- Cleared the store's cache and restarted the application to ensure changes made it to the site
My changes to dbo.ProductLoadAllPaged:
https://gist.github.com/DerekFoulk/afe92591ad72d63f5abaee85ba55b45b
Summary of changes:
- Added '@SearchManufacturer' variable (bit - default = 0)
- Set '@SearchManufacturer = 1' on line 66
- Added the following 'UNION' on line 266:
IF @SearchManufacturer = 1
BEGIN
SET @sql = @sql + '
UNION
SELECT pmm.ProductId
FROM Manufacturer m with (NOLOCK)
JOIN Product_Manufacturer_Mapping pmm with (NOLOCK)
ON pmm.ManufacturerId = m.Id
WHERE '
IF @UseFullTextSearch = 1
--Toggle the below lines if you index these tables (Full-Text)
--SET @sql = @sql + 'CONTAINS(m.[Name], @Keywords) '
SET @sql = @sql + 'PATINDEX(@Keywords, m.[Name]) > 0 '
ELSE
SET @sql = @sql + 'PATINDEX(@Keywords, m.[Name]) > 0 '
END
The above query returns the expected 'ProductId's when ran separately (from the Stored Procedure). Also, the search runs without throwing any exceptions. So, not sure what the problem is... Any help would be greatly appreciated!