-
Notifications
You must be signed in to change notification settings - Fork 2
View Customization
Trevor Fayas edited this page Aug 4, 2021
·
3 revisions
A common customization point is the view rendering of the Generic Ecommerce. The default implementation has it's views compiled in the projects Razor Class Library, meaning that you can't directly modify them. However, every place that calls a view gets the view path from the EcommerceOptions static strings.
During the startup, you can set these static strings on this class to point to your own custom view paths, which will then adjust all renderings to use that new view path.
- Create your new View you want to overwrite (you can start with the existing view and modify from there if you wish)
- In your
Startup'sConfigure(IApplicationBuilder app)method, set the EcommerceOptions.[TheViewYouWantToOverwrite] to your view path.
public Startup {
...
public void Configure(IApplicationBuilder app) {
...
// Set to custom Views
EcommerceOptions.CartItemPartialView = "~/Views/Ecommerce/_CartItem.cshtml";
EcommerceOptions.CheckoutCartPartialView = "~/Views/Ecommerce/_CheckoutCart.cshtml";
EcommerceOptions.CheckoutView = "~/Views/Ecommerce/CheckoutContainer.cshtml";
}
}- Installation / Setup
- Design Principle
- Basic Usage
- Operations and Interfaces
- Customization Points
- Creating Custom Payment Gateways