Advertisement
Guest User

Untitled

a guest
Mar 23rd, 2019
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 12.17 KB | None | 0 0
  1. @model WoWShop.Models.ViewModels.ProductDetalisViewModel
  2. @using Newtonsoft.Json
  3. @using WoWShop.Services
  4. @using WoWShop.Services.Services;
  5.  
  6. @section scripts {
  7.  
  8.     @Html.Raw(Scripts.Render("~/bundles/public/details").ToHtmlString().ToLower())
  9.     @{
  10.         var name = new SettingService().GetSettings().NameShop;
  11.     }
  12.     <script>
  13.         var params = {};
  14.         params.Product =  @Html.Raw(JsonConvert.SerializeObject(Model.Product));
  15.         params.Products  = @Html.Raw(JsonConvert.SerializeObject(Model.Product.SimilarProducts));
  16.         params.UrlAddProductInCard = '@Url.Action("AddProductInCart","Cart")';
  17.         var ViewModel = new Products.ProductDetailsViewModel(params);
  18.         ko.applyBindings(ViewModel, document.getElementById('page-content'))
  19.     </script>
  20.  
  21.     <script type="application/ld+json">
  22.         {
  23.         "@@context": "http://schema.org/",
  24.         "@@type": "Product",
  25.         "name": "@Model.Product.Name",
  26.         "description": "@ViewBag.StrippedDescription",
  27.         "image": "@("https://" + this.Request.Url.DnsSafeHost + Model.Product.Image.UrlPreview)",
  28.         "url": "https://@(this.Request.Url.Authority + this.Request.Url.AbsolutePath)",
  29.         "productID": "@Model.Product.Id",
  30.         "sku": "@(Model.Product.Id + 625722)",
  31.         "mpn": "@(Model.Product.Id + 37)",
  32.         "releaseDate": "@Model.Product.DateCreate",
  33.         "category": "@Model.Product.CategoryName",
  34.         "brand": "ShadowBoost",
  35.         "logo": "https://@(this.Request.Url.Authority)/asserts/img/logo.svg",
  36.         "manufacturer": "@name",
  37.         "aggregateRating": {
  38.         "@@type": "AggregateRating",
  39.         "ratingCount": "999",
  40.         "reviewCount": "999",
  41.         "bestRating": "5.0",
  42.         "ratingValue": "5.0",
  43.         "worstRating": "1.0"
  44.         },
  45.         "offers": {
  46.         "@@type": "Offer",
  47.         "priceCurrency": "EUR",
  48.         "price": "@ViewBag.MinPrice.ToString().Replace(',', '.')",
  49.         "priceValidUntil": "@DateTime.Now.AddDays(3).ToString("yyyy-MM-dd")",
  50.         "availability": "@string.Format("{0}", Model.Product.IsOutOfStock ? "http://schema.org/OutOfStock" : "http://schema.org/InStock")",
  51.         "url": "https://@(this.Request.Url.Authority + this.Request.Url.AbsolutePath)",
  52.         "seller": {
  53.         "@@type": "Organization",
  54.         "name": "@name",
  55.         "brand": "@name",
  56.         "department": "World of Wacraft boosting service, WoW shop, Helping with character leveling.",
  57.         "email": "support@shadowboost.com",
  58.         "logo": "https://@(this.Request.Url.Authority)/asserts/img/logo.svg"
  59.         },
  60.         "acceptedPaymentMethod": {
  61.         "@@type": "PaymentMethod",
  62.         "name": "PayPal, Skrill, VISA, MasterCard, Maestro, American Express"
  63.         }
  64.         },
  65.         "audience": {
  66.         "@@type": "Audience",
  67.         "audienceType": "Gamers, WoW players, World of Wacraft players, boosting buyers"
  68.         },
  69.         "review": [
  70.         {
  71.         "@@type": "Review",
  72.         "author": "Guard",
  73.         "datePublished": "2019-01-01",
  74.         "description": "Top quality service, recommend to all World of Warcraft players.",
  75.         "reviewRating": {
  76.         "@@type": "Rating",
  77.         "bestRating": "5.0",
  78.         "ratingValue": "5.0",
  79.         "worstRating": "1.0"
  80.         }
  81.         }],
  82.         "isRelatedTo": [
  83.         {
  84.         "@@type": "Product",
  85.         "image": "@("https://" + this.Request.Url.DnsSafeHost + Model.Product.Image.UrlPreview)",
  86.         "url": "https://@(this.Request.Url.Authority + this.Request.Url.AbsolutePath)",
  87.         "name": "@Model.Product.Name",
  88.         "offers": {
  89.         "@@type": "Offer",
  90.         "price": "@ViewBag.MinPrice.ToString().Replace(',', '.')",
  91.         "priceCurrency": "EUR"
  92.         }
  93.         }]
  94.         }
  95.  
  96.     </script>
  97.     <script type="application/ld+json">
  98.         {
  99.         "@@context": "http://schema.org",
  100.         "@@type": "BreadcrumbList",
  101.         "itemListElement":
  102.         [
  103.         {
  104.         "@@type": "ListItem",
  105.         "position": 1,
  106.         "item":
  107.         {
  108.         "@@id": "https://@(this.Request.Url.Authority)/",
  109.         "name": "Home"
  110.         }
  111.         },
  112.         {
  113.         "@@type": "ListItem",
  114.         "position": 2,
  115.         "item":
  116.         {
  117.         "@@id": "https://@(this.Request.Url.Authority)@(Url.Action("Index", "Products", new { category = Model.Product.Categories.OrderBy(x => x.OrdinalNumberInNavigation).FirstOrDefault()?.Url }))",
  118.         "name": "@(Model.Product.Categories.OrderBy(x => x.OrdinalNumberInNavigation).FirstOrDefault()?.Name)"
  119.         }
  120.         }
  121.         ]
  122.         }
  123.     </script>
  124. }
  125.  
  126. <section id="product-details">
  127.     <div class="product-details" data-bind="with:ViewModel.Product">
  128.         <div class="wrapper">
  129.             <div class="img-product">
  130.                 @*@if (!string.IsNullOrEmpty(Model.Product.BadjiTitle))
  131.                     {
  132.                         <div class="badj-container" style="background-color:@Model.Product.BadjiColorBg; color: @Model.Product.BadjiColorText;">
  133.                             @Model.Product.BadjiTitle
  134.                         </div>
  135.                     }*@
  136.                 @if (!string.IsNullOrWhiteSpace(Model.Product?.Image?.UrlPreview))
  137.                 {
  138.                     <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}" />
  139.                 }
  140.                 else
  141.                 {
  142.                     <img src="~/asserts/img/none-image.png" alt="" data-bind="visible:(UrlPreview() === ''),attr:{alt:Name,AltImage:TitleImage}" style="display:none;" />
  143.                 }
  144.  
  145.  
  146.                 @if (!Model.Product.IsOutOfStock)
  147.                 {
  148.                     <div>
  149.                         <div class="points" data-bind="with:OptionTree">
  150.                             <div>
  151.  
  152.                                 <!--ko foreach:VisibleNode()-->
  153.                                 <!--ko if:Items().length -->
  154.                                 <div class="title-points">
  155.                                     <span data-bind="text:Title"></span>
  156.                                 </div>
  157.                                 <div class="section-option" data-bind="foreach:Items">
  158.  
  159.                                     <label class="checked-container" data-bind="css:{'checked-container':Type() === 'checkbox','radio-container': Type() ==='radio'}">
  160.                                         <div>
  161.                                             <!--ko if:Type() === 'checkbox'-->
  162.                                             <input type="checkbox" data-bind="event:{change:Select},checked:IsActive" name="points">
  163.                                             <span class="checkmark-checkbox"></span>
  164.                                             <!--/ko-->
  165.                                             <!--ko if:Type() === 'radio'-->
  166.                                             <input type="radio" data-bind="event:{change:Select},checked:IsActiveForEditing,attr:{name:NameGroup()}" name="points">
  167.                                             <span class="checkmark"></span>
  168.                                             <!--/ko-->
  169.                                         </div>
  170.                                         <div>
  171.                                             <span data-bind="text:Name" class="text-red"></span>&emsp;
  172.                                             <!--ko if:Price() != "" && Price() >0-->
  173.                                             <span data-bind="text:Price" class="price"></span> <span data-bind="currency"></span>
  174.                                             <!--/ko-->
  175.                                         </div>
  176.  
  177.                                     </label>
  178.                                 </div>
  179.                                 <!--/ko-->
  180.                                 <!--/ko-->
  181.                             </div>
  182.                         </div>
  183.  
  184.                     </div>
  185.                     <div class="price-detail">
  186.                         <div class="price-product">
  187.  
  188.                             <div class="cost">Cost:</div>&ensp;
  189.                             <!--ko if: Discount()===""-->
  190.                             <span data-bind="text:AmountPrice" content="@Model.Product.Price"></span> <span data-bind="currency" content="USD"></span>
  191.                             <!--/ko-->
  192.                             <!--ko ifnot: Discount()===""-->
  193.                             <span data-bind="text:AmountDiscountPrice"></span> <span data-bind="currency"></span>&ensp;&mdash;&ensp;
  194.                             <span class="last-price" >@(Convert.ToInt32(Model.Product.Price)) </span> <span data-bind="currency"></span>
  195.                             <!--/ko-->
  196.                         </div>
  197.                     </div>
  198.                     <div class="add-cart">
  199.                         <div class="detail-total">
  200.                             <div class="input-number">
  201.                                 <input type="text" class="text-number" data-bind="number:Quantity" />
  202.                                 <div class="carets">
  203.                                     <div class="up" data-bind="click:SetQuantity.bind($data,Quantity()+1)">
  204.                                         <span class="icon-up"></span>
  205.                                     </div>
  206.                                     <div class="down" data-bind="click:SetQuantity.bind($data,Quantity()-1)">
  207.                                         <span class="icon-arrow-down"></span>
  208.                                     </div>
  209.                                 </div>
  210.                             </div>
  211.                             <div class="add-product">
  212.                                 <div>
  213.                                     <button class="btn-blue" data-bind="click:addProductInCart.bind($data,$data,Quantity())"> Add to cart </button>
  214.                                 </div>
  215.                             </div>
  216.                         </div>
  217.                     </div>
  218.                 }
  219.                 else
  220.                 {
  221.                     <div class="price-detail">
  222.                         <div class="out-of-stock">Out of Stock</div>
  223.                     </div>
  224.                 }
  225.             </div>
  226.             <div class="info">
  227.                 <div class="detail-nav">
  228.                     <div>
  229.                         <h1 class="name-product">@("Buy WoW EU") @Model.Product.Name @("boost service")</h1>
  230.                     </div>
  231.  
  232.                     <div class="detail-nav-panel">
  233.                         <a class="nav-history first" href="@Url.Action("Index","Home")">Home</a>
  234.                        <i class="icon-next nav"></i>
  235.                         <a class="nav-history" href="@Url.Action("Index", "Products",new {category =  Model.Product.Categories.OrderBy(x=>x.OrdinalNumberInNavigation).FirstOrDefault()?.Url})">
  236.                             @(Model.Product.Categories.OrderBy(x => x.OrdinalNumberInNavigation).FirstOrDefault()?.Name)
  237.                         </a>
  238.                         <i class="icon-next nav"></i>
  239.                         <span class="nav-history last" href="#">@Model.Product.Name</span>
  240.                     </div>
  241.                 </div>
  242.                 <div class="description-product">
  243.                     @Html.Raw(Model.Product.Description)
  244.                 </div>
  245.             </div>
  246.         </div>
  247.  
  248.     </div>
  249. </section>
  250.  
  251. @if (Model.Product.SimilarProducts.Any())
  252. {
  253.     <div class="row-products-category">
  254.         <div class="name-section best" style="    margin-bottom: 40px;">
  255.             <div class="title">
  256.                 RELATED PRODUCTS
  257.             </div>
  258.             <div>
  259.                 <span class="hr"></span>
  260.             </div>
  261.         </div>
  262.  
  263.  
  264.         @Html.Partial("~/Views/Shared/Partial/_ProductsRow.cshtml", Model.Product.SimilarProducts)
  265.  
  266.         <!--ko if: ViewModel.Products().length === 0 -->
  267.         <div class="load-block marginT-100">
  268.             <button class="btn-blue btn-big" disabled>
  269.                 <div style="justify-content:center;">
  270.                     There are no related products.
  271.                 </div>
  272.             </button>
  273.         </div>
  274.         <!--/ko-->
  275.     </div>
  276. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement