-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bugfix/thumbnail images of products in view order #3273
Changes from 2 commits
a4840eb
26b3cd8
bf536a9
3f162a4
1619e9c
2cd28e5
84c24b0
6916cc1
bc53db3
ca4c5d8
b92c93a
648d192
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -44,6 +44,9 @@ | |||||
<th class="serif lh20"> | ||||||
{{ $t('Subtotal') }} | ||||||
</th> | ||||||
<th class="serif lh20"> | ||||||
{{ $t('Thumbnail') }} | ||||||
</th> | ||||||
</tr> | ||||||
</thead> | ||||||
<tbody> | ||||||
|
@@ -63,35 +66,38 @@ | |||||
<td class="fs-medium lh25" :data-th="$t('Subtotal')"> | ||||||
{{ item.row_total_incl_tax | price }} | ||||||
</td> | ||||||
<td class="fs-medium lh25"> | ||||||
<img :src="getProductThumbnail(item.sku)"> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i would be nice to use ProductImage component here, to show placeholders until proper product image is loaded |
||||||
</td> | ||||||
</tr> | ||||||
</tbody> | ||||||
<tfoot> | ||||||
<tr class="brdr-top-1 brdr-cl-bg-secondary"> | ||||||
<td colspan="4" class="align-right"> | ||||||
<td colspan="5" class="align-right"> | ||||||
{{ $t('Subtotal') }} | ||||||
</td> | ||||||
<td>{{ order.subtotal | price }}</td> | ||||||
</tr> | ||||||
<tr> | ||||||
<td colspan="4" class="align-right"> | ||||||
<td colspan="5" class="align-right"> | ||||||
{{ $t('Shipping') }} | ||||||
</td> | ||||||
<td>{{ order.shipping_amount | price }}</td> | ||||||
</tr> | ||||||
<tr> | ||||||
<td colspan="4" class="align-right"> | ||||||
<td colspan="5" class="align-right"> | ||||||
{{ $t('Tax') }} | ||||||
</td> | ||||||
<td>{{ order.tax_amount + order.discount_tax_compensation_amount | price }}</td> | ||||||
</tr> | ||||||
<tr v-if="order.discount_amount"> | ||||||
<td colspan="4" class="align-right"> | ||||||
<td colspan="5" class="align-right"> | ||||||
{{ $t('Discount') }} | ||||||
</td> | ||||||
<td>{{ order.discount_amount | price }}</td> | ||||||
</tr> | ||||||
<tr> | ||||||
<td colspan="4" class="align-right"> | ||||||
<td colspan="5" class="align-right"> | ||||||
{{ $t('Grand total') }} | ||||||
</td> | ||||||
<td>{{ order.grand_total | price }}</td> | ||||||
|
@@ -139,13 +145,33 @@ | |||||
<script> | ||||||
import MyOrder from '@vue-storefront/core/compatibility/components/blocks/MyAccount/MyOrder' | ||||||
import ReturnIcon from 'theme/components/core/blocks/Header/ReturnIcon' | ||||||
import { getThumbnailPath } from '@vue-storefront/core/helpers' | ||||||
import { mapActions } from 'vuex' | ||||||
|
||||||
export default { | ||||||
mixins: [MyOrder], | ||||||
components: { | ||||||
ReturnIcon | ||||||
}, | ||||||
data () { | ||||||
return { | ||||||
itemThumbnail: [] | ||||||
} | ||||||
}, | ||||||
methods: { | ||||||
...mapActions({ | ||||||
getProduct: 'product/single' | ||||||
}), | ||||||
getProductThumbnail (productSku) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
if (this.itemThumbnail[productSku] === undefined || this.itemThumbnail[productSku] === null) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. it is the same as this, but more readable
Suggested change
|
||||||
this.getProduct({ options: { sku: productSku }, setCurrentProduct: false, setCurrentCategoryPath: false, selectDefaultVariant: false, skipCache: true }) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
.then(product => { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
this.itemThumbnail[productSku] = getThumbnailPath(product.image, 80, 80) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
}) | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} | ||||||
return this.itemThumbnail[productSku] | ||||||
} | ||||||
} | ||||||
|
||||||
} | ||||||
</script> | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this needs to be moved into 1.11 changelog