Skip to content

Commit

Permalink
Feature: add sponsored tag if applicable (#385)
Browse files Browse the repository at this point in the history
#### What problem is this solving?

These changes renders a sponsored tag above the product's name if the
product is sponsored.

#### How to test it?

<!--- Don't forget to add a link to a Workspace where this branch is
linked -->


[Workspace](https://caula--sjdigital.myvtex.com/cotonete?_q=cotonete&map=ft)

#### Screenshots or example usage:

<!--- Add some images or gifs to showcase changes in behaviour or
layout. Example: before and after images -->
![Screenshot 2023-11-16 at 13 31
39](https://github.com/vtex-apps/store-components/assets/15937541/ac7a72d3-7da5-413f-9156-1b231990f360)

#### Related to / Depends on

<!--- Optional -->
Depends on:
- [ ] vtex-apps/store-components#1098.
  • Loading branch information
Henrique Caúla authored Nov 28, 2023
1 parent f103bfe commit bb563ce
Show file tree
Hide file tree
Showing 25 changed files with 63 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Added

- When a product is sponsored, renders the sponsored tag above the product's name.

## [2.86.0] - 2023-11-10

### Added
Expand Down
1 change: 1 addition & 0 deletions docs/ProductSummaryName.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ Product Summary Name is a block exported by the [Product Summary app](https://de
| `showSku` | `Boolean` | Show product SKU | `false` |
| `showProductReference` | `Boolean` | Show product reference | `false`|
| `showBrandName` | `Boolean` | Show brand name | `false`|
| `sponsoredBadgeLabel` | `String` | The text of the "Sponsored" tag, if applicable. | `"store/sponsored-badge.label"`|

## Customization

Expand Down
2 changes: 2 additions & 0 deletions messages/ar-SA.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"store/pricing.from": "من",
"store/pricing.to": "إلى",
"store/button-label": "شراء",
"store/sponsored-badge.label": "ได้รับการสนับสนุน",
"admin/editor.productSummary.title": "ملخص المنتج",
"admin/editor.productSummary.description": "ملخص المنتج الذي يظهر معلومات المنتج الرئيسي",
"admin/editor.productSummary.isOneClickBuy.title": "يجب إعادة توجيه الدفع بعد النقر على الشراء",
Expand Down Expand Up @@ -37,6 +38,7 @@
"admin/editor.productSummaryImage.hoverImage.criteria.label": "تسمية الصورة الفوقية",
"admin/editor.productSummaryImage.hoverImage.criteria.matchCriteria": "معايير البحث عن تسمية صورة فوقية (بالضبط: العثور على الصورة التي تطابق تماما الاسم المملوء في حقل 'تسمية صورة فوقية' | تضمن: العثور على الصورة الأولى التي تحتوي على النص المملوء في حقل 'تسمية صورة فوقية')",
"admin/editor.productSummaryImage.hoverImage.criteria.index": "مؤشر الصورة الفوقية",
"admin/editor.productSummaryName.sponsoredBadge.title": "ข้อความของแท็กผลิตภัณฑ์ที่ได้รับการสนับสนุน หากมี",
"admin/editor.productSummaryBuyButton.title": "زر ملخص شراء المنتج",
"admin/editor.productSummaryName.title": "اسم ملخص المنتج",
"admin/editor.product-summary-specification-badges.title": "ملخص مواصفات شارات المنتج",
Expand Down
2 changes: 2 additions & 0 deletions messages/bg-BG.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"store/pricing.from": "От",
"store/pricing.to": "До",
"store/button-label": "Купуване",
"store/sponsored-badge.label": "Спонсориран",
"admin/editor.productSummary.title": "Резюме на продукт",
"admin/editor.productSummary.description": "Резюмето на продукта, което съдържа основните данни за него",
"admin/editor.productSummary.isOneClickBuy.title": "Трябва да пренасочи към финализиране след кликване на бутона за купуване",
Expand Down Expand Up @@ -37,6 +38,7 @@
"admin/editor.productSummaryImage.hoverImage.criteria.label": "Етикет при задържане на курсора върху изображение",
"admin/editor.productSummaryImage.hoverImage.criteria.matchCriteria": "Критерии за търсене на етикет при задържане на курсора върху изображението (точно: намира изображението, което е точно съвпадение с името, посочено в полето „етикет при задържане на курсора върху изображение“ | съдържа: намира първото изображение, което съдържа текста, поставен в полето „етикет при задържане на курсора върху изображение“)",
"admin/editor.productSummaryImage.hoverImage.criteria.index": "Индекс при задържане на курсора върху изображение",
"admin/editor.productSummaryName.sponsoredBadge.title": "Текст на етикета на спонсорирания продукт, ако е приложимо",
"admin/editor.productSummaryBuyButton.title": "Бутон за покупка с резюме на продукта",
"admin/editor.productSummaryName.title": "Име на резюме на продукта",
"admin/editor.product-summary-specification-badges.title": "Значки със спецификации на резюме на продукта",
Expand Down
1 change: 1 addition & 0 deletions messages/context.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"admin/editor.productSummaryImage.hoverImage.criteria.index": "admin/editor.productSummaryImage.hoverImage.criteria.index",
"admin/editor.productSummaryImage.hoverImage.criteria.label": "admin/editor.productSummaryImage.hoverImage.criteria.label",
"admin/editor.productSummaryImage.hoverImage.criteria.matchCriteria": "admin/editor.productSummaryImage.hoverImage.criteria.matchCriteria",
"admin/editor.productSummaryName.sponsoredBadge.title": "admin/editor.productSummaryName.sponsoredBadge.title",
"admin/editor.productSummaryBuyButton.title": "admin/editor.productSummaryBuyButton.title",
"admin/editor.productSummaryName.title": "admin/editor.productSummaryName.title",
"admin/editor.product-summary-specification-badges.title": "admin/editor.product-summary-specification-badges.title",
Expand Down
2 changes: 2 additions & 0 deletions messages/de-DE.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"store/pricing.from": "Von",
"store/pricing.to": "Bis",
"store/button-label": "Kaufen",
"store/sponsored-badge.label": "Gesponsert",
"admin/editor.productSummary.title": "Produktzusammenfassung",
"admin/editor.productSummary.description": "Die Produktübersicht zeigt die wichtigsten Produktinformationen",
"admin/editor.productSummary.isOneClickBuy.title": "Soll nach einem Klick auf Kauf zur Kasse weitergeleitet werden",
Expand Down Expand Up @@ -37,6 +38,7 @@
"admin/editor.productSummaryImage.hoverImage.criteria.label": "Mausverschiebung Bildbeschriftung",
"admin/editor.productSummaryImage.hoverImage.criteria.matchCriteria": "Mausverschiebung Bildbeschriftung Bezeichnungssuche (genau: findet das Bild, das genau mit dem Namen übereinstimmt, der im Feld 'Hover Image Label' eingetragen ist | enthält: findet das erste Bild, das den Text enthält, der im Feld 'Hover Image Label' ausgefüllt ist)",
"admin/editor.productSummaryImage.hoverImage.criteria.index": "Mausverschiebung Index",
"admin/editor.productSummaryName.sponsoredBadge.title": "Text des gesponserten Produkt-Tags, falls zutreffend",
"admin/editor.productSummaryBuyButton.title": "Produktübersicht Kauf-Taste",
"admin/editor.productSummaryName.title": "Produktübersicht Name",
"admin/editor.product-summary-specification-badges.title": "Produktübersicht Spezifikations-Abzeichen",
Expand Down
2 changes: 2 additions & 0 deletions messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"store/pricing.from": "From",
"store/pricing.to": "To",
"store/button-label": "Buy",
"store/sponsored-badge.label": "Sponsored",
"admin/editor.productSummary.title": "Product Summary",
"admin/editor.productSummary.description": "Product summary showing the main product information",
"admin/editor.productSummary.isOneClickBuy.title": "Redirect to checkout after clicking buy",
Expand Down Expand Up @@ -39,6 +40,7 @@
"admin/editor.productSummaryImage.hoverImage.criteria.index": "Hover Image Index",
"admin/editor.productSummaryBuyButton.title": "Product Summary Buy Button",
"admin/editor.productSummaryName.title": "Product Summary Name",
"admin/editor.productSummaryName.sponsoredBadge.title": "Text of the sponsored product tag, if applicable",
"admin/editor.product-summary-specification-badges.title": "Product Summary Specification Badges",
"admin/editor.productSummaryList.title": "Product List",
"admin/editor.productSummaryList.description": "Product list from a collection",
Expand Down
2 changes: 2 additions & 0 deletions messages/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"store/pricing.from": "De",
"store/pricing.to": "Para",
"store/button-label": "Comprar",
"store/sponsored-badge.label": "Patrocinado",
"admin/editor.productSummary.title": "Resumen del producto",
"admin/editor.productSummary.description": "El resumen del producto que muestra la información principal del producto",
"admin/editor.productSummary.isOneClickBuy.title": "Redirigir al checkout después de hacer clic en comprar",
Expand Down Expand Up @@ -39,6 +40,7 @@
"admin/editor.productSummaryImage.hoverImage.criteria.index": "Índice de la imagen activable",
"admin/editor.productSummaryBuyButton.title": "Botón de compra del resumen del producto",
"admin/editor.productSummaryName.title": "Nombre del resumen del producto",
"admin/editor.productSummaryName.sponsoredBadge.title": "Texto de la etiqueta de producto patrocinado, si corresponde",
"admin/editor.product-summary-specification-badges.title": "Insignias de especificación del resumen del producto",
"admin/editor.productSummaryList.title": "Lista de productos",
"admin/editor.productSummaryList.description": "Una lista de productos que tiene una colección",
Expand Down
2 changes: 2 additions & 0 deletions messages/fr-FR.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"store/pricing.from": "De",
"store/pricing.to": "À",
"store/button-label": "Acheter",
"store/sponsored-badge.label": "Sponsorisé",
"admin/editor.productSummary.title": "Synthèse de produit",
"admin/editor.productSummary.description": "La synthèse du produit affichant les principales informations sur le produit",
"admin/editor.productSummary.isOneClickBuy.title": "Doit être redirigé vers la caisse après avoir cliqué sur Acheter",
Expand Down Expand Up @@ -37,6 +38,7 @@
"admin/editor.productSummaryImage.hoverImage.criteria.label": "Pointer l’étiquette de l’image",
"admin/editor.productSummaryImage.hoverImage.criteria.matchCriteria": "Critères de recherche pour pointer l’étiquette de l’image (exact : trouve l’image correspondant exactement au nom rempli dans le champ 'Pointer l’étiquette de l’image' | contenus : trouve la première image qui contient le texte rempli dans le champ 'Pointer l’étiquette de l’image')",
"admin/editor.productSummaryImage.hoverImage.criteria.index": "Pointer l’index de l’image",
"admin/editor.productSummaryName.sponsoredBadge.title": "Texte de l'étiquette du produit sponsorisé, le cas échéant",
"admin/editor.productSummaryBuyButton.title": "Bouton d’achat de la synthèse du produit",
"admin/editor.productSummaryName.title": "Nom de la synthèse du produit",
"admin/editor.product-summary-specification-badges.title": "Spécification des badges de la synthèse du produit",
Expand Down
2 changes: 2 additions & 0 deletions messages/id-ID.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"store/pricing.from": "Dari",
"store/pricing.to": "Ke",
"store/button-label": "Beli",
"store/sponsored-badge.label": "Disponsori",
"admin/editor.productSummary.title": "Ringkasan Produk",
"admin/editor.productSummary.description": "Ringkasan produk menampilkan informasi produk utama",
"admin/editor.productSummary.isOneClickBuy.title": "Seharusnya dialihkan ke checkout setelah mengklik beli",
Expand Down Expand Up @@ -37,6 +38,7 @@
"admin/editor.productSummaryImage.hoverImage.criteria.label": "Label Gambar Mengambang",
"admin/editor.productSummaryImage.hoverImage.criteria.matchCriteria": "Kriteria pencarian label gambar mengambang (persis: temukan gambar yang sama persis dengan nama yang terisi di bidang 'Label Gambar Mengambang’| berisi: temukan gambar pertama yang berisi teks yang terisi di bidang 'Label Gambar Mengambang')",
"admin/editor.productSummaryImage.hoverImage.criteria.index": "Indeks Gambar Mengambang",
"admin/editor.productSummaryName.sponsoredBadge.title": "Teks tag produk bersponsor, jika ada",
"admin/editor.productSummaryBuyButton.title": "Tombol Beli Ringkasan Produk",
"admin/editor.productSummaryName.title": "Nama Ringkasan Produk",
"admin/editor.product-summary-specification-badges.title": "Badge Spesifikasi Ringkasan Produk",
Expand Down
2 changes: 2 additions & 0 deletions messages/it-IT.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"store/pricing.from": "Da",
"store/pricing.to": "A",
"store/button-label": "Compra",
"store/sponsored-badge.label": "Sponsorizzato",
"admin/editor.productSummary.title": "Riepilogo del prodotto",
"admin/editor.productSummary.description": "Il riepilogo del prodotto mostra le principali informazioni sul prodotto",
"admin/editor.productSummary.isOneClickBuy.title": "Dovrebbe reindirizzare l'utente al checkout dopo aver cliccato su \"Acquista\"",
Expand Down Expand Up @@ -37,6 +38,7 @@
"admin/editor.productSummaryImage.hoverImage.criteria.label": "Etichetta dell'immagine secondaria",
"admin/editor.productSummaryImage.hoverImage.criteria.matchCriteria": "Criterio di ricerca dell'etichetta dell'immagine secondaria (exact: trova l'immagine che corrisponde esattamente al nome inserito nel campo \"Etichetta dell'immagine secondaria\" | contains: trova la prima immagine che contiene il testo inserito nel campo \"Etichetta dell'immagina secondaria\")",
"admin/editor.productSummaryImage.hoverImage.criteria.index": "Indice dell'immagine secondaria",
"admin/editor.productSummaryName.sponsoredBadge.title": "Testo del tag del prodotto sponsorizzato, se applicabile",
"admin/editor.productSummaryBuyButton.title": "Pulsante \"Acquista\" nel riepilogo del prodotto",
"admin/editor.productSummaryName.title": "Nome nel riepilogo del prodotto",
"admin/editor.product-summary-specification-badges.title": "Badge per le specifiche nel riepilogo del prodotto",
Expand Down
2 changes: 2 additions & 0 deletions messages/ja-JP.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"store/pricing.from": "開始",
"store/pricing.to": "終了",
"store/button-label": "購入する",
"store/sponsored-badge.label": "スポンサー付き",
"admin/editor.productSummary.title": "製品サマリ",
"admin/editor.productSummary.description": "主な製品情報を表示する製品サマリ",
"admin/editor.productSummary.isOneClickBuy.title": "購入をクリックした後でチェックアウトにリダイレクトしなければなりません",
Expand Down Expand Up @@ -37,6 +38,7 @@
"admin/editor.productSummaryImage.hoverImage.criteria.label": "マウスオーバー画像ラベル",
"admin/editor.productSummaryImage.hoverImage.criteria.matchCriteria": "マウスオーバー画像ラベル検索の基準 (すべて一致: 「マウスオーバー画像ラベル」フィールドの名前フィールドとすべて一致する画像を探します | 含む: 「マウスオーバー画像ラベル」フィールドのテキストフィールドを含む最初の画像を探します)",
"admin/editor.productSummaryImage.hoverImage.criteria.index": "マウスオーバー画像インデックス",
"admin/editor.productSummaryName.sponsoredBadge.title": "スポンサー付き商品タグのテキスト(該当する場合)",
"admin/editor.productSummaryBuyButton.title": "製品サマリ購入ボタン",
"admin/editor.productSummaryName.title": "製品サマリ名",
"admin/editor.product-summary-specification-badges.title": "製品サマリ指定バッジ",
Expand Down
2 changes: 2 additions & 0 deletions messages/ko-KR.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"store/pricing.from": "에서",
"store/pricing.to": "까지",
"store/button-label": "구매",
"store/sponsored-badge.label": "후원",
"admin/editor.productSummary.title": "제품 요약",
"admin/editor.productSummary.description": "주요 제품 정보를 보여주는 제품 요약",
"admin/editor.productSummary.isOneClickBuy.title": "구매를 클릭한 후 체크아웃으로 리디렉션",
Expand Down Expand Up @@ -37,6 +38,7 @@
"admin/editor.productSummaryImage.hoverImage.criteria.label": "호버 이미지 라벨",
"admin/editor.productSummaryImage.hoverImage.criteria.matchCriteria": "호버 이미지 라벨 검색 조건(정확: '호버 이미지 라벨' 필드에 입력된 이름과 정확히 일치하는 이미지를 찾습니다. | 포함: '호버 이미지 라벨' 필드에 입력된 텍스트를 포함하는 첫 번째 이미지를 찾습니다.)",
"admin/editor.productSummaryImage.hoverImage.criteria.index": "호버 이미지 인덱스",
"admin/editor.productSummaryName.sponsoredBadge.title": "해당되는 경우 스폰서 제품 태그의 텍스트",
"admin/editor.productSummaryBuyButton.title": "제품 요약 구매 버튼",
"admin/editor.productSummaryName.title": "제품 요약 이름",
"admin/editor.product-summary-specification-badges.title": "제품 요약 사양 배지",
Expand Down
2 changes: 2 additions & 0 deletions messages/nl-NL.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"store/pricing.from": "Van",
"store/pricing.to": "Naar",
"store/button-label": "Koop",
"store/sponsored-badge.label": "Gesponsord",
"admin/editor.productSummary.title": "Productoverzicht",
"admin/editor.productSummary.description": "Het productoverzicht met de belangrijkste productinformatie",
"admin/editor.productSummary.isOneClickBuy.title": "Moet doorverwijzen naar kassa na klikken op kopen",
Expand Down Expand Up @@ -37,6 +38,7 @@
"admin/editor.productSummaryImage.hoverImage.criteria.label": "Aanwijzen afbeeldingslabel",
"admin/editor.productSummaryImage.hoverImage.criteria.matchCriteria": "Zoekcriteria voor afbeeldingslabel zweven (exact: vindt de afbeelding die exact overeenkomt met de naam die is ingevuld in het veld 'Afbeeldingslabel zweven' | bevat: vindt de eerste afbeelding die de tekst bevat die is ingevuld in het veld 'Afbeeldingslabel zweven')",
"admin/editor.productSummaryImage.hoverImage.criteria.index": "Aanwijzen afbeeldingsindex",
"admin/editor.productSummaryName.sponsoredBadge.title": "Tekst van de gesponsorde producttag, indien van toepassing",
"admin/editor.productSummaryBuyButton.title": "Productoverzicht koopknop",
"admin/editor.productSummaryName.title": "Productoverzicht naam",
"admin/editor.product-summary-specification-badges.title": "Productoverzicht specificatiebadges",
Expand Down
2 changes: 2 additions & 0 deletions messages/nn-NO.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"store/pricing.from": "Fra",
"store/pricing.to": "Til",
"store/button-label": "Kjøp",
"store/sponsored-badge.label": "Sponset",
"admin/editor.productSummary.title": "Produktsammendrag",
"admin/editor.productSummary.description": "Produktsammendraget viser hovedproduktinformasjonen",
"admin/editor.productSummary.isOneClickBuy.title": "Bør omdirigere til kassen etter klikk på kjøp",
Expand Down Expand Up @@ -37,6 +38,7 @@
"admin/editor.productSummaryImage.hoverImage.criteria.label": "Pek med musepekeren på bildeetikett",
"admin/editor.productSummaryImage.hoverImage.criteria.matchCriteria": "Søkekriterier for pek med musepekeren på bildeetikett (nøyaktig: finner bildet som samsvarer nøyaktig med navnet fylt ut i feltet \"Pek med musepekeren på bildeetikett\" | inneholder: finner det første bildet som inneholder teksten fylt ut i \"Pek med musepekeren på bildeetikett\" -feltet)",
"admin/editor.productSummaryImage.hoverImage.criteria.index": "Indeks for Pek med musepekeren på bildet",
"admin/editor.productSummaryName.sponsoredBadge.title": "Tekst til den sponsede produktetiketten, hvis aktuelt",
"admin/editor.productSummaryBuyButton.title": "Kjøpsknapp for produktsammendrag",
"admin/editor.productSummaryName.title": "Navn på produktsammendrag",
"admin/editor.product-summary-specification-badges.title": "Spesifikasjonsmerker for produktsammendrag",
Expand Down
2 changes: 2 additions & 0 deletions messages/no-NO.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"store/pricing.from": "Fra",
"store/pricing.to": "Til",
"store/button-label": "Kjøp",
"store/sponsored-badge.label": "Sponset",
"admin/editor.productSummary.title": "Produktsammendrag",
"admin/editor.productSummary.description": "Produktsammendraget viser hovedproduktinformasjonen",
"admin/editor.productSummary.isOneClickBuy.title": "Bør omdirigere til kassen etter klikk på kjøp",
Expand Down Expand Up @@ -37,6 +38,7 @@
"admin/editor.productSummaryImage.hoverImage.criteria.label": "Pek med musepekeren på bildeetikett",
"admin/editor.productSummaryImage.hoverImage.criteria.matchCriteria": "Søkekriterier for pek med musepekeren på bildeetikett (nøyaktig: finner bildet som samsvarer nøyaktig med navnet fylt ut i feltet \"Pek med musepekeren på bildeetikett\" | inneholder: finner det første bildet som inneholder teksten fylt ut i \"Pek med musepekeren på bildeetikett\" -feltet)",
"admin/editor.productSummaryImage.hoverImage.criteria.index": "Indeks for Pek med musepekeren på bildet",
"admin/editor.productSummaryName.sponsoredBadge.title": "Tekst til den sponsede produktetiketten, hvis aktuelt",
"admin/editor.productSummaryBuyButton.title": "Kjøpsknapp for produktsammendrag",
"admin/editor.productSummaryName.title": "Navn på produktsammendrag",
"admin/editor.product-summary-specification-badges.title": "Spesifikasjonsmerker for produktsammendrag",
Expand Down
Loading

0 comments on commit bb563ce

Please sign in to comment.