mkfashion-sdk 2.3.1 → 2.3.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.
package/index.html CHANGED
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>Provador Virtual</title>
7
- <script src="https://unpkg.com/mkfashion-sdk/src/mkfashion.js"></script>
7
+ <script src="./src/mkfashion.js"></script>
8
8
  </head>
9
9
  <body>
10
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mkfashion-sdk",
3
- "version": "2.3.1",
3
+ "version": "2.3.3",
4
4
  "description": "SDK para integrar o provador virtual mKFashion com suporte a Wake Commerce",
5
5
  "main": "src/mkfashion.js",
6
6
  "scripts": {
package/src/mkfashion.js CHANGED
@@ -121,7 +121,7 @@ const mkfashion = {
121
121
  * Registra callback de adicionar ao carrinho.
122
122
  *
123
123
  * Payload simplificado (não-Gregory):
124
- * { name, mainIdentifier, selectedIdentifier, selectedSize, sizePrice, tryonImageUrl, productUrl, price }
124
+ * { mainIdentifier, selectedIdentifier, name, price, sizePrice, selectedSize, productUrl, tryonImageUrl }
125
125
  *
126
126
  * Projetos Gregory mantêm estrutura legada completa.
127
127
  */
@@ -608,7 +608,7 @@ const mkfashion = {
608
608
  p.cor = p.color
609
609
  p.preco = { de: p.compareAtPrice, por: p.price }
610
610
  p.sizeSku = p.variantSku || p.produtoVarianteId || identifierValue
611
- p.productVariantId = p.produtoVarianteId || p.variantSku
611
+ p.productVariantId = p.produtoVarianteId || p.variantSku || identifierValue
612
612
  p.imagem = p.originalImageUrl
613
613
  p.url = p.productUrl
614
614
  }
@@ -616,14 +616,14 @@ const mkfashion = {
616
616
  // Fluxo simplificado
617
617
  const product = data?.product || {}
618
618
  callbackPayload = {
619
- name: product.name || null,
620
619
  mainIdentifier: identifierValue,
621
620
  selectedIdentifier: product.variantSku || null,
622
- selectedSize: data?.size || null,
621
+ name: product.name || null,
622
+ price: product.price || null,
623
623
  sizePrice: product.sizePrice || null,
624
- tryonImageUrl: product.tryonImageUrl || null,
624
+ selectedSize: data?.size || null,
625
625
  productUrl: product.productUrl || null,
626
- price: product.price || null
626
+ tryonImageUrl: product.tryonImageUrl || null
627
627
  }
628
628
  }
629
629