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
ray22901031  
#1 Posted : Friday, October 29, 2021 1:13:31 AM(UTC)
ray22901031

Rank: Advanced Member

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

Thanks: 3 times
Was thanked: 13 time(s) in 13 post(s)
I am not certain if this is even a bug

This is regarding the following file "_PaymentSummary.cshtml" which is located in the Areas >Admin > View > Orders.

At the Admin Views directory, we have a Custom folder that follows the same directory structure to override files, without having to modify the original ones. My understanding always has been that if the file exists in both Areas >Admin > View > Orders and Areas >Admin > View > Custom >Orders, the last one would take priority.

However, we have just found that this is not the case unless you go to the original directory structure, in this case Areas >Admin > View > Orders, and either delete the file there or rename it to something else. I was not aware that you needed to take this additional step.

Am I correct in this assumption?

Thanks

Edited by user Friday, October 29, 2021 1:14:25 AM(UTC)  | Reason: Not specified

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

shaharyar  
#2 Posted : Friday, October 29, 2021 4:59:10 AM(UTC)
shaharyar

Rank: Advanced Member

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

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
To override the view files in admin, you need to create a folder on this path Admin->Themes->{CurrentTheme}->Views.
Also, add _ViewStart.csthml and web.config files in Views folder. You can copy these files from the Admin -> Views folder.
ray22901031  
#3 Posted : Friday, October 29, 2021 7:04:40 AM(UTC)
ray22901031

Rank: Advanced Member

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

Thanks: 3 times
Was thanked: 13 time(s) in 13 post(s)
Thanks, but your reply is confusing and I believe you have misread my question.

Right now, all files that do not exist under the following directory structure Admin > View > Orders, but do exist under Admin > View > Custom >Orders, are being loaded properly.

Question is: What happens if the same file exists in both places at the same time?

This is the way it was set up by a previous developer, and I'm just trying to understand, Maybe if you can give me a more detailed answer with examples it would help.

>> Also, add _ViewStart.csthml and web.config files in Views folder. You can copy these files from the Admin -> Views folder.<<

Those two files are automatically there by default upon the installation of a standard installation.

Edited by user Friday, October 29, 2021 7:09:39 AM(UTC)  | Reason: Not specified

shaharyar  
#4 Posted : Friday, October 29, 2021 7:58:29 AM(UTC)
shaharyar

Rank: Advanced Member

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

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
Quote:
Question is: What happens if the same file exists in both places at the same time?


We never tried using the view files this way. Admin > View > Orders is the default directory structure and my understanding is that the MVC will first look into this directory and if not found it will look into the remaining directories.
ray22901031  
#5 Posted : Friday, October 29, 2021 8:16:35 AM(UTC)
ray22901031

Rank: Advanced Member

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

Thanks: 3 times
Was thanked: 13 time(s) in 13 post(s)
Please note, the purpose of this conversation is for understanding. I was talking to a new developer, and we were discussing this, and he seems to be confused.

Right now, under Areas > Admin > Views, there exists a directory called "Custom", and under that directory there are 3 other directories:

- Notes
- Orders
- Product

This is the behavior that I'm observing, if a file exists under Areas > Admin > Views > Custom > Notes, but does not exist under Areas > Admin > Views > Notes, the file is loaded under the Custom directory.

If the file exists in both places, it bypasses the Custom Directory completely. In order for the file to properly load under the Custom directory, it can only exist here and no place else.

This is working perfectly, but my new developer got confused, that's why I'm seeking clarification.

But now you're telling me that the directory structure should be Areas > Admin > Themes > [????????] > Views > Notes.

So, you can understand my confusion here, what I have now is working, but I guess the question is, is it something that was set up by the previous developer through some custom configuration or is this behavior by default?

Slightly confused,
-Ray

Edited by user Friday, October 29, 2021 8:18:18 AM(UTC)  | Reason: Not specified

shaharyar  
#6 Posted : Friday, October 29, 2021 8:29:01 AM(UTC)
shaharyar

Rank: Advanced Member

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

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
Quote:
But now you're telling me that the directory structure should be Areas > Admin > Themes > [????????] > Views > Notes.


This is an ablecommerce feature. We have added this option for the users who want to change the existing view files while keeping the originally released file unchanged. Ablecommerce will give priority to the view files that reside under the theme folder provided that the hierarchy is the same.

Quote:
is it something that was set up by the previous developer through some custom configuration or is this behavior by default?


I think yes, AFAIK there is no default behavior in MVC framework that understands the custom folder in the views folder.

I hope I am able to clear the confusion.

Thanks
ray22901031  
#7 Posted : Friday, October 29, 2021 8:32:23 AM(UTC)
ray22901031

Rank: Advanced Member

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

Thanks: 3 times
Was thanked: 13 time(s) in 13 post(s)
You have cleared the confusion to some degree, what I'm going to do is an experiment later this week using the sample directory structure that comes with a new install.

