Products Page - List other Prods in Category

Store UI, layout, design, look and feel; Discussion on the customer facing pages of your online store. Cascading Style Sheets, Themes, Scriptlets, NVelocity and the components in the ConLib directory.
Post Reply
marlannak
Ensign (ENS)
Ensign (ENS)
Posts: 1
Joined: Wed Nov 17, 2010 2:43 pm

Products Page - List other Prods in Category

Post by marlannak » Thu Nov 18, 2010 6:10 am

Hey guys,

I feel like this is probably something that is in the Able Commerce code and I'm just missing it.

What I need to be able to do, is to have a listing of all other products within the same category search critieria show in the sidebar when the user is on the product display page. So if the user searches through category A and sub category 2 and finds a list of products, and selects one product to view the details of, I'd like to show them a listing of all other products within that same search they just performed in the side bar so that they can select another product without having to go back to the search page.

Any ideas?

Thanks,

Marla

User avatar
s_ismail
Commander (CMDR)
Commander (CMDR)
Posts: 162
Joined: Mon Nov 09, 2009 12:20 am
Contact:

Re: Products Page - List other Prods in Category

Post by s_ismail » Mon Nov 22, 2010 4:09 am

You can load other products like this

Code: Select all

int currentProductId=PageHelper.GetProductId();
        ProductCollection products = ProductDataSource.NarrowSearch("Search_Keyword","Category_Id",0,0,0);
        ProductCollection filteredProducts = new ProductCollection();
        foreach (Product product in products)
        {
            if (product.ProductId != currentProductId)
                filteredProducts.Add(product);
        }

        ProductRepeater.DataSoruce = filteredProducts;
        ProductRepeater.DataBind();

Post Reply