Hi,
I want to modify /quickviewdata html result.
After some debug i find quickviewdata route defaults ,it is
SevenSpikes.Nop.Plugins.QuickView.Controllers.QuickViewCatalog.QucikViewData
var xxxViewEngine = ViewEngines.Engines[1];
var pluginViewEngine = ViewEngines.Engines[0];
ViewEngines.Engines[0] = xxxViewEngine;
ViewEngines.Engines[1] = pluginViewEngine;
Hi,
I try to use Pavilion theme with my custom (heavy) plugin and try to override some views and controllers. And i dont want to change thirty part code(nopCommerce or any plugin,theme code).
So i was write a CustomViewEngine which insert some PartialViewLocationFormats and ViewLocationFormats.
In RouteProvider i'm insert this ViewEngine as a first Engine.
public int Priority
{
get
{
return int.MaxValue;
}
}
ViewEngines.Engines.Insert(0, new XXXViewEngine());
public class ShoppingCartOverridesController : Nop.Web.Controllers.ShoppingCartController
{
public override ActionResult AddProductToCart_Details(int productId, int shoppingCartTypeId, FormCollection form)
{
//Some code which use RequestFormData
var result = base.AddProductToCart_Details(productId,shoppingCartTypeId,form);
//Some code
return result;
}
}
public override ActionResult AddProductToCart_Catalog(int productId, int shoppingCartTypeId, int quantity, bool forceredirection = false)
{
//Some code which use RequestFormData
var result = AddProductToCart_Catalog(productId, shoppingCartTypeId, quantity, forceredirection)
//Some code
return result;
}
//add product to cart (without any attributes and options). used on catalog pages.
routes.MapLocalizedRoute("XXX.YYY.Integration.Override.AddProductToCart-Catalog",
"addproducttocart/catalog/{productId}/{shoppingCartTypeId}/{quantity}",
new { controller = "ShoppingCartOverrides", action = "AddProductToCart_Catalog" },
new { productId = @"\d+", shoppingCartTypeId = @"\d+", quantity = @"\d+" },
new[] { "XXX.YYY.Integration.Controllers" });
//add product to cart (with attributes and options). used on the product details pages.
routes.MapLocalizedRoute("XXX.YYY.Integration.Override.AddProductToCart-Details",
"addproducttocart/details/{productId}/{shoppingCartTypeId}",
new { controller = "ShoppingCartOverrides", action = "AddProductToCart_Details" },
new { productId = @"\d+", shoppingCartTypeId = @"\d+" },
new[] { "XXX.YYY.Integration.Controllers" });