Please help me remove featured Products

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 years ago
Hi Guys

I want to make my home page the shop and not featured products because I am using the Ajax filter.

For now all products are the same thing (t-shirts) and they all fall into different Prices and Specifications.
But none are featured.

On my home page I want all the products and the user can choose using the filter what to display.

How do I go about achieving this? Keep in mind that I have the Ajax filter working but it doesn’t work with the featured products.

Thank you for the help.

Regards
Craig
11 years ago
Craig Meyer wrote:
Hi Guys

I want to make my home page the shop and not featured products because I am using the Ajax filter.

For now all products are the same thing (t-shirts) and they all fall into different Prices and Specifications.
But none are featured.

On my home page I want all the products and the user can choose using the filter what to display.

How do I go about achieving this? Keep in mind that I have the Ajax filter working but it doesn’t work with the featured products.

Thank you for the help.

Regards
Craig


Customization needed. You need to create a new action that'll return the products (in a pre-determined order). You can have a look at ~/newproducts and see how it is implemented. :D
11 years ago
Thanx Mr woon

Could you explain in more detail please. I am not a java coder or what ever nopCommerce uses. I can only use html and css.

Regards
Craig
11 years ago
From what I understand is that you want to display each and every product on the home page without ticking the checkbox for Show Product on Homepage.
For that open \Libraries\Nop.Services\Catalog\ProductService.cs and search for
public virtual IList<Product> GetAllProductsDisplayedOnHomePage()
        {
            var query = from p in _productRepository.Table
                        orderby p.Name
                        where p.Published &&
                        !p.Deleted
                        &&
                        p.ShowOnHomePage
                        select p;
            var products = query.ToList();
            return products;
        }
Just comment out or remove
                        &&
                        p.ShowOnHomePage
part and you are done, all products would be displayed on home page. It would look like this:
public virtual IList<Product> GetAllProductsDisplayedOnHomePage()
        {
            var query = from p in _productRepository.Table
                        orderby p.Name
                        where p.Published &&
                        !p.Deleted
                        //&&
                        //p.ShowOnHomePage
                        select p;
            var products = query.ToList();
            return products;
        }
But be warned that by doing this you will loose all control on the showing/hiding of products on homepage. In my opinion you should make change like:
Change p.ShowOnHomePage to !p.ShowOnHomePage
In this way all products would be shown on the homepage and if you don't want to show a product on the homepage just tick the Show on Homepage option and it would disappear from the homepage. In other words we have reversed the logic of the option present on the product page.
11 years ago
infiniti wrote:
From what I understand is that you want to display each and every product on the home page without ticking the checkbox for Show Product on Homepage.
For that open \Libraries\Nop.Services\Catalog\ProductService.cs and search for
public virtual IList<Product> GetAllProductsDisplayedOnHomePage()
        {
            var query = from p in _productRepository.Table
                        orderby p.Name
                        where p.Published &&
                        !p.Deleted
                        &&
                        p.ShowOnHomePage
                        select p;
            var products = query.ToList();
            return products;
        }
Just comment out or remove
                        &&
                        p.ShowOnHomePage
part and you are done, all products would be displayed on home page. It would look like this:
public virtual IList<Product> GetAllProductsDisplayedOnHomePage()
        {
            var query = from p in _productRepository.Table
                        orderby p.Name
                        where p.Published &&
                        !p.Deleted
                        //&&
                        //p.ShowOnHomePage
                        select p;
            var products = query.ToList();
            return products;
        }
But be warned that by doing this you will loose all control on the showing/hiding of products on homepage. In my opinion you should make change like:
Change p.ShowOnHomePage to !p.ShowOnHomePage
In this way all products would be shown on the homepage and if you don't want to show a product on the homepage just tick the Show on Homepage option and it would disappear from the homepage. In other words we have reversed the logic of the option present on the product page.


Thanx infiniti

Where do I insert this code? i dont know what the"\Libraries\Nop.Services\Catalog\ProductService.cs" file is or how to find it.

2 other problems im having. . .

1. How do I remove the silly "display 4 per page" and just display all, all the time.
2. How do I make the <table> with the products in it wider so i can put 4 products in a row instead of only 2.
11 years ago
You are going to need the source code version of the site.
11 years ago
daveb wrote:
You are going to need the source code version of the site.


Then what next?
11 years ago
Well then I think you are going to need a copy of visual studio 2012.
11 years ago
daveb wrote:
Well then I think you are going to need a copy of visual studio 2012.


Will Dreamweaver do?
I cant get onto microsofts website for some odd reason.
11 years ago
No dreamweaver is not going to do.

You are going to have to recompile the site in Visual Studio (I assume 2012 if you are using Nop 2.7+)

I think you could get away with using the express version but that's a going to be lot more complicated. I suspect you can even command line compile the .net but I wouldn't go there.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.