shop-product.html 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. {{template "header.html" .}}
  2. <div class="card mb-4">
  3. <div class="card-body product-full">
  4. {{if $.Data.IsUserLoggedIn}}
  5. {{if $.Data.CurrentUser.IsAdmin}}
  6. <a href="/cp/shop/modify/{{$.Data.Shop.Product.Id}}/" target="_blank" style="float:right;">Edit</a>
  7. {{end}}
  8. {{end}}
  9. <h2 class="card-title">{{$.Data.Shop.Product.Name}} {{$.Data.Shop.Product.Id}}</h2>
  10. <ul class="nav nav-tabs" id="myTab" role="tablist">
  11. <li class="nav-item">
  12. <a class="nav-link active" id="all-tab" data-toggle="tab" href="#all" role="tab" aria-controls="all" aria-selected="true">All about product</a>
  13. </li>
  14. {{if $.Data.Shop.Product.HaveSpecs}}
  15. <li class="nav-item">
  16. <a class="nav-link" id="specifications-tab" data-toggle="tab" href="#specifications" role="tab" aria-controls="specifications" aria-selected="false">Specifications</a>
  17. </li>
  18. {{end}}
  19. </ul>
  20. <div class="tab-content" id="myTabContent">
  21. <div class="tab-pane no-fade pt-3 show active" id="all" role="tabpanel" aria-labelledby="all-tab">
  22. <div class="row">
  23. <div class="col-md-6">
  24. <div class="card" id="product_image">
  25. <div class="card-body">
  26. {{if $.Data.Shop.Product.HaveImages}}
  27. <img class="card-img-top" src="{{$.Data.Shop.Product.Image.Thumbnail3}}" alt="{{$.Data.EscapeString $.Data.Shop.Product.Name}}">
  28. {{else}}
  29. <img class="card-img-top" src="{{$.Data.ImagePlaceholderHref}}" alt="{{$.Data.EscapeString $.Data.Shop.Product.Name}}">
  30. {{end}}
  31. </div>
  32. </div>
  33. {{if $.Data.Shop.Product.HaveImages}}
  34. <div class="card mt-1">
  35. <div id="product_thumbnails" class="thumbnails d-flex flex-wrap">
  36. {{range $index, $img := $.Data.Shop.Product.Images}}
  37. <a class="thumbnail{{if gt $index 5}} thumbnail-hidden{{end}}" href="{{.ThumbnailFull}}" data-src="{{.ThumbnailFull}}" data-hover="{{.Thumbnail3}}" data-index="{{$index}}">
  38. <img class="img-responsive" alt="" src="{{.Thumbnail0}}" />
  39. </a>
  40. {{end}}
  41. </div>
  42. </div>
  43. {{end}}
  44. </div>
  45. <div class="col-md-6">
  46. {{if $.Data.Shop.Product.HaveVariations}}
  47. <div class="card mt-3 mt-sm-3 mt-md-0 mt-lg-0">
  48. <select class="form-control" onchange="document.location=this.value;">
  49. {{range $variation := $.Data.Shop.Product.Variations}}
  50. <option value="{{.Link}}"{{if .Selected}} selected{{end}}>{{.Name}}</option>
  51. {{end}}
  52. </select>
  53. </div>
  54. {{end}}
  55. <div class="card mt-3{{if not $.Data.Shop.Product.HaveVariations}} mt-sm-3 mt-md-0 mt-lg-0{{end}}">
  56. <div class="card-body">
  57. {{if le $.Data.Shop.Product.Quantity 0}}<h3><span class="badge badge-primary">Out of stock</span></h3>{{end}}
  58. {{if gt $.Data.Shop.Product.PriceOld 0.00}}<h3 class="price_old mb-0 mr-4"><strike>{{$.Data.Shop.Product.PriceOldNice}} {{$.Data.Shop.CurrentCurrency.Code}}</strike></h3>{{end}}
  59. <h3 class="price{{if gt $.Data.Shop.Product.PriceOld 0.00}} price_red{{end}} mb-0 mr-4">{{$.Data.Shop.Product.PriceNice}} {{$.Data.Shop.CurrentCurrency.Code}}</h3><button class="btn btn-success btn-buy" onclick="window&&window.frontend&&frontend.ShopBasketProductAdd(this, {{$.Data.Shop.Product.Id}});return false;"{{if le $.Data.Shop.Product.Quantity 0}} disabled{{end}}>Buy</button>
  60. </div>
  61. </div>
  62. <div class="card mt-3">
  63. <div class="card-header">Payment</div>
  64. <div class="card-body">
  65. <p class="card-text">Non-cash, Cash</p>
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. <div class="row">
  71. <div class="col-md-12">
  72. {{if ne $.Data.Shop.Product.Content ""}}
  73. <hr>
  74. <h3>Description</h3>
  75. <hr>
  76. <div class="product-description">
  77. {{$.Data.Shop.Product.Content}}
  78. </div>
  79. {{end}}
  80. {{if $.Data.Shop.Product.HaveSpecs}}
  81. <hr>
  82. <h3>Specifications</h3>
  83. <hr>
  84. <table class="table table-striped table-bordered mb-0 table-specifications">
  85. <tbody>
  86. {{range $.Data.Shop.Product.Specs}}
  87. <tr>
  88. <td class="tcol-1">{{.FilterName}}</td>
  89. <td class="tcol-2">{{.FilterValue}}</td>
  90. </tr>
  91. {{end}}
  92. </tbody>
  93. </table>
  94. {{end}}
  95. </div>
  96. </div>
  97. </div>
  98. {{if $.Data.Shop.Product.HaveSpecs}}
  99. <div class="tab-pane no-fade pt-3" id="specifications" role="tabpanel" aria-labelledby="specifications-tab">
  100. <div class="row">
  101. <div class="col-md-8">
  102. {{if $.Data.Shop.Product.HaveSpecs}}
  103. <table class="table table-striped table-bordered mb-0 table-specifications">
  104. <tbody>
  105. {{range $.Data.Shop.Product.Specs}}
  106. <tr>
  107. <td class="tcol-1">{{.FilterName}}</td>
  108. <td class="tcol-2">{{.FilterValue}}</td>
  109. </tr>
  110. {{end}}
  111. </tbody>
  112. </table>
  113. {{end}}
  114. </div>
  115. <div class="col-md-4">
  116. <div class="card mt-3 mt-sm-3 mt-md-0 mt-lg-0">
  117. <div class="card-body">
  118. {{if $.Data.Shop.Product.HaveImages}}
  119. <img class="card-img-top" src="{{$.Data.Shop.Product.Image.Thumbnail2}}" alt="{{$.Data.EscapeString $.Data.Shop.Product.Name}}">
  120. {{else}}
  121. <img class="card-img-top" src="{{$.Data.ImagePlaceholderHref}}" alt="{{$.Data.EscapeString $.Data.Shop.Product.Name}}">
  122. {{end}}
  123. </div>
  124. </div>
  125. <div class="card mt-3">
  126. <div class="card-body">
  127. {{if le $.Data.Shop.Product.Quantity 0}}<h3><span class="badge badge-primary">Out of stock</span></h3>{{end}}
  128. {{if gt $.Data.Shop.Product.PriceOld 0.00}}<h3 class="price_old mb-0 mr-4"><strike>{{$.Data.Shop.Product.PriceOldNice}} {{$.Data.Shop.CurrentCurrency.Code}}</strike></h3>{{end}}
  129. <h3 class="price{{if gt $.Data.Shop.Product.PriceOld 0.00}} price_red{{end}} mb-0 mr-4">{{$.Data.Shop.Product.PriceNice}} {{$.Data.Shop.CurrentCurrency.Code}}</h3><button class="btn btn-success btn-buy" onclick="window&&window.frontend&&frontend.ShopBasketProductAdd(this, {{$.Data.Shop.Product.Id}});return false;"{{if le $.Data.Shop.Product.Quantity 0}} disabled{{end}}>Buy</button>
  130. </div>
  131. </div>
  132. </div>
  133. </div>
  134. </div>
  135. {{end}}
  136. </div>
  137. </div>
  138. </div>
  139. {{template "footer.html" .}}