mkfashion-sdk 2.3.6 → 2.3.9
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 +2 -2
- package/mkfashion-sdk-2.3.9.tgz +0 -0
- package/package.json +1 -1
- package/src/mkfashion.js +8 -4
- package/mkfashion-sdk-2.3.6.tgz +0 -0
package/index.html
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
|
|
13
13
|
<script>
|
|
14
14
|
(function() {
|
|
15
|
-
var projectid = '
|
|
16
|
-
var identifier = '
|
|
15
|
+
var projectid = '698c806c1d3129430f15ddde';
|
|
16
|
+
var identifier = '1183C102.751';
|
|
17
17
|
|
|
18
18
|
function initMkFashion() {
|
|
19
19
|
mkfashion.addToCart(function(payload) {
|
|
Binary file
|
package/package.json
CHANGED
package/src/mkfashion.js
CHANGED
|
@@ -251,7 +251,7 @@ const mkfashion = {
|
|
|
251
251
|
this._log('Verificando disponibilidade', { projectId: resolved, identifier })
|
|
252
252
|
|
|
253
253
|
try {
|
|
254
|
-
const url = `${this.apiUrl}/availability/${resolved}/${identifier}`
|
|
254
|
+
const url = `${this.apiUrl}/availability/${resolved}/${encodeURIComponent(identifier).replace(/\./g, '%2E')}`
|
|
255
255
|
const response = await fetch(url)
|
|
256
256
|
|
|
257
257
|
if (!response.ok) {
|
|
@@ -341,14 +341,14 @@ const mkfashion = {
|
|
|
341
341
|
this._log('Buscando produto', { projectId: resolved, identifier })
|
|
342
342
|
|
|
343
343
|
try {
|
|
344
|
-
const url = `${this.apiUrl}/products/${resolved}/${identifier}`
|
|
344
|
+
const url = `${this.apiUrl}/products/${resolved}/${encodeURIComponent(identifier).replace(/\./g, '%2E')}`
|
|
345
345
|
const response = await fetch(url)
|
|
346
346
|
|
|
347
347
|
if (!response.ok) {
|
|
348
348
|
// Fallback: tenta com productId do config caso caller tenha passado variantSku
|
|
349
349
|
if (response.status === 404 && this._config?.identifier && this._config.identifier !== identifier) {
|
|
350
350
|
this._log(`Identifier ${identifier} não encontrado, tentando com productId: ${this._config.identifier}`)
|
|
351
|
-
const fallbackUrl = `${this.apiUrl}/products/${resolved}/${this._config.identifier}`
|
|
351
|
+
const fallbackUrl = `${this.apiUrl}/products/${resolved}/${encodeURIComponent(this._config.identifier).replace(/\./g, '%2E')}`
|
|
352
352
|
const fallbackResponse = await fetch(fallbackUrl)
|
|
353
353
|
if (fallbackResponse.ok) {
|
|
354
354
|
const data = await fallbackResponse.json()
|
|
@@ -409,7 +409,10 @@ const mkfashion = {
|
|
|
409
409
|
},
|
|
410
410
|
|
|
411
411
|
_buildUrl() {
|
|
412
|
-
|
|
412
|
+
const encoded = encodeURIComponent(this._config.identifier).replace(/\./g, '%2E')
|
|
413
|
+
const url = `${this.appUrl}/${this._config.projectId}/${encoded}`
|
|
414
|
+
console.log('[mKFashion] iframe URL:', url)
|
|
415
|
+
return url
|
|
413
416
|
},
|
|
414
417
|
|
|
415
418
|
_openModal() {
|
|
@@ -676,6 +679,7 @@ const mkfashion = {
|
|
|
676
679
|
price: product.price || null,
|
|
677
680
|
sizePrice: product.sizePrice || null,
|
|
678
681
|
selectedSize: data?.size || null,
|
|
682
|
+
produtoVarianteId: product.produtoVarianteId || null,
|
|
679
683
|
productUrl: product.productUrl || null,
|
|
680
684
|
tryonImageUrl: product.tryonImageUrl || null
|
|
681
685
|
}
|
package/mkfashion-sdk-2.3.6.tgz
DELETED
|
Binary file
|