Advertisement
bevang1999

featured-products.liquid

Nov 1st, 2021
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.29 KB | None | 0 0
  1. {% assign featured = section.settings.home_page_featured_products %}
  2. {% assign products_per_row = 3 %}
  3. {% assign rows = section.settings.home_featured_products_row_num %}
  4. {% assign total_products = products_per_row | times: rows %}
  5.  
  6. {% unless settings.home_section_1 == 'banner-image' %}
  7. <hr class="medium-up--hide hr--clear hr--small">
  8. {% endunless %}
  9.  
  10. <div class="featured-products">
  11.  
  12. {% if section.settings.title != blank %}
  13. <h2 class="small--text-center">{{ section.settings.title | escape }}</h2>
  14. {% endif %}
  15.  
  16. <div class="grid grid--uniform" role="list">
  17.  
  18. {% for product in collections[featured].products limit: total_products %}
  19. {% include 'product-grid-item' %}
  20. {% else %}
  21. {% comment %}
  22. If collection is empty, show onboarding state
  23. For onboarding new users to your theme, we add some default products and onboarding tutorials to help populate their store
  24. {% endcomment %}
  25.  
  26. {% unless onboardingLoaded %}
  27. {% comment %}
  28. Only load onboarding styles if they have not already been loaded.
  29. {% endcomment %}
  30. {% assign onboardingLoaded = true %}
  31. {% endunless %}
  32.  
  33. <div class="grid__item">
  34. <div class="grid grid--uniform">
  35. {% for i in (1..total_products) %}
  36. <div class="grid__item product medium-up--one-third small--one-half text-center">
  37. <a href="/admin/products" class="product__image-wrapper">
  38. {% capture current %}{% cycle 1, 2, 3, 4, 5, 6 %}{% endcapture %}
  39. {{ 'product-' | append: current | placeholder_svg_tag: 'placeholder-svg' }}
  40. </a>
  41. <div class="product__title"><a href="/admin/products">{{ 'homepage.onboarding.product_title' | t | capitalize }}</a></div>
  42. <div class="product__price">$19.99</div>
  43. </div>
  44. {% endfor %}
  45. </div>
  46. </div>
  47. {% endfor %}
  48. </div>
  49. </div>
  50.  
  51.  
  52.  
  53. {% schema %}
  54. {
  55. "name": {
  56. "cs": "Propagovaná kolekce",
  57. "da": "Udvalgt kollektion",
  58. "de": "Vorgestellte Kategorie",
  59. "en": "Featured collection",
  60. "es": "Colección destacada",
  61. "fi": "Esittelyssä oleva kokoelma",
  62. "fr": "Collection en vedette",
  63. "it": "Collezione in evidenza",
  64. "ja": "特集コレクション",
  65. "ko": "추천 컬렉션",
  66. "nb": "Utvalgt samling",
  67. "nl": "Uitgelichte collectie",
  68. "pl": "Polecana kolekcja",
  69. "pt-BR": "Coleção em destaque",
  70. "pt-PT": "Coleção em destaque",
  71. "sv": "Utvald kollektion",
  72. "th": "คอลเลกชันแนะนำ",
  73. "tr": "Öne çıkan koleksiyon",
  74. "vi": "Bộ sưu tập nổi bật",
  75. "zh-CN": "特色产品系列",
  76. "zh-TW": "精選商品系列"
  77. },
  78. "settings": [
  79. {
  80. "type": "text",
  81. "id": "title",
  82. "label": {
  83. "cs": "Nadpis",
  84. "da": "Overskrift",
  85. "de": "Überschrift",
  86. "en": "Heading",
  87. "es": "Título",
  88. "fi": "Otsake",
  89. "fr": "Titre",
  90. "it": "Heading",
  91. "ja": "見出し",
  92. "ko": "제목",
  93. "nb": "Overskrift",
  94. "nl": "Kop",
  95. "pl": "Nagłówek",
  96. "pt-BR": "Título",
  97. "pt-PT": "Título",
  98. "sv": "Rubrik",
  99. "th": "ส่วนหัว",
  100. "tr": "Başlık",
  101. "vi": "Tiêu đề",
  102. "zh-CN": "标题",
  103. "zh-TW": "標題"
  104. },
  105. "default": {
  106. "cs": "Propagovaná kolekce",
  107. "da": "Udvalgt kollektion",
  108. "de": "Vorgestellte Kategorie",
  109. "en": "Featured collection",
  110. "es": "Colección destacada",
  111. "fi": "Esittelyssä oleva kokoelma",
  112. "fr": "Collection en vedette",
  113. "it": "Collezione in evidenza",
  114. "ja": "特集コレクション",
  115. "ko": "추천 컬렉션",
  116. "nb": "Fremhevet samling",
  117. "nl": "Uitgelichte collectie",
  118. "pl": "Polecana kolekcja",
  119. "pt-BR": "Coleção em destaque",
  120. "pt-PT": "Coleção em destaque",
  121. "sv": "Utvald kollektion",
  122. "th": "คอลเลกชันแนะนำ",
  123. "tr": "Öne çıkan koleksiyon",
  124. "vi": "Bộ sưu tập nổi bật",
  125. "zh-CN": "特色产品系列",
  126. "zh-TW": "精選商品系列"
  127. }
  128. },
  129. {
  130. "type": "collection",
  131. "id": "home_page_featured_products",
  132. "label": {
  133. "cs": "Kolekce",
  134. "da": "Kollektion",
  135. "de": "Kategorie",
  136. "en": "Collection",
  137. "es": "Colección",
  138. "fi": "Kokoelma",
  139. "fr": "Collection",
  140. "it": "Collezione",
  141. "ja": "コレクション",
  142. "ko": "컬렉션",
  143. "nb": "Samling",
  144. "nl": "Collectie",
  145. "pl": "Kolekcja",
  146. "pt-BR": "Coleção",
  147. "pt-PT": "Coleção",
  148. "sv": "Produktserie",
  149. "th": "คอลเลกชัน",
  150. "tr": "Koleksiyon",
  151. "vi": "Bộ sưu tập",
  152. "zh-CN": "收藏",
  153. "zh-TW": "商品系列"
  154. }
  155. },
  156. {
  157. "type": "range",
  158. "id": "home_featured_products_row_num",
  159. "label": {
  160. "cs": "Řádky",
  161. "da": "Rækker",
  162. "de": "Reihen",
  163. "en": "Rows",
  164. "es": "Filas",
  165. "fi": "Rivit",
  166. "fr": "Rangées",
  167. "it": "Righe",
  168. "ja": "行",
  169. "ko": "열",
  170. "nb": "Rader",
  171. "nl": "Rijen",
  172. "pl": "Wiersze",
  173. "pt-BR": "Linhas",
  174. "pt-PT": "Linhas",
  175. "sv": "Rader",
  176. "th": "แถว",
  177. "tr": "Satırlar",
  178. "vi": "Hàng",
  179. "zh-CN": "行数",
  180. "zh-TW": "列"
  181. },
  182. "min": 1,
  183. "max": 10,
  184. "step": 1,
  185. "default": 2
  186. }
  187. ],
  188. "presets": [
  189. {
  190. "name": {
  191. "cs": "Propagovaná kolekce",
  192. "da": "Udvalgt kollektion",
  193. "de": "Vorgestellte Kategorie",
  194. "en": "Featured collection",
  195. "es": "Colección destacada",
  196. "fi": "Esittelyssä oleva kokoelma",
  197. "fr": "Collection en vedette",
  198. "it": "Collezione in evidenza",
  199. "ja": "特集コレクション",
  200. "ko": "추천 컬렉션",
  201. "nb": "Utvalgt samling",
  202. "nl": "Uitgelichte collectie",
  203. "pl": "Polecana kolekcja",
  204. "pt-BR": "Coleção em destaque",
  205. "pt-PT": "Coleção em destaque",
  206. "sv": "Utvald kollektion",
  207. "th": "คอลเลกชันแนะนำ",
  208. "tr": "Öne çıkan koleksiyon",
  209. "vi": "Bộ sưu tập nổi bật",
  210. "zh-CN": "特色产品系列",
  211. "zh-TW": "精選商品系列"
  212. },
  213. "category": {
  214. "cs": "Kolekce",
  215. "da": "Kollektion",
  216. "de": "Kategorie",
  217. "en": "Collection",
  218. "es": "Colección",
  219. "fi": "Kokoelma",
  220. "fr": "Collection",
  221. "it": "Collezione",
  222. "ja": "コレクション",
  223. "ko": "컬렉션",
  224. "nb": "Samling",
  225. "nl": "Collectie",
  226. "pl": "Kolekcja",
  227. "pt-BR": "Coleção",
  228. "pt-PT": "Coleção",
  229. "sv": "Produktserie",
  230. "th": "คอลเลกชัน",
  231. "tr": "Koleksiyon",
  232. "vi": "Bộ sưu tập",
  233. "zh-CN": "收藏",
  234. "zh-TW": "商品系列"
  235. }
  236. }
  237. ],
  238. "blocks": []
  239. }
  240. {% endschema %}
  241.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement