Forums

[WP e-Commerce] Product Search Results (WORKING) (7 posts)

  1. elmediano
    Member
    Posted 8 months ago #

    Hey all,

    I'm building a shop for my mate's DIY shop and I'm using WP e-Commerce.

    I was quite shocked to see there wasn't a straight forward way to have a search results page. So after searching A LOT, I found a decent solution, which I'm very happy to be able to share here.

    Paste this code in your search.php between your DIVS:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    That produces an unordered list of products based on whatever you type in the standard WordPress search box. PLEASE NOTE this is not a unified search, although I think that by writing another QUERY below all this code you might be able to get results for normal WP posts. Haven't tried it but I will.

    I'm an not 100% sure who coded the above but I found it here: http://wpworks.wordpress.com/2011/08/25/wordpress-wp-ecommerce-search-page-with-related-products-hack/. The only problem with the code in that link (or at least for me) is that the Product Permalinks for each result weren't correct. In my version I cleaned up the code a little bit and changed the permalinks to work.

    For those who are using the Gold Cart plugin and want the Live Search results to work together with the ability to input text and hit enter, you need to go to the Gold Cart plugin folder and find the Live Search PHP file. There, locate the input and change the name and id to "s".

    If you have any questions feel free to ask and I'll try to help asap.

    Cheers

  2. elmediano
    Member
    Posted 8 months ago #

    Oops just realised the forum rules only let you paste up to 10 lines of code, so I have used Pastebin as requested:

    http://pastebin.com/8yFUFpCa

  3. shalu mall
    Member
    Posted 7 months ago #

    thanks......... a lot

  4. enkulu
    Member
    Posted 2 months ago #

    Hi

    If this works, then fantastic and thanks!
    But please could you clarify " between your DIVS"

    There are quite a few DIVS on that page.

    Thanks

  5. enkulu
    Member
    Posted 2 months ago #

    Not to worry I figured it out!

    Thanks your code worked great!

    Ciao.

  6. elmediano
    Member
    Posted 1 month ago #

    No worries. Glad it works for you guys!

  7. Sohd
    Member
    Posted 1 month ago #

    Hi,
    by any chance you mean the 'searchform.php'?
    I can find the 'search.php' in my theme folder.

    Maybe someone can give me some direction.
    (I am using the 'Basis Theme' with WP 3.3.2)

    Thanks!

Reply

You must log in to post.

About this Topic