I tried everything to bring image of the current category to its category page Like when we Navigate category "Computers", there is an LCD (Image) saved which should be shown at the top of the page side
This was as per the direction of forum post https://www.nopcommerce.com/boards/t/17750/option-to-show-category-picture-on-the-category-page.aspx
but my image is still not displaying. I checked database and everything but nothing is working for me.
FYI I am using 2.65 version of NopCommerce so think there was no need to implement the code suggested but I tried everything to get it done but Image is not showing. I get it like this <img src> with no source.
Can you solve this issue and point out where I am wrong.
looking at the code for CatalogController.Category I don't see any pictures loaded for the category (only the subcategories) So it seems that Model.PictureModel.Whatever is always null
it is there, to determine, I just checked in Administration --> Catalog --> Categories --> List
I was looking at the source code of nop and don't see any code loading pictures for the current category (only for sub-categories). It doesn't really matter if the pictures are in the database because nop doesn't load them for the current category. What you need to do in CategoryController.Category is add code to load the picture, something like:
What I did is this, this is as per forum that I submitted in opening of this thread. I think this is enough to collect picture from there.
public ActionResult Category(int categoryId, CatalogPagingFilteringModel command) { var category = _categoryService.GetCategoryById(categoryId); if (category == null || category.Deleted) return RedirectToRoute("HomePage");
//Check whether the current user has a "Manage catalog" permission //It allows him to preview a category before publishing if (!category.Published && !_permissionService.Authorize(StandardPermissionProvider.ManageCatalog)) return RedirectToRoute("HomePage");