Skip to content

Commit

Permalink
Add "Maximum Products to Show" setting to Product Recommendations sec…
Browse files Browse the repository at this point in the history
…tion (Shopify#1429)
  • Loading branch information
sofiamatulis authored Mar 4, 2022
1 parent cdd1583 commit e5e3be7
Show file tree
Hide file tree
Showing 22 changed files with 74 additions and 2 deletions.
3 changes: 3 additions & 0 deletions locales/cs.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2028,6 +2028,9 @@
"options__2": {
"label": "2 sloupce"
}
},
"products_to_show": {
"label": "Maximální počet zobrazovaných produktů"
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions locales/da.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2028,6 +2028,9 @@
"options__2": {
"label": "2 kolonner"
}
},
"products_to_show": {
"label": "Maksimalt antal produkter, der skal vises"
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions locales/de.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2028,6 +2028,9 @@
"options__2": {
"label": "2 Spalten"
}
},
"products_to_show": {
"label": "Maximal anzuzeigende Produkte"
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions locales/en.default.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2257,6 +2257,9 @@
"heading": {
"label": "Heading"
},
"products_to_show": {
"label": "Maximum products to show"
},
"columns_desktop": {
"label": "Number of columns on desktop"
},
Expand Down
3 changes: 3 additions & 0 deletions locales/es.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2028,6 +2028,9 @@
"options__2": {
"label": "2 columnas"
}
},
"products_to_show": {
"label": "Número máximo de productos para mostrar"
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions locales/fi.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2028,6 +2028,9 @@
"options__2": {
"label": "2 saraketta"
}
},
"products_to_show": {
"label": "Näytettävien tuotteiden enimmäismäärä"
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions locales/fr.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2028,6 +2028,9 @@
"options__2": {
"label": "2 colonnes"
}
},
"products_to_show": {
"label": "Quantité maximale de produits à afficher"
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions locales/it.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2028,6 +2028,9 @@
"options__2": {
"label": "2 colonne"
}
},
"products_to_show": {
"label": "Massimo di prodotti da mostrare"
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions locales/ja.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2028,6 +2028,9 @@
"options__2": {
"label": "2列"
}
},
"products_to_show": {
"label": "表示する商品の最大数"
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions locales/ko.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2028,6 +2028,9 @@
"options__2": {
"label": "열 2개"
}
},
"products_to_show": {
"label": "표시할 제품의 최대 수"
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions locales/nb.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2028,6 +2028,9 @@
"options__2": {
"label": "2 kolonner"
}
},
"products_to_show": {
"label": "Maksimalt antall produkter som vises"
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions locales/nl.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2028,6 +2028,9 @@
"options__2": {
"label": "2 kolommen"
}
},
"products_to_show": {
"label": "Maximaal te tonen producten"
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions locales/pl.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2028,6 +2028,9 @@
"options__2": {
"label": "2 kolumny"
}
},
"products_to_show": {
"label": "Maksymalna liczba produktów do wyświetlenia"
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions locales/pt-BR.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2028,6 +2028,9 @@
"options__2": {
"label": "2 colunas"
}
},
"products_to_show": {
"label": "Máximo de produtos a serem mostrados"
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions locales/pt-PT.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2028,6 +2028,9 @@
"options__2": {
"label": "2 colunas"
}
},
"products_to_show": {
"label": "Máximo de produtos a apresentar"
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions locales/sv.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2028,6 +2028,9 @@
"options__2": {
"label": "2 kolumner"
}
},
"products_to_show": {
"label": "Maximalt antal produkter att visa"
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions locales/th.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2028,6 +2028,9 @@
"options__2": {
"label": "2 คอลัมน์"
}
},
"products_to_show": {
"label": "จำนวนสินค้าสูงสุดที่จะแสดง"
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions locales/tr.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2028,6 +2028,9 @@
"options__2": {
"label": "2 sütun"
}
},
"products_to_show": {
"label": "Gösterilecek maksimum ürün sayısı"
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions locales/vi.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2028,6 +2028,9 @@
"options__2": {
"label": "2 cột"
}
},
"products_to_show": {
"label": "Số lượng sản phẩm hiển thị tối đa"
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions locales/zh-CN.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2028,6 +2028,9 @@
"options__2": {
"label": "2 列"
}
},
"products_to_show": {
"label": "要显示的最大产品数"
}
}
},
Expand Down
3 changes: 3 additions & 0 deletions locales/zh-TW.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2028,6 +2028,9 @@
"options__2": {
"label": "2 欄"
}
},
"products_to_show": {
"label": "產品數量顯示上限"
}
}
},
Expand Down
13 changes: 11 additions & 2 deletions sections/product-recommendations.liquid
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{%- endstyle -%}

<div class="color-{{ section.settings.color_scheme }} gradient">
<product-recommendations class="product-recommendations page-width section-{{ section.id }}-padding isolate" data-url="{{ routes.product_recommendations_url }}?section_id={{ section.id }}&product_id={{ product.id }}&limit=4">
<product-recommendations class="product-recommendations page-width section-{{ section.id }}-padding isolate" data-url="{{ routes.product_recommendations_url }}?section_id={{ section.id }}&product_id={{ product.id }}&limit={{ section.settings.products_to_show }}">
{% if recommendations.performed and recommendations.products_count > 0 %}
<h2 class="product-recommendations__heading {{ section.settings.heading_size }}">{{ section.settings.heading | escape }}</h2>
<ul class="grid product-grid grid--{{ section.settings.columns_desktop }}-col-desktop grid--{{ section.settings.columns_mobile }}-col-tablet-down" role="list">
Expand Down Expand Up @@ -113,11 +113,20 @@
"default": "h1",
"label": "t:sections.all.heading_size.label"
},
{
"type": "range",
"id": "products_to_show",
"min": 2,
"max": 10,
"step": 1,
"default": 4,
"label": "t:sections.product-recommendations.settings.products_to_show.label"
},
{
"type": "range",
"id": "columns_desktop",
"min": 1,
"max": 4,
"max": 5,
"step": 1,
"default": 4,
"label": "t:sections.product-recommendations.settings.columns_desktop.label"
Expand Down

0 comments on commit e5e3be7

Please sign in to comment.