logo
Welcome to our new AbleCommerce forums. As a guest, you may view the information here. To post to this forum, you must have a registered account with us, either as a new user evaluating AbleCommerce or an existing user of the application. For all questions related to the older version of Gold and earlier, please go to AbleCommerce Gold forum. Please use your AbleCommerce username and password to Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
jeffr_ca  
#1 Posted : Sunday, November 29, 2020 10:41:53 PM(UTC)
jeffr_ca

Rank: Advanced Member

Groups: Authorized User, Developers, Registered, HelpDesk
Joined: 1/7/2019(UTC)
Posts: 112

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
Some of the Widgets offer the specification of "Category ID" when using the widget in a layout on Inner Templates, while other Widgets that should have "Category ID" do not.

For example, the Category Product Grid widget allows us to specify the "Category ID" that we wish to display on any page. The Subcategory Grid widget however does not offer the same parameter. Please see the attached screenshots.

It would be helpful to implement the "Category ID" on all feasible widgets to make layouts much more flexible. For example we would be able to create master navigation pages by using multiple "Subcategory Grid" widgets, each showing a different "Category ID" that can present a quick navigation to groups of products.

Thanks for any updates that could be made to implement this functionality, particularly on the Subcategory Grid Widget.

-Jeff

CategoryProductGrid.JPG (28kb) downloaded 0 time(s). SubCategoryGrid.JPG (27kb) downloaded 0 time(s).

Wanna join the discussion?! Login to your AbleCommerce Forums forum account. New Registrations are disabled.

shaharyartiwana25816656  
#2 Posted : Tuesday, December 1, 2020 2:22:43 AM(UTC)
shaharyar

Rank: Advanced Member

Groups: Admin, Developers, Registered, HelpDesk, Authorized User
Joined: 10/5/2018(UTC)
Posts: 704

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
Hi Jeff,

I have opened a discussion for improvement.

I am sharing the code updates you can make for subcategory widget.

1- Open \Website\Models\CategoryModels.cs
2- Search For
Code:


        public SubCategoriesGridParams()
        {
            PublicOnly = true;
            Size = 4;
            Caption = "Subcategory Grid";
            Columns = CategoryDisplayColumns.Four;
            ShowCategorySummary = true;
        }

3- Replace with
Code:

        [DisplayName("Category Id")]
        [DefaultValue(-1)]
        [Description("Category Id to list more items for")]
        public int CategoryId { get; set; }

        public SubCategoriesGridParams()
        {
            PublicOnly = true;
            Size = 4;
            Caption = "Subcategory Grid";
            Columns = CategoryDisplayColumns.Four;
            ShowCategorySummary = true;
            CategoryId = -1;
        }

4- Open \Website\Controllers\CategoryController.cs
5- Search For
Code:

        [RegisterWidget(DisplayName = "Subcategory Grid", Category = WidgetCategory.Category, Description = " Displays the sub-categories of the current category displayed in a grid format.")]
        public ActionResult SubcategoriesGrid(SubCategoriesGridParams parameters)
        {
           int categoryId = PageHelper.GetCategoryId();

6- Replace with
Code:

        [RegisterWidget(DisplayName = "Subcategory Grid", Category = WidgetCategory.Category, Description = " Displays the sub-categories of the current category displayed in a grid format.")]
        public ActionResult SubcategoriesGrid(SubCategoriesGridParams parameters)
        {
            int categoryId;
            if (parameters.CategoryId > -1)
                categoryId = parameters.CategoryId;
            else
                categoryId = PageHelper.GetCategoryId();
jeffr_ca  
#3 Posted : Tuesday, December 1, 2020 7:09:28 AM(UTC)
jeffr_ca

Rank: Advanced Member

Groups: Authorized User, Developers, Registered, HelpDesk
Joined: 1/7/2019(UTC)
Posts: 112

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
Thank you for checking this and providing code updates.

Unfortunately, while I can edit the .cs files, I don't have Visual Studio and so I'm not able to compile. Is there any way that you would be able to email or upload the compiled files for this change?

-Jeff
ray22901031  
#4 Posted : Wednesday, December 2, 2020 5:22:27 AM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 827

Thanks: 3 times
Was thanked: 13 time(s) in 13 post(s)
Hi Jeff,

Can't you download the community version of Visual Studio? Unless there's something in the community version that would prevent you from compiling Ablecommerce, this should work for you.

Does anybody know if Visual Studio Code, which is also free, works with Ablecommerce?

Thanks

Edited by user Wednesday, December 2, 2020 5:23:57 AM(UTC)  | Reason: Not specified

jeffr_ca  
#5 Posted : Wednesday, December 2, 2020 8:14:12 AM(UTC)
jeffr_ca

Rank: Advanced Member

Groups: Authorized User, Developers, Registered, HelpDesk
Joined: 1/7/2019(UTC)
Posts: 112

Thanks: 1 times
Was thanked: 2 time(s) in 2 post(s)
Well....I actually did that last night. I have zero experience with VS, but was able to open the project and attempted a test build right out of the .zip to make sure it worked. There was an error immediately about "Invalid option '7.3' for /langversion; must be ISO-1, ISO-2, Default....blah,blah..." and the build failed. Disappointed :(

But, I kept re-trying the Build tool and after three or four attempts, it skipped through and worked!! Don't know why.

I made the various code changes as suggested and ran the Build tool...same error as earlier, but re-tried a few more times and that finalled worked!!

I did a filefolder compare of the .dlls to the original download and found only the ablecommerce.dll was changed and so I swapped it into place on the test site and to my pleasant surprise, it's working.

Certainly not feeling like "Wiley Coyote - Super Genius" yet, but at least have a way to try some of these tweaks out now.

Thanks to the forum for the help!

-Jeff
ray22901031  
#6 Posted : Wednesday, December 2, 2020 8:29:43 AM(UTC)
ray22901031

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 2/17/2019(UTC)
Posts: 827

Thanks: 3 times
Was thanked: 13 time(s) in 13 post(s)
>>> Well....I actually did that last night. I have zero experience with VS, but was able to open the project and attempted a test build right out of the .zip to make sure it worked. There was an error immediately about "Invalid option '7.3' for /langversion; must be ISO-1, ISO-2, Default....blah,blah..." and the build failed. Disappointed :(

But, I kept re-trying the Build tool and after three or four attempts, it skipped through and worked!! Don't know why. <<<


Do not concern yourself with the above, this is quite normal. It seems that the very first time you open up Ablecommerce and try to do a rebuilt, I also get an error like you suggested, but by the second time, it goes away.

Yes, you are correct, only the ablecommerce.dll will need to be swapped out, and if you have access to IIS, just to be on the safe side, do a reset on the site as well.

I would recommend that you keep a log of your changes.

Glad you got it working
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.