Subversion Repositories munaweb

Rev

Rev 6 | Rev 10 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6 Rev 7
Line 3473... Line 3473...
3473
    xhttp.send();
3473
    xhttp.send();
3474
 
3474
 
3475
    return false;
3475
    return false;
3476
}
3476
}
3477
 
3477
 
3478
function findShopifyDuplicateListing() {
3478
function findShopifyDuplicateListing() { // Barcode Search
3479
    var handle;
3479
    var handle;
3480
    var xhttp = new XMLHttpRequest();
3480
    var xhttp = new XMLHttpRequest();
3481
    xhttp.onreadystatechange = function() {
3481
    xhttp.onreadystatechange = function() {
3482
        if (this.readyState == 4 && this.status == 200) {
3482
        if (this.readyState == 4 && this.status == 200) {
3483
            //window.alert(this.responseText);
3483
            //window.alert(this.responseText);
3484
            var json = JSON.parse(this.responseText);
3484
            var json = JSON.parse(this.responseText);
3485
            if (json.products[0] !== undefined) {
3485
            if (json.products[0] !== undefined) {
-
 
3486
			    var sku = getJsonValue(json.products[0].variants[0].sku);
3486
                document.getElementById("productinfo").innerHTML += '<p class="w3-orange"><strong>Potential Duplicate, see Shopify Item Id <a href="https://munatrading.com/products/' + handle + '" target="_blank">' + handle + '</a></strong></p>';
3487
                document.getElementById("productinfo").innerHTML += '<p class="w3-orange"><strong>Potential Duplicate, see Shopify Item Id <a href="https://munatrading.com/products/b' + handle + '" target="_blank">' + handle + '</a> (SKU=' + sku + ')</strong></p>';
3487
            }
3488
            }
3488
        }
3489
        }
3489
    };
3490
    };
3490
 
3491
 
3491
    handle = parseInt(document.getElementById('keyword').value, 10);
3492
    handle = parseInt(document.getElementById('keyword').value, 10);
3492
 
3493
 
3493
    xhttp.open("GET", configProxyUrl, true);
3494
    xhttp.open("GET", configProxyUrl, true);
3494
    xhttp.setRequestHeader("X-Proxy-Url", encodeURI(configShopifyUrl + configShopifyProductsUrl + '?handle=' + handle + '&fields=id'));
3495
	xhttp.setRequestHeader("X-Proxy-Url", encodeURI(configShopifyUrl + configShopifyProductsUrl + '?handle=b' + handle + '&fields=id,variants'));
3495
    xhttp.send();
3496
    xhttp.send();
3496
}
3497
}
3497
 
3498
 
3498
function connected() {
3499
function connected() {
3499
    var x;
3500
    var x;