Skip to content

Commit

Permalink
Display right prices (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
BobWez98 authored May 22, 2024
1 parent 8d3b491 commit 2bb4893
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion resources/js/components/amastybundles.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
},
itemPrice(index) {
if (!index) {
if (!this.bundle.items[index]) {
return
}
Expand Down
7 changes: 5 additions & 2 deletions resources/views/components/productbundle-item.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@
{{ $image }}
</div>
<div class="text-center my-2">{{ $name }}</div>
<div class="font-bold text-center">@{{ itemPrice(index) }}</div>

@if($firstProduct)
<div class="font-bold text-center">@{{ mainProductPrice | price }}</div>
@else
<div class="font-bold text-center">@{{ itemPrice(index) | price }}</div>
@endif
{{ $slot }}
</div>
</div>
2 changes: 1 addition & 1 deletion resources/views/components/productbundles.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div slot-scope="{ data }" v-if="data">
<div v-for="bundle in data.amMostviewedBundlePacks.items">
<amastybundles :main-product="data.amMostviewedBundlePacks.main_product" :bundle="bundle">
<div class="mb-3" slot-scope="{ bundlePrice, bundleDiscountAmount, selectedProducts, addToCart, options, adding, added, itemPrice }">
<div class="mb-3" slot-scope="{ bundlePrice, bundleDiscountAmount, selectedProducts, mainProductPrice, addToCart, options, adding, added, itemPrice }">
<div class="mb-3 font-bold text-lg">@{{ bundle.block_title }}</div>
<form class="flex flex-col sm:flex-row" v-on:submit.prevent="addToCart">
<x-amastyrelatedproducts::productbundle-item
Expand Down

0 comments on commit 2bb4893

Please sign in to comment.