Browse Source

Add Cart widget endpoint

pull/41/head
enisn 5 years ago
parent
commit
4a806270aa
  1. 2
      apps/public-web/src/EShopOnAbp.PublicWeb/Components/Toolbar/Cart/CartWidgetViewComponent.cs
  2. 8
      apps/public-web/src/EShopOnAbp.PublicWeb/Controllers/WidgetsController.cs

2
apps/public-web/src/EShopOnAbp.PublicWeb/Components/Toolbar/Cart/CartWidgetViewComponent.cs

@ -12,7 +12,7 @@ namespace EShopOnAbp.PublicWeb.Components.Toolbar.Cart;
[Widget(
AutoInitialize = true,
RefreshUrl = "/Widgets/Basket",
RefreshUrl = "/Widgets/Cart",
StyleTypes = new[] {typeof(CartWidgetStyleContributor)},
ScriptTypes = new[] {typeof(CartWidgetScriptContributor)}
)]

8
apps/public-web/src/EShopOnAbp.PublicWeb/Controllers/WidgetsController.cs

@ -1,4 +1,5 @@
using EShopOnAbp.PublicWeb.Components.Basket;
using EShopOnAbp.PublicWeb.Components.Toolbar.Cart;
using Microsoft.AspNetCore.Mvc;
using Volo.Abp.AspNetCore.Mvc;
@ -13,4 +14,11 @@ public class WidgetsController : AbpController
{
return ViewComponent(typeof(BasketWidgetViewComponent));
}
[HttpGet]
[Route("Cart")]
public IActionResult GetCartWidget()
{
return ViewComponent(typeof(CartWidgetViewComponent));
}
}
Loading…
Cancel
Save