I will report my findings here. From what I'm reading is, if the file exists in the location that you recommend, it can also exist in the original location without having to remove it or rename it, this is what I'm understanding from your post.

shaharyar  
#8 Posted : Friday, October 29, 2021 8:56:46 AM(UTC)
shaharyar

Rank: Advanced Member

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

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
Quote:
From what I'm reading is, if the file exists in the location that you recommend, it can also exist in the original location without having to remove it or rename it, this is what I'm understanding from your post.


Yes, you are right
ray22901031  
#9 Posted : Friday, October 29, 2021 9:01:44 AM(UTC)
ray22901031

Rank: Advanced Member

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

Thanks: 3 times
Was thanked: 13 time(s) in 13 post(s)
Give me a couple of days to verify this under a sample installation, and I will report my findings. I hope you can see where this could be a bit confusing. Many thanks for your reply.
ray22901031  
#10 Posted : Friday, October 29, 2021 10:18:05 PM(UTC)
ray22901031

Rank: Advanced Member

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

Thanks: 3 times
Was thanked: 13 time(s) in 13 post(s)
Hello shaharyar,

VERSION: 9.0.3.6432

As you can tell by the version above, this is a fresh installation of the very first release of version 9. I could not get the above default behavior to work with the sample application provided. It doesn't matter.

My concern was that my old developer did something so if it didn't find the file in one place, it would look to another specific area.

This is okay, it just confused my current developer, and I dislike reinventing the wheel. Right now, the site that launched about a week ago is solid as a rock, no problems, except for Payflow Pro which just sucks.

That being said, we are about to upgrade from 9.0.4 to 9.0.5 to stay current.

So, I am debating whether to take what my old developer did, and just copy all the files back to their original places to avoid any confusion in the future.

Again, my system is solid as a rock and for that simple reason, I don't like to reinvent the wheel.

Just sharing my feedback.
shaharyar  
#11 Posted : Monday, November 1, 2021 5:36:01 AM(UTC)
shaharyar

Rank: Advanced Member

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

Thanks: 5 times
Was thanked: 113 time(s) in 112 post(s)
Thanks for your feedback.

Best of luck with your upgrade process to 9.0.5.
sweeperqb  
#12 Posted : Saturday, May 21, 2022 1:35:19 AM(UTC)
sweeperqb

Rank: Advanced Member

Groups: Authorized User, Developers
Joined: 5/30/2020(UTC)
Posts: 125

Thanks: 14 times
Was thanked: 3 time(s) in 3 post(s)
Sorry to revive an old thread...
Quote:
To override the view files in admin, you need to create a folder on this path Admin->Themes->{CurrentTheme}->Views.

  1. Is {CurrentTheme} the current storefront theme, or am I missing a place to specify the Admin theme?

  2. Is the path correct, or should it be Areas->Admin->Themes->{CurrentTheme}->Views? I tried both. Areas didn't seem to reflect my changes. Admin caused the dashboard to throw an error (probably because the route conflicted with a physical directory)

  3. Are there file requirements for the themes in Admin? I did a pretty barebones setup and only added the web.config, _ViewStart.cshtml, and /Base/_Layout.cshtml. It isn't picking up my changes to the base layout (added Open Sans google web font) even though I set _ViewStart.cshtml to use the custom layout.
nadeem  
#13 Posted : Monday, May 23, 2022 6:03:19 AM(UTC)
nadeem

Rank: Advanced Member

Groups: Administrators, Developers, Registered, HelpDesk, Authorized User, Admin, System
Joined: 10/11/2018(UTC)
Posts: 109

Thanks: 17 times
Was thanked: 18 time(s) in 18 post(s)
Quote:
Is {CurrentTheme} the current storefront theme, or am I missing a place to specify the Admin theme?


Yes, to override the admin views, you need to create a Theme folder under Areas/Admin/{CurrentTheme} where the CurrentTheme will be your storefront theme. You have to create the folder with the exact Theme name.

Quote:

Is the path correct, or should it be Areas->Admin->Themes->{CurrentTheme}->Views? I tried both. Areas didn't seem to reflect my changes.


Yes, that is correct. Have you restarted the App pool after these changes?

Quote:

Admin caused the dashboard to throw an error (probably because the route conflicted with a physical directory)


What the error are you getting?

Quote:
Are there file requirements for the themes in Admin? I did a pretty barebones setup and only added the web.config, _ViewStart.cshtml, and /Base/_Layout.cshtml. It isn't picking up my changes to the base layout (added Open Sans google web font) even though I set _ViewStart.cshtml to use the custom layout.


Yes, only the _ViewStart.cshtml and web.config from the Areas/Admin/Views folder need to be copied to the Areas/Admin/Themes/{CurrentTheme}/Views folder.
Users browsing this topic
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.