Skip to content

Commit

Permalink
Updated: usage of productId from currentVarient object(#386)
Browse files Browse the repository at this point in the history
  • Loading branch information
R-Sourabh committed May 21, 2024
1 parent 13c2edf commit cad494f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/views/ProductDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
</div>
</section>
</div>

<div v-if="otherItem.length > 0">
<h3>{{ translate('order reservtions at the store', { count: getInventoryInformation(currentVariant.productId).reservedQuantity ?? '0' }) }}</h3>
<div class="reservation-section">
Expand All @@ -114,7 +114,7 @@
</ion-item>

<!-- other items -->
<ion-list-header n-list-header color="light" v-if="order.parts[0].items.some((item: any) => item.productId != product.variants[0].productId)">
<ion-list-header n-list-header color="light" v-if="order.parts[0].items.some((item: any) => item.productId != currentVariant.productId)">
<ion-label>Other items</ion-label>
</ion-list-header>
<ion-item lines="none" v-for="(item, index) in getOtherItems(order)" :key="index" >
Expand Down Expand Up @@ -217,10 +217,10 @@ export default defineComponent({
getProduct: 'product/getProduct',
}),
getOrderItems() {
return (order: any) => order.parts[0].items.filter((item: any) => item.productId == this.product.variants[0].productId);
return (order: any) => order.parts[0].items.filter((item: any) => item.productId == this.currentVariant.productId);
},
getOtherItems() {
return (order: any) => order.parts[0].items.filter((item: any) => item.productId != this.product.variants[0].productId);
return (order: any) => order.parts[0].items.filter((item: any) => item.productId != this.currentVariant.productId);
}
},
async beforeMount() {
Expand Down

0 comments on commit cad494f

Please sign in to comment.