Results 1 to 2 of 2

Thread: Admin product related products helper search by SKU

  1. #1
    Join Date
    Jan 2007
    Posts
    98

    Default Admin product related products helper search by SKU

    In a similar vein to modifying the product search to search for SKU as well as name the other place where this is useful is in the related/upsell/required products helper in th e product admin pop up.

    This is run from an xml package and is a quick fix. In your admin/xmlpackages directory find the ajax.CSVHelper.xml.config file. At the top of the file change the products search sql to the following:

    Code:
            declare @searchlength int
            set @searchlength = len(@SearchTerm)
            select top 5 ProductID as ID, Name, Deleted, Published, 0 as InList
            from product
            where 
            (@searchlength > 2 and (@SearchTerm != '' and (name like '%' + @SearchTerm + '%') or (sku like '%' + @SearchTerm + '%') and deleted = 0 and published = 1))
            and not(@CSVList like '%,'+convert(nvarchar(10),ProductID)+',%')
            order by name
    It Works For Me. I also edited it to return more than 5 products (but not in the above code) so i can keep a wide search.

    Instant productivity boost!

  2. #2
    Join Date
    Jun 2007
    Location
    West Memphis
    Posts
    26

    Default

    Just implemented this. 2 minute fix for a problem that's been bugging me! Thank you for sharing

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •