Browse Source

Update resources

pull/43/head
enisn 5 years ago
parent
commit
506751e5fd
  1. 13
      apps/public-web/src/EShopOnAbp.PublicWeb/Components/Basket/Default.cshtml
  2. 2
      apps/public-web/src/EShopOnAbp.PublicWeb/Pages/Index.cshtml
  3. 12
      services/basket/src/EShopOnAbp.BasketService.Domain/Basket.cs
  4. 8
      shared/EShopOnAbp.Shared.Localization/Localization/EShopOnAbp/en.json
  5. 9
      shared/EShopOnAbp.Shared.Localization/Localization/EShopOnAbp/tr.json

13
apps/public-web/src/EShopOnAbp.PublicWeb/Components/Basket/Default.cshtml

@ -1,4 +1,11 @@
@using EShopOnAbp.Localization
@using Microsoft.Extensions.Localization
@model EShopOnAbp.BasketService.BasketDto
@inject IStringLocalizer<EShopOnAbpResource> L
<div>
@if (!Model.Items.Any())
{
@ -26,15 +33,15 @@
<text> (@("x" + item.Count))</text>
}
- $@item.TotalPrice.ToString("0.00")
<i class="fa fa-remove basket-item-remove" title="Remove from basket"></i>
<i class="fa fa-remove basket-item-remove" title="@L["RemoveFromBasket"]"></i>
</div>
}
<hr/>
<div class="basket-total-area">
Total: $@Model.TotalPrice.ToString("0.00")
@L["Total"]: $@Model.TotalPrice.ToString("0.00")
</div>
<div>
<abp-button class="basket-purchase-button" text="Purchase" button-type="Primary" />
<abp-button class="basket-purchase-button" text="@L["Purchase"]" button-type="Primary" />
</div>
</div>
}

2
apps/public-web/src/EShopOnAbp.PublicWeb/Pages/Index.cshtml

@ -18,7 +18,7 @@
<div class="row">
<div class="col-lg-12">
<h3 class="pt-5 pb-4 text-center">Our Products</h3>
<h3 class="pt-5 pb-4 text-center">@L["OurProducts"]</h3>
<div class="product-list">
@for (int i = 0; i < Math.Ceiling(Model.Products.Count / (double)productsColumnSize); i++)
{

12
services/basket/src/EShopOnAbp.BasketService.Domain/Basket.cs

@ -11,10 +11,10 @@ public class Basket : AggregateRoot<Guid>
private Basket()
{
}
public Basket(Guid id)
public Basket(Guid id)
: base(id)
{
Items = new List<BasketItem>();
@ -37,20 +37,20 @@ public class Basket : AggregateRoot<Guid>
item.Count += count;
}
}
public void RemoveProduct(Guid productId, int? count = null)
{
if (count is < 1)
{
throw new ArgumentOutOfRangeException(nameof(count), "Product count should be null, 1 or more!");
}
var item = Items.FirstOrDefault(x => x.ProductId == productId);
if (item == null)
{
return;
}
if (count == null || item.Count <= count)
{
Items.Remove(item);

8
shared/EShopOnAbp.Shared.Localization/Localization/EShopOnAbp/en.json

@ -3,6 +3,12 @@
"texts": {
"Menu:Home": "Home",
"Login": "Login",
"Catalog": "Catalog"
"Catalog": "Catalog",
"YourBasket": "Your Basket",
"Purchase": "Purchase",
"Total": "Total",
"OurProducts": "Our Products",
"StockCount": "Stock Count",
"RemoveFromBasket": "Remove from basket"
}
}

9
shared/EShopOnAbp.Shared.Localization/Localization/EShopOnAbp/tr.json

@ -2,6 +2,13 @@
"culture": "tr",
"texts": {
"Menu:Home": "Ana Sayfa",
"Login": "Giriş"
"Login": "Giriş",
"Catalog": "Katalog",
"YourBasket": "Sepetiniz",
"Purchase": "Alışverişi tamamla",
"Total": "Toplam",
"OurProducts": "Ürünlerimiz",
"StockCount": "Stokta",
"RemoveFromBasket": "Sepetten kaldır"
}
}

Loading…
Cancel
Save