Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @model WoWShop.Models.ViewModels.ProductDetalisViewModel
- @using Newtonsoft.Json
- @using WoWShop.Services
- @using WoWShop.Services.Services;
- @section scripts {
- @Html.Raw(Scripts.Render("~/bundles/public/details").ToHtmlString().ToLower())
- @{
- var name = new SettingService().GetSettings().NameShop;
- }
- <script>
- var params = {};
- params.Product = @Html.Raw(JsonConvert.SerializeObject(Model.Product));
- params.Products = @Html.Raw(JsonConvert.SerializeObject(Model.Product.SimilarProducts));
- params.UrlAddProductInCard = '@Url.Action("AddProductInCart","Cart")';
- var ViewModel = new Products.ProductDetailsViewModel(params);
- ko.applyBindings(ViewModel, document.getElementById('page-content'))
- </script>
- <script type="application/ld+json">
- {
- "@@context": "http://schema.org/",
- "@@type": "Product",
- "name": "@Model.Product.Name",
- "description": "@ViewBag.StrippedDescription",
- "image": "@("https://" + this.Request.Url.DnsSafeHost + Model.Product.Image.UrlPreview)",
- "url": "https://@(this.Request.Url.Authority + this.Request.Url.AbsolutePath)",
- "productID": "@Model.Product.Id",
- "sku": "@(Model.Product.Id + 625722)",
- "mpn": "@(Model.Product.Id + 37)",
- "releaseDate": "@Model.Product.DateCreate",
- "category": "@Model.Product.CategoryName",
- "brand": "ShadowBoost",
- "logo": "https://@(this.Request.Url.Authority)/asserts/img/logo.svg",
- "manufacturer": "@name",
- "aggregateRating": {
- "@@type": "AggregateRating",
- "ratingCount": "999",
- "reviewCount": "999",
- "bestRating": "5.0",
- "ratingValue": "5.0",
- "worstRating": "1.0"
- },
- "offers": {
- "@@type": "Offer",
- "priceCurrency": "EUR",
- "price": "@ViewBag.MinPrice.ToString().Replace(',', '.')",
- "priceValidUntil": "@DateTime.Now.AddDays(3).ToString("yyyy-MM-dd")",
- "availability": "@string.Format("{0}", Model.Product.IsOutOfStock ? "http://schema.org/OutOfStock" : "http://schema.org/InStock")",
- "url": "https://@(this.Request.Url.Authority + this.Request.Url.AbsolutePath)",
- "seller": {
- "@@type": "Organization",
- "name": "@name",
- "brand": "@name",
- "department": "World of Wacraft boosting service, WoW shop, Helping with character leveling.",
- "email": "support@shadowboost.com",
- "logo": "https://@(this.Request.Url.Authority)/asserts/img/logo.svg"
- },
- "acceptedPaymentMethod": {
- "@@type": "PaymentMethod",
- "name": "PayPal, Skrill, VISA, MasterCard, Maestro, American Express"
- }
- },
- "audience": {
- "@@type": "Audience",
- "audienceType": "Gamers, WoW players, World of Wacraft players, boosting buyers"
- },
- "review": [
- {
- "@@type": "Review",
- "author": "Guard",
- "datePublished": "2019-01-01",
- "description": "Top quality service, recommend to all World of Warcraft players.",
- "reviewRating": {
- "@@type": "Rating",
- "bestRating": "5.0",
- "ratingValue": "5.0",
- "worstRating": "1.0"
- }
- }],
- "isRelatedTo": [
- {
- "@@type": "Product",
- "image": "@("https://" + this.Request.Url.DnsSafeHost + Model.Product.Image.UrlPreview)",
- "url": "https://@(this.Request.Url.Authority + this.Request.Url.AbsolutePath)",
- "name": "@Model.Product.Name",
- "offers": {
- "@@type": "Offer",
- "price": "@ViewBag.MinPrice.ToString().Replace(',', '.')",
- "priceCurrency": "EUR"
- }
- }]
- }
- </script>
- <script type="application/ld+json">
- {
- "@@context": "http://schema.org",
- "@@type": "BreadcrumbList",
- "itemListElement":
- [
- {
- "@@type": "ListItem",
- "position": 1,
- "item":
- {
- "@@id": "https://@(this.Request.Url.Authority)/",
- "name": "Home"
- }
- },
- {
- "@@type": "ListItem",
- "position": 2,
- "item":
- {
- "@@id": "https://@(this.Request.Url.Authority)@(Url.Action("Index", "Products", new { category = Model.Product.Categories.OrderBy(x => x.OrdinalNumberInNavigation).FirstOrDefault()?.Url }))",
- "name": "@(Model.Product.Categories.OrderBy(x => x.OrdinalNumberInNavigation).FirstOrDefault()?.Name)"
- }
- }
- ]
- }
- </script>
- }
- <section id="product-details">
- <div class="product-details" data-bind="with:ViewModel.Product">
- <div class="wrapper">
- <div class="img-product">
- @*@if (!string.IsNullOrEmpty(Model.Product.BadjiTitle))
- {
- <div class="badj-container" style="background-color:@Model.Product.BadjiColorBg; color: @Model.Product.BadjiColorText;">
- @Model.Product.BadjiTitle
- </div>
- }*@
- @if (!string.IsNullOrWhiteSpace(Model.Product?.Image?.UrlPreview))
- {
- <img src="@(Model.Product?.Image?.UrlPreview)" alt="@(Model.Product?.Image?.AltImage)" style="display:none;" data-bind="visible:(UrlPreview() !== ''),attr:{src:UrlPreview(),alt:AltImage,title:TitleImage}" />
- }
- else
- {
- <img src="~/asserts/img/none-image.png" alt="" data-bind="visible:(UrlPreview() === ''),attr:{alt:Name,AltImage:TitleImage}" style="display:none;" />
- }
- @if (!Model.Product.IsOutOfStock)
- {
- <div>
- <div class="points" data-bind="with:OptionTree">
- <div>
- <!--ko foreach:VisibleNode()-->
- <!--ko if:Items().length -->
- <div class="title-points">
- <span data-bind="text:Title"></span>
- </div>
- <div class="section-option" data-bind="foreach:Items">
- <label class="checked-container" data-bind="css:{'checked-container':Type() === 'checkbox','radio-container': Type() ==='radio'}">
- <div>
- <!--ko if:Type() === 'checkbox'-->
- <input type="checkbox" data-bind="event:{change:Select},checked:IsActive" name="points">
- <span class="checkmark-checkbox"></span>
- <!--/ko-->
- <!--ko if:Type() === 'radio'-->
- <input type="radio" data-bind="event:{change:Select},checked:IsActiveForEditing,attr:{name:NameGroup()}" name="points">
- <span class="checkmark"></span>
- <!--/ko-->
- </div>
- <div>
- <span data-bind="text:Name" class="text-red"></span> 
- <!--ko if:Price() != "" && Price() >0-->
- <span data-bind="text:Price" class="price"></span> <span data-bind="currency"></span>
- <!--/ko-->
- </div>
- </label>
- </div>
- <!--/ko-->
- <!--/ko-->
- </div>
- </div>
- </div>
- <div class="price-detail">
- <div class="price-product">
- <div class="cost">Cost:</div> 
- <!--ko if: Discount()===""-->
- <span data-bind="text:AmountPrice" content="@Model.Product.Price"></span> <span data-bind="currency" content="USD"></span>
- <!--/ko-->
- <!--ko ifnot: Discount()===""-->
- <span data-bind="text:AmountDiscountPrice"></span> <span data-bind="currency"></span> — 
- <span class="last-price" >@(Convert.ToInt32(Model.Product.Price)) </span> <span data-bind="currency"></span>
- <!--/ko-->
- </div>
- </div>
- <div class="add-cart">
- <div class="detail-total">
- <div class="input-number">
- <input type="text" class="text-number" data-bind="number:Quantity" />
- <div class="carets">
- <div class="up" data-bind="click:SetQuantity.bind($data,Quantity()+1)">
- <span class="icon-up"></span>
- </div>
- <div class="down" data-bind="click:SetQuantity.bind($data,Quantity()-1)">
- <span class="icon-arrow-down"></span>
- </div>
- </div>
- </div>
- <div class="add-product">
- <div>
- <button class="btn-blue" data-bind="click:addProductInCart.bind($data,$data,Quantity())"> Add to cart </button>
- </div>
- </div>
- </div>
- </div>
- }
- else
- {
- <div class="price-detail">
- <div class="out-of-stock">Out of Stock</div>
- </div>
- }
- </div>
- <div class="info">
- <div class="detail-nav">
- <div>
- <h1 class="name-product">@("Buy WoW EU") @Model.Product.Name @("boost service")</h1>
- </div>
- <div class="detail-nav-panel">
- <a class="nav-history first" href="@Url.Action("Index","Home")">Home</a>
- <i class="icon-next nav"></i>
- <a class="nav-history" href="@Url.Action("Index", "Products",new {category = Model.Product.Categories.OrderBy(x=>x.OrdinalNumberInNavigation).FirstOrDefault()?.Url})">
- @(Model.Product.Categories.OrderBy(x => x.OrdinalNumberInNavigation).FirstOrDefault()?.Name)
- </a>
- <i class="icon-next nav"></i>
- <span class="nav-history last" href="#">@Model.Product.Name</span>
- </div>
- </div>
- <div class="description-product">
- @Html.Raw(Model.Product.Description)
- </div>
- </div>
- </div>
- </div>
- </section>
- @if (Model.Product.SimilarProducts.Any())
- {
- <div class="row-products-category">
- <div class="name-section best" style=" margin-bottom: 40px;">
- <div class="title">
- RELATED PRODUCTS
- </div>
- <div>
- <span class="hr"></span>
- </div>
- </div>
- @Html.Partial("~/Views/Shared/Partial/_ProductsRow.cshtml", Model.Product.SimilarProducts)
- <!--ko if: ViewModel.Products().length === 0 -->
- <div class="load-block marginT-100">
- <button class="btn-blue btn-big" disabled>
- <div style="justify-content:center;">
- There are no related products.
- </div>
- </button>
- </div>
- <!--/ko-->
- </div>
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement