Skip to content

Commit

Permalink
fix(price card): split product brands into seperate labels (#109)
Browse files Browse the repository at this point in the history
Price card: split brands
  • Loading branch information
raphodn authored Jan 7, 2024
1 parent a1d051b commit 187a549
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/components/PriceCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@

<p v-if="!hideProductDetails" class="mb-2">
<span v-if="hasProductBrands">
<v-chip label size="small" density="comfortable" class="mr-1">
{{ product.brands }}
<v-chip v-for="brand in getPriceProductBrandsList" label size="small" density="comfortable" class="mr-1">
{{ brand }}
</v-chip>
</span>
<span v-if="hasProductQuantity">
Expand Down Expand Up @@ -126,11 +126,16 @@ export default {
return this.hasPrice && !!this.price.labels_tags && this.price.labels_tags.length
},
getPriceCategoryName() {
if (this.price && this.price.category_tag) {
if (this.price && this.hasCategoryTag) {
const tag = utils.getCategory(this.price.category_tag)
return tag ? tag.name : this.price.category_tag
}
},
getPriceProductBrandsList() {
if (this.hasProductBrands) {
return this.product.brands.split(',')
}
}
},
methods: {
initPriceCard() {
Expand Down

0 comments on commit 187a549

Please sign in to comment.