@nuskin/product-components 3.20.0-mdigi-7127.2 → 3.20.0-mdigi-7127.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -125,6 +125,9 @@ export default {
|
|
|
125
125
|
};
|
|
126
126
|
},
|
|
127
127
|
computed: {
|
|
128
|
+
isLoggedIn() {
|
|
129
|
+
return this.$NsProductUserService.isLoggedIn;
|
|
130
|
+
},
|
|
128
131
|
localLink() {
|
|
129
132
|
return fromJsonString(this.link, {});
|
|
130
133
|
},
|
|
@@ -174,10 +177,48 @@ export default {
|
|
|
174
177
|
async mounted() {
|
|
175
178
|
await this.setCommonStrings();
|
|
176
179
|
const runConfig = RunConfigService.getRunConfig();
|
|
177
|
-
this.currencyCode = CurrencyService.getCurrency(
|
|
180
|
+
this.currencyCode = CurrencyService.getCurrency(
|
|
181
|
+
runConfig.country
|
|
182
|
+
).currencyCode;
|
|
183
|
+
this.$watch(
|
|
184
|
+
() => this.$NsProductDataService.batches,
|
|
185
|
+
() => {
|
|
186
|
+
const products = this.displayedSkus
|
|
187
|
+
.map(sku => this.$NsProductDataService.get(sku))
|
|
188
|
+
.filter(p => p);
|
|
189
|
+
|
|
190
|
+
if (products.length > 0) {
|
|
191
|
+
const priceType = this.$NsProductDataService.getPriceType();
|
|
192
|
+
const isWholesale = priceType === "WWHL";
|
|
193
|
+
|
|
194
|
+
events.publish(events.shop.PRODUCT_IMPRESSION, {
|
|
195
|
+
ecommerce: {
|
|
196
|
+
currencyCode: this.currencyCode,
|
|
197
|
+
revenue: "",
|
|
198
|
+
impressions: products.map(product => ({
|
|
199
|
+
id: product.sku,
|
|
200
|
+
name: product.title,
|
|
201
|
+
price: product.price,
|
|
202
|
+
taxonomy:
|
|
203
|
+
product.categories?.[0]?.displayName || "all_products",
|
|
204
|
+
sales_price: this.isLoggedIn
|
|
205
|
+
? isWholesale
|
|
206
|
+
? product?.price?.wholesaleSales ||
|
|
207
|
+
product?.price?.wholesale
|
|
208
|
+
: product?.price?.retailSales || product?.price?.retail
|
|
209
|
+
: null,
|
|
210
|
+
unit_price: this.isLoggedIn ? product?.price : null
|
|
211
|
+
}))
|
|
212
|
+
}
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
{ deep: true, immediate: true }
|
|
217
|
+
);
|
|
218
|
+
|
|
178
219
|
events.publish(events.shop.PAGE_VIEW, {
|
|
179
|
-
event:
|
|
180
|
-
pageType:
|
|
220
|
+
event: "pageView",
|
|
221
|
+
pageType: "category",
|
|
181
222
|
currency: this.currencyCode
|
|
182
223
|
});
|
|
183
224
|
},
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
</template>
|
|
15
15
|
|
|
16
16
|
<script>
|
|
17
|
-
import { CartService } from "@nuskin/ns-shop";
|
|
18
|
-
import { events } from "@nuskin/ns-util";
|
|
17
|
+
import { CartService, CurrencyService } from "@nuskin/ns-shop";
|
|
18
|
+
import { events, RunConfigService } from "@nuskin/ns-util";
|
|
19
19
|
import {
|
|
20
20
|
getPersonalizedRecommendations,
|
|
21
21
|
getRelatedProducts
|
|
@@ -68,6 +68,11 @@ export default {
|
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
70
|
created() {
|
|
71
|
+
const runConfig = RunConfigService.getRunConfig();
|
|
72
|
+
this.currencyCode = CurrencyService.getCurrency(
|
|
73
|
+
runConfig.country
|
|
74
|
+
).currencyCode;
|
|
75
|
+
|
|
71
76
|
// When items are added to the cart, omit them from recommendations.
|
|
72
77
|
events.subscribe(events.shop.CART_UPDATED, info => {
|
|
73
78
|
if (info.add) {
|
|
@@ -92,6 +97,11 @@ export default {
|
|
|
92
97
|
},
|
|
93
98
|
true
|
|
94
99
|
);
|
|
100
|
+
events.publish(events.shop.PAGE_VIEW, {
|
|
101
|
+
event: "pageView",
|
|
102
|
+
pageType: "category_listing",
|
|
103
|
+
currency: this.currencyCode
|
|
104
|
+
});
|
|
95
105
|
},
|
|
96
106
|
mounted() {
|
|
97
107
|
this.initRecommendations(this.productId);
|
package/docs/CHANGELOG.md
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
# [3.20.0-mdigi-7127.
|
|
1
|
+
# [3.20.0-mdigi-7127.4](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.20.0-mdigi-7127.3...v3.20.0-mdigi-7127.4) (2026-01-07)
|