From 9fc8c47bfaa4ab1bad8bcf595372faf70b6f54ff Mon Sep 17 00:00:00 2001 From: Anton Sylka Date: Mon, 30 Sep 2024 15:09:23 +0700 Subject: [PATCH 1/8] Refs #33164: Product Price - update after promotional campaign content changed --- components/atoms/a-product-price.vue | 4 ++++ components/molecules/m-product-carousel.vue | 4 ++++ components/organisms/o-cart-items-table.vue | 5 +++++ components/organisms/o-confirm-order.vue | 11 +++++++---- .../organisms/o-cross-sells-products-selector.vue | 5 +++++ components/organisms/o-product-details.vue | 4 ++++ components/storyblok/Product.vue | 5 +++++ helpers/use-related-products.ts | 5 +++++ pages/Category.vue | 4 ++++ 9 files changed, 43 insertions(+), 4 deletions(-) diff --git a/components/atoms/a-product-price.vue b/components/atoms/a-product-price.vue index 56ad7b6a5..ef841afb0 100644 --- a/components/atoms/a-product-price.vue +++ b/components/atoms/a-product-price.vue @@ -25,7 +25,11 @@ export default { } }, computed: { + campaignContent () { + return this.$store.getters['promotionPlatform/campaignContent']; + }, price () { + const _ = this.campaignContent; return getProductDefaultPrice(this.product, this.customOptions, false) } } diff --git a/components/molecules/m-product-carousel.vue b/components/molecules/m-product-carousel.vue index 4290fede4..c3de69bd6 100644 --- a/components/molecules/m-product-carousel.vue +++ b/components/molecules/m-product-carousel.vue @@ -57,7 +57,11 @@ export default { } }, computed: { + campaignContent () { + return this.$store.getters['promotionPlatform/campaignContent']; + }, carouselProducts () { + const _ = this.campaignContent; return this.products.map(prepareCategoryProduct); } } diff --git a/components/organisms/o-cart-items-table.vue b/components/organisms/o-cart-items-table.vue index 67aece63f..8907c0174 100644 --- a/components/organisms/o-cart-items-table.vue +++ b/components/organisms/o-cart-items-table.vue @@ -14,6 +14,7 @@ import { getCartItemPrice } from 'src/modules/shared'; import CartItem from 'core/modules/cart/types/CartItem'; import getCartItemKey from 'src/modules/budsies/helpers/get-cart-item-key.function'; import { getCustomizationSystemCartItemThumbnail } from 'src/modules/customization-system'; +import CampaignContent from 'src/modules/promotion-platform/types/CampaignContent.model'; import { getCartItemOptions } from 'theme/helpers/get-cart-item-options.function'; import { OrderContentItem } from '../interfaces/order-content-item.interface'; @@ -48,7 +49,11 @@ export default { } }, computed: { + campaignContent (): CampaignContent | undefined { + return this.$store.getters['promotionPlatform/campaignContent']; + }, tableItems (): OrderContentItem[] { + const _ = this.campaignContent; return this.cartItems.map((cartItem) => { return { key: this.getCartItemKey(cartItem), diff --git a/components/organisms/o-confirm-order.vue b/components/organisms/o-confirm-order.vue index a801cca63..8d428e5ac 100644 --- a/components/organisms/o-confirm-order.vue +++ b/components/organisms/o-confirm-order.vue @@ -85,8 +85,8 @@ v-model="product.qty" :image="getThumbnailForProduct(product)" :title="product.name | htmlDecode" - :regular-price="getProductRegularPrice(product)" - :special-price="getProductSpecialPrice(product)" + :regular-price="getProductRegularPrice(product, campaignContent)" + :special-price="getProductSpecialPrice(product, campaignContent)" class="collected-product" >