How can I filter which categories or products are shown?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
14 anos atrás
Hello,

New to nop as of yesterday. I want to provide multiple links to one nopcommerce instance from my main site.

For example:

Link 1:  click here to shop for barcode products:

Link 2: click here to shop for accounting software

Link 3: click here to shop for something else

etc.

Then, upon going to the nopcommerce site, the categories, or products, are filtered to show only the relevant ones.

Is it possible to do this without setting up a separate nopcommerce instance per link?


Thanks,
David Schlesinger
14 anos atrás
I think its not possible without modifying code.

This is one of my next task also. to set up store that will display only products from 1 category.

It should be easy. Root categories should be only 3 that you mention and then you just display 1 root category instead of all. If you will have those od 3 different domains then its easy task but it will need some more coding for me where everything is on 1 domain.
14 anos atrás
Not sure I understand.

You want to use your home page to display a specific set of products based on a link?

You will still need to pass parameters in your Url which is no different to placing a link directly to one of your category/product pages at the moment.

It would be possible to make these urls slightly friendlier i.e. http://www.yourstore.com/trainers. There are a number of ways to do this.

Regards,

Ben
14 anos atrás
I think that its not what he wants (I think that because I kow what I need and will do). Based on link or domain or something store must look like selling only 1 type of items (Other categories must not be displayed).

Example. I'm selling sport equipment and food. When I come to store with url equal to www.equipment.sport.com when I should only see categories that are inside 1 root level category "sportequipment). There must be no way I can come to food products when I come to shop trought this doman.
Then, when I come to shop with entering www.food.sport.com then I cannot see any other products but food (equipment is not displayed)

So I'll have 1 application for many branches.

This is on my thing to do but not right now.
14 anos atrás
Hello Retroviz and Bubbi,

Yes. Bubbi is correct, this is what I want to do. I don't have a lot of items. As I say, I am new to nop, and new to web development, but I have been looking at the code and database, a bit. It looks to me like I could use the published column of either the category table or the products table. For example, I could use the query string to decide which categories to show, and update the published column to be 0 for all but the category I am interested in. I executed the sql statement to do this in sql server management studio, and this works, so, if I could do it at run-time, it seems like it would be a good solution.


Also, I am just learning .net, so I don't understand the code that well, but I looked at categorynavigation.ascx.cs
and I see that there is a loop that renders the child menu for categories. I'm thinking that this could be modified to do what I want.

Please let me know what you think.

Thanks,
David
14 anos atrás
It sounds you are referring to a multiple storefront scenario with one back end database.

Currently this feature is not available but I can suggest how this feature it could be implemented.

Eassentially you will need to store multiple storefront details. Look at Global Settings > General Tab. You need to store this information for each store.

You need to store domains. You then need to set up domain<>store mappings. This way you can have one or more domains pointing to a specific store.

With this done, you need to set up store<>entity mappings (products, categories, manufacturers). These will determine what is available at each store.

You will need to change all your methods that load entities to accept a store id parameter.

Of course the above implementation doesnt cater for payment methods, campaigns, message templates, customers etc.

This is why we have not yet implemented this feature in nopCommerce - its a big job! :)

Anyway, I hope this helps put you on the right track. In short you need a way of mapping a domain name to a store id and a way of mapping entities to the store id.
14 anos atrás
Thanks for the detailed reply Retroviz.

I see now that it is very involved. I don't think I am ready to tackle this at this point, since I am relatively new to asp.net.
I will make due with it the way it is for now. At some point  I may revisit it.

Thanks,
David
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.