@using BTCPayServer.Plugins.PointOfSale.Models @using BTCPayServer.Services @model BTCPayServer.Plugins.PointOfSale.Models.ViewPointOfSaleViewModel @inject DisplayFormatter DisplayFormatter @{ Layout = "PointOfSale/Public/_Layout"; var anyInventoryItems = Model.Items.Any(item => item.Inventory.HasValue); }
@if (!string.IsNullOrEmpty(Model.Description)) {
@Safe.Raw(Model.Description)
}
@for (var x = 0; x < Model.Items.Length; x++) { var item = Model.Items[x]; var formatted = DisplayFormatter.Currency(item.Price ?? 0, Model.CurrencyCode, DisplayFormatter.CurrencyFormat.Symbol); var buttonText = string.IsNullOrEmpty(item.BuyButtonText) ? item.PriceType != ViewPointOfSaleViewModel.ItemPriceType.Fixed ? Model.CustomButtonText : Model.ButtonText : item.BuyButtonText; buttonText = buttonText.Replace("{0}", formatted).Replace("{Price}", formatted);
@if (!string.IsNullOrWhiteSpace(item.Image)) { @Safe.Raw(item.Title) } @{CardBody(item.Title, item.Description);}
} @if (Model.ShowCustomAmount) {
@{CardBody("Custom Amount", "Create invoice to pay custom amount");}
}
@functions { private void PayFormInputContent(string buttonText,ViewPointOfSaleViewModel.ItemPriceType itemPriceType, decimal? minPriceValue = null, decimal? priceValue = null) { if (itemPriceType == ViewPointOfSaleViewModel.ItemPriceType.Fixed && priceValue == 0) {
} else {
@Model.CurrencySymbol
} } private void CardBody(string title, string description) {
@Safe.Raw(title)
@if (!string.IsNullOrWhiteSpace(description)) {

@Safe.Raw(description)

}
} }