UpdateCart override not working in v4.0

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 года назад
I am wondering if there is anything that can block an override working ?
I am converting a plugin from v4.2 to v.40.
The UpdateCart override works in v4.2 and v4.1 but it does no work in v4.0

I have a CustomerShoppingCartController loaded in DependencyRegistrar.cs
with
        builder.RegisterType<CustomShoppingCartController>().As<ShoppingCartController>();

I have a custom Nop.Plugin.Group.Name\Views\Shared\Components\OrderSummary\Default.cshtml
with the Update Cart button
                        <input type="submit" name="updatecart" value="@T("ShoppingCart.UpdateCart")" class="button-2 update-cart-button" />

Then in the CustomerShoppingCartController I have
        [HttpPost, ActionName("Cart")]
        [FormValueRequired("updatecart")]
        public override IActionResult UpdateCart(IFormCollection form)
        {

which matches the base IActionResult in ShoppingCartController
        [HttpPost, ActionName("Cart")]
        [FormValueRequired("updatecart")]
        public virtual IActionResult UpdateCart(IFormCollection form)
        {

For a test I made both routines are exactly the same
The weird thing is there is another override and other routines in CustomShoppingCartController which are being called.
Just the UpdateCart override is not working and it calls the UpdateCart routine in ShoppingCartController

Any suggestions ?
4 года назад
Hi,
Try to override by Routing

Regards
Krzysztof
4 года назад
Is it CustomerShoppingCartController  or CustomShoppingCartController?

Can you hit the controller from outside VS with something like Postman?
4 года назад
Sorry my bad typing
Yes it is CustomShoppingCartController
Ok I will have a look at postman
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.