@nuskin/product-components 3.20.0-mdigi-7127.1 → 3.20.0-mdigi-7127.3

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.
@@ -46,7 +46,7 @@
46
46
 
47
47
  <script>
48
48
  import { NsExpressiveLink, NsIcon, NsSpinner } from "@nuskin/design-components";
49
- import { StringService, RunConfigService } from "@nuskin/ns-util";
49
+ import { StringService, RunConfigService, events } from "@nuskin/ns-util";
50
50
  import { fromJsonString } from "@nuskin/ns-common-lib";
51
51
  import { CurrencyService } from "@nuskin/ns-shop";
52
52
 
@@ -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,14 +177,50 @@ export default {
174
177
  async mounted() {
175
178
  await this.setCommonStrings();
176
179
  const runConfig = RunConfigService.getRunConfig();
177
- this.currencyCode = CurrencyService.getCurrency(runConfig.country).currencyCode;
178
- if (window.dataLayer) {
179
- window.dataLayer.push({
180
- event: 'pageView',
181
- pageType: 'Listing',
182
- currency: this.currencyCode
183
- });
184
- }
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
+
219
+ events.publish(events.shop.PAGE_VIEW, {
220
+ event: "pageView",
221
+ pageType: "category",
222
+ currency: this.currencyCode
223
+ });
185
224
  },
186
225
  methods: {
187
226
  handleProductUpdate(product) {
package/docs/CHANGELOG.md CHANGED
@@ -1 +1 @@
1
- # [3.20.0-mdigi-7127.1](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.19.1...v3.20.0-mdigi-7127.1) (2025-12-30)
1
+ # [3.20.0-mdigi-7127.3](https://code.tls.nuskin.io/ns-am/ux/product-components/compare/v3.20.0-mdigi-7127.2...v3.20.0-mdigi-7127.3) (2026-01-07)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nuskin/product-components",
3
- "version": "3.20.0-mdigi-7127.1",
3
+ "version": "3.20.0-mdigi-7127.3",
4
4
  "description": "Nu Skin Product Components",
5
5
  "main": "index.js",
6
6
  "scripts": {