Adding a field to Categories

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

The website im working on has a custom banner for each category. This banner is simply an image.

Is it possible to add a field to categories? The changes I think I would need to make are:

Administration/Modules/CategoryAdd.ascx
Administration/Modules/CategoryInfo.ascx (add an input field)
NopSolutions.NopCommerce.BusinessLogic.Categories.Category.cs (add a property)

Database
Nop_Category

Is this the right way to go around it? Are there any other changes I need to consider?

Thanks in advance
Al
12 years ago
its the right way to add a field to category, however u can do it without changing nop code.
Name the banners with one name and add the categoryId to each of the banners name.
Then u will have a matching banner to a category according to the category id
12 years ago
Hi Hezyz,

Thanks for your response.

Yes I could, but what I failed to mention is that I need the website administrators to be able to select the banner themselves - which might be a bit confusing for them if I have to teach them how to extract the category ID and upload the files using FTP!

Can you think of any other areas of the code base I need to consider?

Thanks
Al
12 years ago
take a look at this
http://blogs.planetcloud.co.uk/mygreatdiscovery/post/How-to-extend-nopCommerce.aspx
12 years ago
higgsy wrote:
The website im working on has a custom banner for each category. This banner is simply an image.


What version of nopC are you using?  In 2.x, Categories can have an image.  Where are you trying to display a Category image?
12 years ago
Hezyz - thabnks for your answer. It worked and I now have two image fields for each category. Awesome.

New York - thanks for answering, I may not have explained it very well but I wanted two image fields for each category.

All done now...

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