Close

Errors in 2.7 Nop Shop All Theme

MarkHancock
11 years ago
#1697 Quote
Avatar
  • 4
Hi there,

I seem to have a few errors and maybe its just me :). but when I install the them. Click on the Public Store it shows the home page fine. I then click on any many and I get the following errors.


Compilation Error
  Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1061: 'Nop.Web.Models.Catalog.CategoryNavigationModel' does not contain a definition for 'IsActive' and no extension method 'IsActive' accepting a first argument of type 'Nop.Web.Models.Catalog.CategoryNavigationModel' could be found (are you missing a using directive or an assembly reference?)

Source Error:
Line 19:                 @foreach (var category in Model)
Line 20:                 {
Line 21:                     <li class="@(category.IsActive ? "active" : "inactive")"
Line 22:                     @if (category.NumberOfParentCategories > 0)
Line 23:                     {
  

Source File: c:\nopCommerce_2.70_Source\Presentation\Nop.Web\Themes\ShopAll\Views\Catalog\CategoryNavigation.cshtml    Line: 21


I also get errors trying to upload pictures to a slider created. Just says fail. The picture is the right size as followed by the installation guide.

I also noticed that if I try to add my slider to the widget I get a fail message as well?

I am sure it must be something I missed.

Please assist

Thanks very much
MarkHancock
11 years ago
#1698 Quote
Avatar
  • 4
Hi just to add to that,

I looked at the CategoryNavigationModel of NopCommerce and it does not seem to reference most of the fields as it complains about all.

namespace Nop.Web.Models.Catalog
{
    public partial class CategoryNavigationModel : BaseNopModel
    {
        public CategoryNavigationModel()
        {
            Categories = new List<CategoryModel>();
        }

        public int CurrentCategoryId { get; set; }
        public List<CategoryModel> Categories { get; set; }

        public class CategoryModel : BaseNopEntityModel
        {
            public CategoryModel()
            {
                SubCategories = new List<CategoryModel>();
            }

            public string Name { get; set; }

            public string SeName { get; set; }

            public int NumberOfParentCategories { get; set; }

            public int? NumberOfProducts { get; set; }

            public List<CategoryModel> SubCategories { get; set; }
        }
    }

Hope this helps
MarkHancock
11 years ago
#1699 Quote
Avatar
  • 4
Hi, Ok I managed to "Fix" it by changing the page to the code below, I have a new problem now where I click on Details of the product and I get the follow error
Compiler Error Message: CS0103: The name 'widgetZone' does not exist in the current context
Source Error:

Line 214:    }
Line 215:</div>
Line 216:@Html.Widget(widgetZone = "productdetails_bottom")

Source File: c:\nopCommerce_2.70_Source\Presentation\Nop.Web\Themes\ShopAll\Views\Catalog\ProductTemplate.SingleVariant.cshtml    Line: 216

I will have a look at this a little later and see if can fix it as well.

Here is the fix for the First error. Please verify if my Fix is correct :) as I have only tested on a standard install. This is for the CategoryNavigation.cshtml file

@model CategoryNavigationModel
@using Nop.Web.Models.Catalog;
@helper RenderCategoryLine(CategoryNavigationModel.CategoryModel category)
{

    var categoryPadding = 15;

    <div class="block block-category-navigation">
        <div class="title">
            @T("Categories")
        </div>
        <div class="clear">
        </div>
        <div class="listbox">
            <ul>
                
                    <li class="@(category.Id == Model.CurrentCategoryId ? "active" : "inactive")"
                    @if (category.NumberOfParentCategories > 0)
                    {
                        if (this.ShouldUseRtlTheme())
                        {
                        <text>style="padding-right: @(category.NumberOfParentCategories * categoryPadding)px"</text>
                        }
                        else
                        {
                        <text>style="padding-left: @(category.NumberOfParentCategories * categoryPadding)px"</text>
                        }
                    }
                    ><a href="@Url.RouteUrl("Category", new { categoryId = category.Id, SeName = category.SeName })">@category.Name
                        @if (category.NumberOfProducts.HasValue)
                        {
                            <text> (@(category.NumberOfProducts.Value))</text>
                        }
                    </a></li>
                
            </ul>
        </div>
    </div>
}

Support
11 years ago
#1700 Quote
Avatar
  • Moderator
  • 1044
Hi Mark,

Thanks for letting us know for the problems you have!

The first one you have experienced is due to incorrect upgrade. I assume you have not deleted the old ~/Themes/ShopAll folder as it is stated in the Readme.txt file for upgrading to nopCommerce 2.7. That is why you have this problem with the CategoryNavigation.cshtml view - you are trying to use the old view. In version 2.7 there is no CategoryNavigation.cshtml view in the theme.

As to the second error we have fixed it already.

So i suggest that you download the theme again from your My Downloads section. Delete the whole ~/Themes/ShopAll folder from your current site and then copy the new one. Thus views that are no longer overridden in the theme will be deleted as well.

This applies for the plugins as well. When doing an upgrade everything should be deleted from the old installation of nopCommerce(except the Settings.txt, InstalledPlugins.txt and images if they are stored on the file system) and then the new ones should be copied.

Hope that helps!

If you need any further assistance please let us know!

Thanks!
MarkHancock
11 years ago
#1701 Quote
Avatar
  • 4
Hi,

Thanks for the feedback, it worked perfectly. I actually never installed 2.65 so I did not need an upgrade, but I did originally copy the 2.65 folders there by mistake and instead of deleting like I should have I overwrote, so I just deleted and copied the new one now and is working great,

Thanks for the assistance :)