| 2 |
- |
1 |
<!DOCTYPE html>
|
|
|
2 |
<html lang="en">
|
|
|
3 |
|
|
|
4 |
<head>
|
|
|
5 |
<title>Export eBay Listings to Shopify</title>
|
|
|
6 |
<meta charset="UTF-8">
|
|
|
7 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
8 |
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon">
|
|
|
9 |
<link rel="icon" href="favicon.ico" type="image/x-icon">
|
|
|
10 |
|
|
|
11 |
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
|
|
|
12 |
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
|
|
|
13 |
<link rel="stylesheet" href="css/style.css">
|
|
|
14 |
<link rel="stylesheet" href="css/tablesorter.theme.blue.css">
|
|
|
15 |
<script src="js/XMLWriter.js"></script>
|
|
|
16 |
<script src="js/lodash.min.js"></script>
|
|
|
17 |
<script src="js/muna-tools.js"></script>
|
|
|
18 |
<script src="js/jquery.js"></script>
|
|
|
19 |
<script src="js/jquery.tablesorter.min.js"></script>
|
|
|
20 |
<script src="js/jquery.tablesorter.widgets.js"></script>
|
|
|
21 |
<script src="js/jquery.parser-input-select.js"></script>
|
|
|
22 |
</head>
|
|
|
23 |
|
|
|
24 |
<body onload="return initConfig();">
|
|
|
25 |
<div class="w3-main">
|
|
|
26 |
<div class="w3-container w3-padding w3-margin w3-card-4">
|
|
|
27 |
<div class="w3-container w3-gray" style="height:100px">
|
|
|
28 |
<img class="w3-image" src="images/MUNA%20-%20Logo%20100x100.png" alt="MUNA Trading Logo" style="height:100px">
|
|
|
29 |
<p id="connected" class="w3-xxlarge w3-right">Export eBay Listings to Shopify
|
|
|
30 |
<input id="login" type="button" class="w3-btn w3-large w3-green w3-margin w3-round-large w3-ripple w3-right w3-hide" onclick="eBayLogin();" value="Login" />
|
| 6 |
- |
31 |
</p>
|
| 2 |
- |
32 |
</div>
|
|
|
33 |
|
|
|
34 |
<div class="w3-row">
|
|
|
35 |
<div>
|
|
|
36 |
<form id="searchForm" class="w3-container w3-light-grey w3-padding w3-small" onsubmit="return getListings();">
|
|
|
37 |
<div id="form1div" class="w3-container w3-card-2 w3-cell w3-padding w3-hide">
|
|
|
38 |
<p>
|
|
|
39 |
<input id="completedList" class="w3-radio" type="radio" style="height:1em" name="rptType" value="completedList" checked>
|
|
|
40 |
<label for="completedList">Completed Listings</label>
|
|
|
41 |
</p>
|
|
|
42 |
<p>
|
|
|
43 |
<input id="liveList" class="w3-radio" type="radio" style="height:1em" name="rptType" value="liveList">
|
|
|
44 |
<label for="liveList">Live Listings</label>
|
|
|
45 |
</p>
|
|
|
46 |
<input id="startButton" type="button" class="w3-btn w3-large w3-red w3-margin w3-round-large w3-ripple" onclick="getListings();" value="Start" />
|
| 6 |
- |
47 |
</div>
|
| 2 |
- |
48 |
<div id="form2div" class="w3-container w3-card-2 w3-cell w3-padding w3-hide">
|
|
|
49 |
<input id="downloadButton" type="button" class="w3-btn w3-large w3-black w3-margin w3-round-large w3-ripple" onclick="downloadListings()" value="Download CSV" />
|
| 6 |
- |
50 |
</div>
|
| 2 |
- |
51 |
</form>
|
|
|
52 |
</div>
|
|
|
53 |
<div id="progressBarDiv" class="w3-container w3-padding w3-margin w3-card-4 w3-hide">
|
| 6 |
- |
54 |
<h2 id="progressBarHeader"></h2>
|
| 2 |
- |
55 |
<div class="w3-light-grey">
|
|
|
56 |
<div id="progressBar" class="w3-container w3-green w3-center" style="width:0%">0%</div>
|
|
|
57 |
</div>
|
|
|
58 |
</div>
|
|
|
59 |
<div id="results" class="w3-container w3-padding w3-card-4 w3-hide"></div>
|
|
|
60 |
<div id="csv" class="w3-container w3-padding w3-card-4 w3-hide"></div>
|
|
|
61 |
<div id="logging" class="w3-container w3-padding"></div>
|
|
|
62 |
</div>
|
|
|
63 |
</div>
|
|
|
64 |
|
|
|
65 |
<footer class="w3-container w3-center w3-border-top w3-margin">
|
| 17 |
- |
66 |
<div w3-include-html="php/footer.php"></div>
|
| 2 |
- |
67 |
</footer>
|
|
|
68 |
|
|
|
69 |
</div>
|
|
|
70 |
|
|
|
71 |
<script>
|
|
|
72 |
|
|
|
73 |
// Globals
|
|
|
74 |
var tableName = 'exportTable';
|
|
|
75 |
var tableSorterName = 'selectTable';
|
|
|
76 |
var liveListing;
|
|
|
77 |
var maxPagesToProcess = 0;
|
|
|
78 |
var pagesToProcess = 0;
|
|
|
79 |
var pagesProcessed = 0;
|
|
|
80 |
var maxNotesToAdd = 0;
|
|
|
81 |
var notesToAdd = 0;
|
|
|
82 |
var notesAdded = 0;
|
|
|
83 |
var html = [];
|
|
|
84 |
|
|
|
85 |
// Initialize Configuration Variables
|
|
|
86 |
function initConfig() {
|
|
|
87 |
var x = document.getElementById("form1div");
|
|
|
88 |
if (x.className.indexOf("w3-show") == -1) {
|
|
|
89 |
x.className += " w3-show";
|
|
|
90 |
}
|
|
|
91 |
|
|
|
92 |
eBayAuthToken = readCookie();
|
|
|
93 |
if (eBayAuthToken.length > 0) {
|
|
|
94 |
connected();
|
|
|
95 |
}
|
|
|
96 |
|
|
|
97 |
if (eBayAuthTokenFlag === false) {
|
|
|
98 |
x = document.getElementById("login");
|
|
|
99 |
if (x.className.indexOf("w3-show") == -1) {
|
|
|
100 |
x.className += " w3-show";
|
|
|
101 |
}
|
|
|
102 |
}
|
|
|
103 |
}
|
|
|
104 |
|
|
|
105 |
function connected() {
|
|
|
106 |
var x;
|
|
|
107 |
|
|
|
108 |
eBayAuthTokenFlag = true;
|
|
|
109 |
document.getElementById("connected").innerHTML += " (Connected)";
|
|
|
110 |
|
|
|
111 |
x = document.getElementById("startButton");
|
|
|
112 |
x.className = x.className.replace(" w3-red", " w3-black");
|
|
|
113 |
|
|
|
114 |
x = document.getElementById("login");
|
|
|
115 |
x.className = x.className.replace(" w3-show", "");
|
|
|
116 |
|
|
|
117 |
x = document.getElementById("results");
|
|
|
118 |
x.innerHTML = "";
|
|
|
119 |
x.className = x.className.replace(" w3-show", "");
|
|
|
120 |
x.className = x.className.replace(" process-errors", "");
|
|
|
121 |
}
|
|
|
122 |
|
|
|
123 |
function requireNewLogin() {
|
|
|
124 |
var x = document.getElementById("startButton");
|
|
|
125 |
x.className = x.className.replace(" w3-black", " w3-red ");
|
|
|
126 |
}
|
|
|
127 |
|
|
|
128 |
function downloadListings() {
|
|
|
129 |
var noteList = [];
|
|
|
130 |
var table = document.getElementById(tableSorterName);
|
|
|
131 |
|
|
|
132 |
maxPagesToProcess = 0;
|
|
|
133 |
pagesToProcess = 0;
|
|
|
134 |
pagesProcessed = 0;
|
|
|
135 |
|
|
|
136 |
initProgressBar("Downloading Selected Items");
|
|
|
137 |
|
|
|
138 |
var x = document.getElementById("results");
|
|
|
139 |
x.innerHTML = '';
|
|
|
140 |
x.className = x.className.replace("process-errors", "");
|
|
|
141 |
if (x.className.indexOf("w3-show") == -1) {
|
|
|
142 |
x.className += " w3-show";
|
|
|
143 |
}
|
|
|
144 |
x.innerHTML = '<p><strong>Downloading Listings...</strong></p>';
|
|
|
145 |
|
|
|
146 |
document.getElementById("csv").innerHTML = '';
|
|
|
147 |
|
|
|
148 |
tableStart();
|
|
|
149 |
for (var i = 2; i < table.rows.length; i++) {
|
|
|
150 |
if (table.rows[i].cells[0].children[0].checked) {
|
|
|
151 |
++maxPagesToProcess;
|
|
|
152 |
++pagesToProcess;
|
|
|
153 |
noteList.push(table.rows[i].cells[3].innerHTML);
|
|
|
154 |
eBaySearch(table.rows[i].cells[3].innerHTML);
|
|
|
155 |
|
|
|
156 |
table.deleteRow(i--);
|
|
|
157 |
}
|
|
|
158 |
}
|
|
|
159 |
|
|
|
160 |
function checkpagesToProcess() {
|
|
|
161 |
if (pagesToProcess > 0) {
|
|
|
162 |
window.setTimeout(checkpagesToProcess, 100); // wait 100 milliseconds
|
|
|
163 |
} else {
|
|
|
164 |
tableEnd();
|
| 7 |
- |
165 |
tableSorterUpdateCounters(tableSorterName);
|
| 2 |
- |
166 |
endProgressBar();
|
|
|
167 |
exportTableToCSV(tableName, 'import.csv');
|
|
|
168 |
addNotes(noteList);
|
|
|
169 |
}
|
|
|
170 |
}
|
|
|
171 |
|
|
|
172 |
checkpagesToProcess();
|
|
|
173 |
}
|
|
|
174 |
|
|
|
175 |
function addNotes(noteList) {
|
|
|
176 |
var i, x;
|
|
|
177 |
|
|
|
178 |
maxNotesToAdd = 0;
|
|
|
179 |
notesToAdd = 0;
|
|
|
180 |
notesAdded = 0;
|
|
|
181 |
|
|
|
182 |
if (!liveListing) {
|
|
|
183 |
initProgressBar('Adding Notes to Ended Listings');
|
|
|
184 |
|
|
|
185 |
for (i = 0; i < noteList.length; i++) {
|
|
|
186 |
++maxNotesToAdd;
|
|
|
187 |
++notesToAdd;
|
|
|
188 |
addNote(noteList[i]);
|
|
|
189 |
}
|
|
|
190 |
}
|
|
|
191 |
|
|
|
192 |
function checkNotesToAdd() {
|
|
|
193 |
if (notesToAdd > 0) {
|
|
|
194 |
window.setTimeout(checkNotesToAdd, 100); // wait 100 milliseconds
|
|
|
195 |
} else {
|
|
|
196 |
endProgressBar();
|
|
|
197 |
|
|
|
198 |
x = document.getElementById("results");
|
|
|
199 |
x.innerHTML += '<p><strong>Report Finished!</strong></p>';
|
|
|
200 |
if (!x.className.includes("process-errors")) {
|
|
|
201 |
setTimeout(function() {
|
|
|
202 |
x.className = x.className.replace(" w3-show", "");
|
|
|
203 |
}, 3000);
|
|
|
204 |
}
|
|
|
205 |
}
|
|
|
206 |
}
|
|
|
207 |
|
|
|
208 |
checkNotesToAdd();
|
|
|
209 |
}
|
|
|
210 |
|
|
|
211 |
function tableStart() {
|
|
|
212 |
document.getElementById("csv").innerHTML = '';
|
|
|
213 |
html = [];
|
|
|
214 |
|
|
|
215 |
html.push('<h3>Shopify Import</h3>');
|
|
|
216 |
html.push('<div class="w3-responsive">');
|
|
|
217 |
html.push('<table id="' + tableName + '">');
|
|
|
218 |
html.push('<thead>');
|
|
|
219 |
html.push('<tr>');
|
|
|
220 |
|
|
|
221 |
html.push(tableHeader('Handle'));
|
|
|
222 |
html.push(tableHeader('Title'));
|
|
|
223 |
html.push(tableHeader('Body (HTML)'));
|
|
|
224 |
html.push(tableHeader('Vendor'));
|
|
|
225 |
html.push(tableHeader('Type'));
|
|
|
226 |
html.push(tableHeader('Tags'));
|
|
|
227 |
html.push(tableHeader('Published'));
|
| 25 |
- |
228 |
html.push(tableHeader('Option1 Name'));
|
|
|
229 |
html.push(tableHeader('Option1 Value'));
|
|
|
230 |
html.push(tableHeader('Option2 Name'));
|
|
|
231 |
html.push(tableHeader('Option2 Value'));
|
|
|
232 |
html.push(tableHeader('Option3 Name'));
|
|
|
233 |
html.push(tableHeader('Option3 Value'));
|
| 2 |
- |
234 |
html.push(tableHeader('Variant SKU'));
|
| 25 |
- |
235 |
html.push(tableHeader('Variant Grams'));
|
| 2 |
- |
236 |
html.push(tableHeader('Variant Inventory Tracker'));
|
| 25 |
- |
237 |
html.push(tableHeader('Variant Inventory Qty'));
|
| 2 |
- |
238 |
html.push(tableHeader('Variant Inventory Policy'));
|
|
|
239 |
html.push(tableHeader('Variant Fulfillment Service'));
|
|
|
240 |
html.push(tableHeader('Variant Price'));
|
| 25 |
- |
241 |
html.push(tableHeader('Variant Compare At Price'));
|
| 2 |
- |
242 |
html.push(tableHeader('Variant Requires Shipping'));
|
|
|
243 |
html.push(tableHeader('Variant Taxable'));
|
|
|
244 |
html.push(tableHeader('Variant Barcode'));
|
|
|
245 |
html.push(tableHeader('Image Src'));
|
|
|
246 |
html.push(tableHeader('Image Position'));
|
|
|
247 |
html.push(tableHeader('Image Alt Text'));
|
| 25 |
- |
248 |
html.push(tableHeader('Gift Card'));
|
|
|
249 |
html.push(tableHeader('Google Shopping / MPN'));
|
|
|
250 |
html.push(tableHeader('Google Shopping / Age Group'));
|
|
|
251 |
html.push(tableHeader('Google Shopping / Gender'));
|
|
|
252 |
html.push(tableHeader('Google Shopping / Google Product Category'));
|
|
|
253 |
html.push(tableHeader('SEO Title'));
|
|
|
254 |
html.push(tableHeader('SEO Description'));
|
|
|
255 |
html.push(tableHeader('Google Shopping / AdWords Grouping'));
|
|
|
256 |
html.push(tableHeader('Google Shopping / AdWords Labels'));
|
|
|
257 |
html.push(tableHeader('Google Shopping / Condition'));
|
|
|
258 |
html.push(tableHeader('Google Shopping / Custom Product'));
|
|
|
259 |
html.push(tableHeader('Google Shopping / Custom Label 0'));
|
|
|
260 |
html.push(tableHeader('Google Shopping / Custom Label 1'));
|
|
|
261 |
html.push(tableHeader('Google Shopping / Custom Label 2'));
|
|
|
262 |
html.push(tableHeader('Google Shopping / Custom Label 3'));
|
|
|
263 |
html.push(tableHeader('Google Shopping / Custom Label 4'));
|
|
|
264 |
html.push(tableHeader('Variant Image'));
|
| 2 |
- |
265 |
html.push(tableHeader('Variant Weight Unit'));
|
| 25 |
- |
266 |
html.push(tableHeader('Variant Tax Code'));
|
|
|
267 |
html.push(tableHeader('Cost per item'));
|
| 2 |
- |
268 |
|
|
|
269 |
html.push('</tr>');
|
|
|
270 |
html.push('</thead>');
|
|
|
271 |
html.push('<tbody>');
|
|
|
272 |
}
|
|
|
273 |
|
|
|
274 |
function tableEntry(JsonObj) {
|
|
|
275 |
var i, n, barcode, handle;
|
|
|
276 |
var tags = [];
|
|
|
277 |
var ConditionDescription = JsonObj.ConditionDescription;
|
|
|
278 |
var ConditionID = JsonObj.ConditionID;
|
|
|
279 |
var CurrentPrice = JsonObj.SellingStatus.CurrentPrice;
|
|
|
280 |
var CurrentPriceValue = CurrentPrice === undefined ? 0.00 : Number(CurrentPrice.text);
|
|
|
281 |
var price = CurrentPriceValue;
|
|
|
282 |
var Description = JsonObj.Description;
|
|
|
283 |
var userDescription;
|
|
|
284 |
var ItemID = JsonObj.ItemID;
|
|
|
285 |
var ItemSpecifics = JsonObj.ItemSpecifics;
|
| 6 |
- |
286 |
var PictureURL = getJsonArray(JsonObj.PictureDetails.PictureURL);
|
| 2 |
- |
287 |
var PrimaryCategoryName = JsonObj.PrimaryCategory.CategoryName;
|
| 16 |
- |
288 |
var Quantity = Number(JsonObj.Quantity);
|
|
|
289 |
var QuantitySold = Number(JsonObj.SellingStatus.QuantitySold);
|
| 2 |
- |
290 |
var SKU = JsonObj.SKU;
|
|
|
291 |
var ProductListingDetails = JsonObj.ProductListingDetails;
|
|
|
292 |
var weightInGrams = 0;
|
|
|
293 |
var categoryName = PrimaryCategoryName;
|
|
|
294 |
|
|
|
295 |
var Title = JsonObj.Title;
|
|
|
296 |
|
|
|
297 |
if (Number(ConditionID) === 1000) {
|
|
|
298 |
tags.push("Condition: Brand New");
|
|
|
299 |
} else {
|
|
|
300 |
tags.push("Condition: Preowned");
|
|
|
301 |
}
|
|
|
302 |
|
|
|
303 |
n = (SKU === undefined ? 0 : SKU.indexOf(" - "));
|
|
|
304 |
if (n > 0) {
|
|
|
305 |
barcode = SKU.substr(n + 3);
|
|
|
306 |
barcode = barcode.substr(barcode.indexOf(" ") + 1);
|
|
|
307 |
handle = 'B' + barcode;
|
|
|
308 |
barcode = '\'' + barcode;
|
|
|
309 |
SKU = SKU.substr(0, n);
|
|
|
310 |
} else {
|
|
|
311 |
if (categoryName.indexOf("Books") != -1 && ProductListingDetails && ProductListingDetails.ISBN && isNumeric(ProductListingDetails.ISBN)) {
|
|
|
312 |
barcode = '\'' + ProductListingDetails.ISBN;
|
|
|
313 |
handle = 'B' + ProductListingDetails.ISBN;
|
|
|
314 |
} else if (ProductListingDetails && ProductListingDetails.UPC && isNumeric(ProductListingDetails.UPC)) {
|
|
|
315 |
barcode = '\'' + ProductListingDetails.UPC;
|
|
|
316 |
handle = 'B' + ProductListingDetails.UPC;
|
|
|
317 |
} else if (ProductListingDetails && ProductListingDetails.ProductReferenceID && isNumeric(ProductListingDetails.ProductReferenceID)) {
|
|
|
318 |
barcode = 'R' + ProductListingDetails.ProductReferenceID;
|
|
|
319 |
handle = barcode;
|
|
|
320 |
} else {
|
|
|
321 |
barcode = 'H' + Title.hashCode();
|
|
|
322 |
handle = barcode;
|
|
|
323 |
}
|
|
|
324 |
}
|
|
|
325 |
|
|
|
326 |
userDescription = extractDescription(Description);
|
| 16 |
- |
327 |
if (ItemSpecifics && ItemSpecifics.NameValueList && PrimaryCategoryName.indexOf('DVD') < 0) {
|
|
|
328 |
userDescription += '<table><tbody>';
|
|
|
329 |
for (i = 0; i < ItemSpecifics.NameValueList.length; i++) {
|
|
|
330 |
var itemSpecific = ItemSpecifics.NameValueList[i];
|
|
|
331 |
if (itemSpecific.Name != 'All returns accepted' &&
|
|
|
332 |
itemSpecific.Name != 'Item must be returned within' &&
|
|
|
333 |
itemSpecific.Name != 'Refund will be given as' &&
|
|
|
334 |
itemSpecific.Name != 'Return policy details' &&
|
|
|
335 |
itemSpecific.Name != 'Restocking Fee' &&
|
|
|
336 |
itemSpecific.Name != 'Return shipping will be paid by') {
|
|
|
337 |
userDescription += '<tr><td style="padding: 0;">' + itemSpecific.Name + ':</td><td style="padding: 0;">' + itemSpecific.Value + '</td></tr>';
|
| 2 |
- |
338 |
}
|
|
|
339 |
}
|
| 16 |
- |
340 |
userDescription += '</tbody></table>';
|
| 2 |
- |
341 |
}
|
|
|
342 |
|
|
|
343 |
if (ConditionDescription &&
|
|
|
344 |
(userDescription.indexOf('Please view all actual images.') < 0 && userDescription.indexOf('mint condition') < 0)) {
|
|
|
345 |
userDescription += '<p>' + ConditionDescription + '</p>';
|
|
|
346 |
}
|
|
|
347 |
|
|
|
348 |
if (categoryName.indexOf("CDs") != -1) {
|
|
|
349 |
categoryName = 'Music CDs';
|
|
|
350 |
price = 4.95;
|
|
|
351 |
} else if (categoryName.indexOf("Movies") != -1) {
|
|
|
352 |
categoryName = 'Movies';
|
|
|
353 |
price = 4.95;
|
|
|
354 |
} else if (categoryName.indexOf("Books") != -1) {
|
|
|
355 |
categoryName = 'Books';
|
|
|
356 |
price = 5.95;
|
|
|
357 |
} else if (categoryName.indexOf("Trading Cards") != -1) {
|
|
|
358 |
if (categoryName.indexOf("Baseball") != -1) {
|
|
|
359 |
tags.push('Trading Cards: Baseball');
|
|
|
360 |
} else if (categoryName.indexOf("Football") != -1) {
|
|
|
361 |
tags.push('Trading Cards: Football');
|
|
|
362 |
} else if (categoryName.indexOf("Basketball") != -1) {
|
|
|
363 |
tags.push('Trading Cards: Basketball');
|
|
|
364 |
} else if (categoryName.indexOf("Soccer") != -1) {
|
|
|
365 |
tags.push('Trading Cards: Soccer');
|
|
|
366 |
} else if (categoryName.indexOf("Ice Hockey") != -1) {
|
|
|
367 |
tags.push('Trading Cards: Ice Hockey');
|
|
|
368 |
} else if (categoryName.indexOf("Auto Racing") != -1) {
|
|
|
369 |
tags.push('Trading Cards: Auto Racing');
|
|
|
370 |
}
|
|
|
371 |
categoryName = 'Trading Cards';
|
|
|
372 |
price = 1.99;
|
|
|
373 |
}
|
|
|
374 |
tags.push(categoryName);
|
|
|
375 |
|
|
|
376 |
if (liveListing) {
|
|
|
377 |
tags.push('_eBay Live');
|
|
|
378 |
|
|
|
379 |
price = round((CurrentPriceValue * 0.80), 1) + 0.05; // always end with 5
|
|
|
380 |
if (categoryName.indexOf("CDs") != -1 && price < 4.95) {
|
|
|
381 |
price = 4.95;
|
|
|
382 |
} else if (categoryName.indexOf("Movies") != -1 && price < 4.95) {
|
|
|
383 |
price = 4.95;
|
|
|
384 |
} else if (categoryName.indexOf("Books") != -1 && price < 5.95) {
|
|
|
385 |
price = 5.95;
|
|
|
386 |
} else if (categoryName.indexOf("Trading Cards") != -1 && price < 1.99) {
|
|
|
387 |
price = 1.99;
|
|
|
388 |
}
|
|
|
389 |
}
|
|
|
390 |
|
|
|
391 |
if (JsonObj.ShippingPackageDetails !== undefined) {
|
|
|
392 |
if (JsonObj.ShippingPackageDetails.WeightMajor !== undefined) {
|
|
|
393 |
weightInGrams += (Number(JsonObj.ShippingPackageDetails.WeightMajor.text) * 453.5);
|
|
|
394 |
}
|
|
|
395 |
|
|
|
396 |
if (JsonObj.ShippingPackageDetails.WeightMinor !== undefined) {
|
|
|
397 |
weightInGrams += (Number(JsonObj.ShippingPackageDetails.WeightMinor.text) * 28.3);
|
|
|
398 |
}
|
|
|
399 |
}
|
|
|
400 |
|
|
|
401 |
html.push('<tr>');
|
|
|
402 |
|
|
|
403 |
html.push(tableCell(handle));
|
|
|
404 |
html.push(tableCell(Title));
|
|
|
405 |
html.push(tableCell(escapeHtml(userDescription)));
|
|
|
406 |
html.push(tableCell("MUNA Trading"));
|
|
|
407 |
html.push(tableCell(categoryName));
|
|
|
408 |
html.push(tableCell(tags.join(',')));
|
|
|
409 |
html.push(tableCell("TRUE"));
|
| 25 |
- |
410 |
html.push(tableCell(""));
|
|
|
411 |
html.push(tableCell(""));
|
|
|
412 |
html.push(tableCell(""));
|
|
|
413 |
html.push(tableCell(""));
|
|
|
414 |
html.push(tableCell(""));
|
|
|
415 |
html.push(tableCell(""));
|
| 2 |
- |
416 |
html.push(tableCell((SKU !== undefined ? SKU : "")));
|
| 25 |
- |
417 |
html.push(tableCell(Math.floor(weightInGrams)));
|
| 2 |
- |
418 |
html.push(tableCell("shopify"));
|
| 16 |
- |
419 |
html.push(tableCell((Quantity - QuantitySold)));
|
| 2 |
- |
420 |
html.push(tableCell("deny"));
|
|
|
421 |
html.push(tableCell("manual"));
|
|
|
422 |
html.push(tableCell(price));
|
| 25 |
- |
423 |
html.push(tableCell(""));
|
| 2 |
- |
424 |
html.push(tableCell("TRUE"));
|
|
|
425 |
html.push(tableCell("TRUE"));
|
|
|
426 |
html.push(tableCell(barcode));
|
| 6 |
- |
427 |
html.push(tableCell(PictureURL[0].substr(0, PictureURL[0].lastIndexOf('/') + 1) + '$_57.JPG'));
|
| 2 |
- |
428 |
html.push(tableCell(1));
|
|
|
429 |
html.push(tableCell(Title + " Image 1"));
|
| 25 |
- |
430 |
html.push(tableCell("FALSE"));
|
|
|
431 |
html.push(tableCell(""));
|
|
|
432 |
html.push(tableCell(""));
|
|
|
433 |
html.push(tableCell(""));
|
|
|
434 |
html.push(tableCell(""));
|
|
|
435 |
html.push(tableCell(""));
|
|
|
436 |
html.push(tableCell(""));
|
|
|
437 |
html.push(tableCell(""));
|
|
|
438 |
html.push(tableCell(""));
|
|
|
439 |
html.push(tableCell(""));
|
|
|
440 |
html.push(tableCell(""));
|
|
|
441 |
html.push(tableCell(""));
|
|
|
442 |
html.push(tableCell(""));
|
|
|
443 |
html.push(tableCell(""));
|
|
|
444 |
html.push(tableCell(""));
|
|
|
445 |
html.push(tableCell(""));
|
|
|
446 |
html.push(tableCell(""));
|
| 2 |
- |
447 |
html.push(tableCell("oz"));
|
| 25 |
- |
448 |
html.push(tableCell(""));
|
|
|
449 |
html.push(tableCell(""));
|
| 2 |
- |
450 |
|
|
|
451 |
html.push('</tr>');
|
|
|
452 |
|
| 6 |
- |
453 |
for (i = 1; i < PictureURL.length; i++) {
|
|
|
454 |
html.push('<tr>');
|
| 2 |
- |
455 |
|
| 6 |
- |
456 |
html.push(tableCell(handle));
|
|
|
457 |
html.push(tableCell(""));
|
|
|
458 |
html.push(tableCell(""));
|
|
|
459 |
html.push(tableCell(""));
|
|
|
460 |
html.push(tableCell(""));
|
|
|
461 |
html.push(tableCell(""));
|
|
|
462 |
html.push(tableCell(""));
|
|
|
463 |
html.push(tableCell(""));
|
|
|
464 |
html.push(tableCell(""));
|
|
|
465 |
html.push(tableCell(""));
|
|
|
466 |
html.push(tableCell(""));
|
|
|
467 |
html.push(tableCell(""));
|
|
|
468 |
html.push(tableCell(""));
|
|
|
469 |
html.push(tableCell(""));
|
|
|
470 |
html.push(tableCell(""));
|
|
|
471 |
html.push(tableCell(""));
|
| 25 |
- |
472 |
html.push(tableCell(""));
|
|
|
473 |
html.push(tableCell(""));
|
|
|
474 |
html.push(tableCell(""));
|
|
|
475 |
html.push(tableCell(""));
|
|
|
476 |
html.push(tableCell(""));
|
|
|
477 |
html.push(tableCell(""));
|
|
|
478 |
html.push(tableCell(""));
|
|
|
479 |
html.push(tableCell(""));
|
| 6 |
- |
480 |
html.push(tableCell(PictureURL[i].substr(0, PictureURL[i].lastIndexOf('/') + 1) + '$_57.JPG'));
|
|
|
481 |
html.push(tableCell(i + 1));
|
|
|
482 |
html.push(tableCell(Title + " Image " + (i + 1)));
|
|
|
483 |
html.push(tableCell(""));
|
|
|
484 |
html.push(tableCell(""));
|
| 25 |
- |
485 |
html.push(tableCell(""));
|
|
|
486 |
html.push(tableCell(""));
|
|
|
487 |
html.push(tableCell(""));
|
|
|
488 |
html.push(tableCell(""));
|
|
|
489 |
html.push(tableCell(""));
|
|
|
490 |
html.push(tableCell(""));
|
|
|
491 |
html.push(tableCell(""));
|
|
|
492 |
html.push(tableCell(""));
|
|
|
493 |
html.push(tableCell(""));
|
|
|
494 |
html.push(tableCell(""));
|
|
|
495 |
html.push(tableCell(""));
|
|
|
496 |
html.push(tableCell(""));
|
|
|
497 |
html.push(tableCell(""));
|
|
|
498 |
html.push(tableCell(""));
|
|
|
499 |
html.push(tableCell(""));
|
|
|
500 |
html.push(tableCell(""));
|
|
|
501 |
html.push(tableCell(""));
|
|
|
502 |
html.push(tableCell(""));
|
| 2 |
- |
503 |
|
| 6 |
- |
504 |
html.push('</tr>');
|
| 2 |
- |
505 |
}
|
|
|
506 |
}
|
|
|
507 |
|
|
|
508 |
function extractDescription(str) {
|
|
|
509 |
var startText = "<!-- *************** Place description here ****************** -->";
|
|
|
510 |
var startPos = str.indexOf(startText) + startText.length;
|
|
|
511 |
var endPos = str.lastIndexOf("<!-- *************** Place description here ****************** -->");
|
|
|
512 |
var userDescription = str.substr(startPos, endPos - startPos);
|
|
|
513 |
var parser = new DOMParser();
|
|
|
514 |
var htmlDoc = parser.parseFromString(userDescription, "text/html");
|
|
|
515 |
|
|
|
516 |
return ((htmlDoc.getElementsByTagName('div')[0] !== undefined ? htmlDoc.getElementsByTagName('div')[0].innerHTML : userDescription));
|
|
|
517 |
}
|
|
|
518 |
|
|
|
519 |
function tableEnd() {
|
|
|
520 |
html.push('</tbody>');
|
|
|
521 |
html.push('</table>');
|
|
|
522 |
html.push('</div>');
|
|
|
523 |
|
|
|
524 |
document.getElementById("csv").innerHTML = html.join('');
|
|
|
525 |
}
|
|
|
526 |
|
|
|
527 |
function addNote(itemId) {
|
|
|
528 |
var i;
|
|
|
529 |
var xml;
|
|
|
530 |
|
|
|
531 |
var xw = new XMLWriter('UTF-8', '1.0');
|
|
|
532 |
var xhr = new XMLHttpRequest();
|
|
|
533 |
|
|
|
534 |
if (!createAddXMLNote(xw, xhr, 'SetUserNotesRequest', 'SetUserNotes', itemId)) {
|
|
|
535 |
return;
|
|
|
536 |
}
|
|
|
537 |
|
|
|
538 |
xml = xw.flush();
|
|
|
539 |
xw.close();
|
|
|
540 |
|
|
|
541 |
xhr.onload = function() {
|
| 16 |
- |
542 |
var jsonObj = XMLparse(xhr.responseXML, false);
|
|
|
543 |
var obj = jsonObj.SetUserNotesResponse;
|
| 2 |
- |
544 |
var returnCode = obj.Ack;
|
| 19 |
- |
545 |
var str;
|
| 2 |
- |
546 |
|
|
|
547 |
var x = document.getElementById("results");
|
|
|
548 |
if (x.className.indexOf("w3-show") == -1) {
|
|
|
549 |
x.className += " w3-show";
|
|
|
550 |
}
|
|
|
551 |
|
|
|
552 |
if (returnCode == 'Success' || (returnCode == 'Warning' && obj.Errors.ErrorCode == '21917108')) {
|
| 19 |
- |
553 |
str = '<p>' + itemId + ': <strong>' + returnCode + '</strong></p>';
|
| 2 |
- |
554 |
|
|
|
555 |
if (returnCode == 'Warning') {
|
| 19 |
- |
556 |
str += "<p>" + obj.Errors.SeverityCode + " (" + obj.Errors.ErrorCode + "): " + escapeHtml(obj.Errors.LongMessage) + "</p>";
|
| 2 |
- |
557 |
}
|
| 19 |
- |
558 |
|
|
|
559 |
x.innerHTML += str;
|
| 2 |
- |
560 |
} else {
|
|
|
561 |
x.className += " process-errors";
|
| 19 |
- |
562 |
str = '<p class="w3-red">' + itemId + ': <strong>' + returnCode + ':</strong></p>';
|
| 2 |
- |
563 |
|
| 6 |
- |
564 |
var errors = getJsonArray(obj.Errors);
|
| 19 |
- |
565 |
str += "<p>";
|
| 6 |
- |
566 |
for (i = 0; i < errors.length; i++) {
|
| 19 |
- |
567 |
str += errors[i].SeverityCode + " (" + errors[i].ErrorCode + "): " + escapeHtml(errors[i].LongMessage) + "<br/>";
|
| 2 |
- |
568 |
}
|
| 19 |
- |
569 |
str += "</p>";
|
|
|
570 |
|
|
|
571 |
x.innerHTML += str;
|
| 2 |
- |
572 |
}
|
|
|
573 |
|
|
|
574 |
if (obj.Message) {
|
|
|
575 |
x.innerHTML += obj.Message;
|
|
|
576 |
}
|
|
|
577 |
|
|
|
578 |
--notesToAdd;
|
|
|
579 |
++notesAdded;
|
|
|
580 |
|
|
|
581 |
updateProgressBar(maxNotesToAdd, notesAdded);
|
|
|
582 |
};
|
|
|
583 |
|
|
|
584 |
xhr.send(xml);
|
|
|
585 |
}
|
|
|
586 |
|
|
|
587 |
function createAddXMLNote(xw, xhr, xmlrequest, callname, itemId) {
|
|
|
588 |
var today = new Date();
|
|
|
589 |
var todayYYYYMMDD = today.toISOString().slice(0, 10);
|
|
|
590 |
|
|
|
591 |
xw.writeStartDocument();
|
|
|
592 |
xw.writeStartElement(xmlrequest);
|
|
|
593 |
xw.writeAttributeString('xmlns', 'urn:ebay:apis:eBLBaseComponents');
|
|
|
594 |
|
|
|
595 |
xw.writeStartElement('RequesterCredentials');
|
|
|
596 |
xw.writeElementString('eBayAuthToken', eBayAuthToken);
|
|
|
597 |
xw.writeEndElement(); /* RequesterCredentials */
|
|
|
598 |
|
|
|
599 |
xw.writeElementString('ItemID', itemId);
|
|
|
600 |
xw.writeElementString('Action', 'AddOrUpdate');
|
|
|
601 |
xw.writeElementString('NoteText', 'Exported to Shopify on ' + todayYYYYMMDD);
|
|
|
602 |
|
|
|
603 |
xw.writeElementString('ErrorLanguage', 'en_US');
|
|
|
604 |
xw.writeElementString('Version', configeBayTradingVersion);
|
|
|
605 |
xw.writeElementString('WarningLevel', configWarningLevel);
|
|
|
606 |
|
|
|
607 |
xw.writeEndElement(); /* xmlrequest */
|
|
|
608 |
xw.writeEndDocument();
|
|
|
609 |
|
|
|
610 |
xhr.open('POST', configProxyUrl, true);
|
|
|
611 |
xhr.setRequestHeader('Content-Type', 'text/xml');
|
|
|
612 |
xhr.setRequestHeader('X-EBAY-API-APP-NAME', configAppid);
|
|
|
613 |
xhr.setRequestHeader('X-EBAY-API-COMPATIBILITY-LEVEL', configeBayTradingVersion);
|
|
|
614 |
xhr.setRequestHeader('X-EBAY-API-CALL-NAME', callname);
|
|
|
615 |
xhr.setRequestHeader('X-EBAY-API-SITEID', '0');
|
|
|
616 |
xhr.setRequestHeader('X-EBAY-API-DEV-NAME', '');
|
|
|
617 |
xhr.setRequestHeader('X-EBAY-API-CERT-NAME', '');
|
|
|
618 |
xhr.setRequestHeader('X-Proxy-URL', configServiceEndpoint);
|
|
|
619 |
|
|
|
620 |
return true;
|
|
|
621 |
}
|
|
|
622 |
|
|
|
623 |
function eBaySearch(itemId) {
|
|
|
624 |
var i;
|
|
|
625 |
var xml;
|
|
|
626 |
|
|
|
627 |
var xw = new XMLWriter('UTF-8', '1.0');
|
|
|
628 |
var xhr = new XMLHttpRequest();
|
|
|
629 |
|
|
|
630 |
if (!createAddXMLSearch(xw, xhr, 'GetItemRequest', 'GetItem', itemId)) {
|
|
|
631 |
return;
|
|
|
632 |
}
|
|
|
633 |
|
|
|
634 |
xml = xw.flush();
|
|
|
635 |
xw.close();
|
|
|
636 |
|
|
|
637 |
xhr.onload = function() {
|
| 16 |
- |
638 |
var jsonObj = XMLparse(xhr.responseXML, false);
|
|
|
639 |
var obj = jsonObj.GetItemResponse;
|
| 2 |
- |
640 |
var returnCode = obj.Ack;
|
| 19 |
- |
641 |
var str;
|
| 2 |
- |
642 |
|
|
|
643 |
var x = document.getElementById("results");
|
|
|
644 |
if (x.className.indexOf("w3-show") == -1) {
|
|
|
645 |
x.className += " w3-show";
|
|
|
646 |
}
|
|
|
647 |
|
|
|
648 |
if (returnCode == 'Success') {
|
|
|
649 |
tableEntry(obj.Item);
|
|
|
650 |
} else {
|
|
|
651 |
x.className += " process-errors";
|
| 19 |
- |
652 |
str = '<p class="w3-red">' + itemId + ': <strong>' + returnCode + ':</strong></p>';
|
| 2 |
- |
653 |
|
| 6 |
- |
654 |
var errors = getJsonArray(obj.Errors);
|
| 19 |
- |
655 |
str += "<p>";
|
| 6 |
- |
656 |
for (i = 0; i < errors.length; i++) {
|
| 19 |
- |
657 |
str += errors[i].SeverityCode + " (" + errors[i].ErrorCode + "): " + escapeHtml(errors[i].LongMessage) + "<br/>";
|
| 2 |
- |
658 |
}
|
| 19 |
- |
659 |
str += "</p>";
|
| 6 |
- |
660 |
|
| 19 |
- |
661 |
x.innerHTML += str;
|
| 2 |
- |
662 |
}
|
|
|
663 |
|
|
|
664 |
--pagesToProcess;
|
|
|
665 |
++pagesProcessed;
|
|
|
666 |
|
|
|
667 |
updateProgressBar(maxPagesToProcess, pagesProcessed);
|
|
|
668 |
};
|
|
|
669 |
|
|
|
670 |
xhr.send(xml);
|
|
|
671 |
}
|
|
|
672 |
|
|
|
673 |
function createAddXMLSearch(xw, xhr, xmlrequest, callname, itemId) {
|
|
|
674 |
|
|
|
675 |
xw.writeStartDocument();
|
|
|
676 |
xw.writeStartElement(xmlrequest);
|
|
|
677 |
xw.writeAttributeString('xmlns', 'urn:ebay:apis:eBLBaseComponents');
|
|
|
678 |
|
|
|
679 |
xw.writeStartElement('RequesterCredentials');
|
|
|
680 |
xw.writeElementString('eBayAuthToken', eBayAuthToken);
|
|
|
681 |
xw.writeEndElement(); /* RequesterCredentials */
|
|
|
682 |
|
|
|
683 |
xw.writeElementString('ItemID', itemId);
|
|
|
684 |
xw.writeElementString('IncludeItemSpecifics', 'true');
|
|
|
685 |
xw.writeElementString('DetailLevel', 'ReturnAll');
|
|
|
686 |
|
|
|
687 |
xw.writeElementString('ErrorLanguage', 'en_US');
|
|
|
688 |
xw.writeElementString('Version', configeBayTradingVersion);
|
|
|
689 |
xw.writeElementString('WarningLevel', configWarningLevel);
|
|
|
690 |
|
|
|
691 |
xw.writeEndElement(); /* xmlrequest */
|
|
|
692 |
xw.writeEndDocument();
|
|
|
693 |
|
|
|
694 |
xhr.open('POST', configProxyUrl, true);
|
|
|
695 |
xhr.setRequestHeader('Content-Type', 'text/xml');
|
|
|
696 |
xhr.setRequestHeader('X-EBAY-API-APP-NAME', configAppid);
|
|
|
697 |
xhr.setRequestHeader('X-EBAY-API-COMPATIBILITY-LEVEL', configeBayTradingVersion);
|
|
|
698 |
xhr.setRequestHeader('X-EBAY-API-CALL-NAME', callname);
|
|
|
699 |
xhr.setRequestHeader('X-EBAY-API-SITEID', '0');
|
|
|
700 |
xhr.setRequestHeader('X-EBAY-API-DEV-NAME', '');
|
|
|
701 |
xhr.setRequestHeader('X-EBAY-API-CERT-NAME', '');
|
|
|
702 |
xhr.setRequestHeader('X-Proxy-URL', configServiceEndpoint);
|
|
|
703 |
|
|
|
704 |
return true;
|
|
|
705 |
}
|
|
|
706 |
|
|
|
707 |
function getListings() {
|
|
|
708 |
var x;
|
|
|
709 |
|
|
|
710 |
if (eBayAuthTokenFlag === false) {
|
|
|
711 |
return;
|
|
|
712 |
}
|
|
|
713 |
|
|
|
714 |
document.getElementById("logging").innerHTML = '';
|
|
|
715 |
|
|
|
716 |
x = document.getElementById("results");
|
|
|
717 |
if (x.className.indexOf("w3-show") == -1) {
|
|
|
718 |
x.className += " w3-show";
|
|
|
719 |
}
|
|
|
720 |
x.className = x.className.replace("process-errors", "");
|
|
|
721 |
x.innerHTML = '<p><strong>Retrieving Listings...</strong></p>';
|
|
|
722 |
|
|
|
723 |
initProgressBar('Getting Items for Export (1/2)');
|
|
|
724 |
|
|
|
725 |
liveListing = (getRadioValue('rptType') == 'liveList');
|
|
|
726 |
tableSorterStart();
|
|
|
727 |
maxPagesToProcess = 1;
|
|
|
728 |
pagesToProcess = 1;
|
|
|
729 |
pagesProcessed = 0;
|
|
|
730 |
eBaySorterSearch(1);
|
|
|
731 |
|
|
|
732 |
function checkpagesToProcess() {
|
|
|
733 |
if (pagesToProcess > 0) {
|
|
|
734 |
window.setTimeout(checkpagesToProcess, 100); // wait 100 milliseconds
|
|
|
735 |
} else {
|
|
|
736 |
tableSorterEnd();
|
|
|
737 |
endProgressBar();
|
|
|
738 |
// fillSorterListings(); is now in tableSorterEnd()
|
|
|
739 |
}
|
|
|
740 |
}
|
|
|
741 |
|
|
|
742 |
checkpagesToProcess();
|
|
|
743 |
}
|
|
|
744 |
|
|
|
745 |
function tableSorterStart() {
|
|
|
746 |
document.getElementById("logging").innerHTML = '';
|
|
|
747 |
html = [];
|
|
|
748 |
|
|
|
749 |
html.push('<h3>Items for Export</h3>');
|
|
|
750 |
html.push('<p>Showing <span id="filtered-rows">0</span> of <span id="total-rows">0</span> / <span id="selected-rows">0</span> selected.</p>');
|
|
|
751 |
html.push('<div class="w3-responsive">');
|
|
|
752 |
html.push('<table id="' + tableSorterName + '" class="tablesorter">');
|
|
|
753 |
html.push('<thead>');
|
|
|
754 |
html.push('<tr>');
|
|
|
755 |
|
| 6 |
- |
756 |
html.push(tableHeaderCheckbox());
|
| 2 |
- |
757 |
html.push(tableHeader('Image'));
|
|
|
758 |
html.push(tableHeader('Title'));
|
|
|
759 |
html.push(tableHeader('Item Id'));
|
|
|
760 |
html.push(tableHeader('SKU'));
|
|
|
761 |
html.push(tableHeader('Category'));
|
|
|
762 |
html.push(tableHeader('Format'));
|
|
|
763 |
html.push(tableHeader('Price'));
|
|
|
764 |
html.push(tableHeader('Quantity'));
|
|
|
765 |
html.push(tableHeader('Views'));
|
|
|
766 |
html.push(tableHeader('Watchers'));
|
|
|
767 |
html.push(tableHeader(liveListing ? 'Start Date' : 'End Date'));
|
|
|
768 |
html.push(tableHeader('Note'));
|
|
|
769 |
|
|
|
770 |
html.push('</tr>');
|
|
|
771 |
html.push('</thead>');
|
|
|
772 |
html.push('<tbody>');
|
|
|
773 |
}
|
|
|
774 |
|
|
|
775 |
function tableSorterEntry(JsonObj) {
|
|
|
776 |
var i;
|
|
|
777 |
var image;
|
|
|
778 |
var title;
|
|
|
779 |
var itemId;
|
|
|
780 |
var sku;
|
|
|
781 |
var format;
|
|
|
782 |
var price;
|
|
|
783 |
var quantity;
|
|
|
784 |
var views;
|
|
|
785 |
var watchers;
|
|
|
786 |
var listingDate;
|
|
|
787 |
var privateNote;
|
|
|
788 |
var ebayNote;
|
|
|
789 |
var relisted;
|
| 16 |
- |
790 |
var bidCount;
|
| 2 |
- |
791 |
|
|
|
792 |
for (i = 0; i < JsonObj.length; i++) {
|
| 16 |
- |
793 |
image = getJsonValue(JsonObj[i].PictureDetails.GalleryURL).replace('http:', 'https:');
|
| 2 |
- |
794 |
title = getJsonValue(JsonObj[i].Title);
|
|
|
795 |
itemId = getJsonValue(JsonObj[i].ItemID);
|
|
|
796 |
sku = getJsonValue(JsonObj[i].SKU);
|
|
|
797 |
format = getJsonValue(JsonObj[i].ListingType);
|
| 16 |
- |
798 |
bidCount = (typeof(JsonObj[i].SellingStatus) === 'object' ? Number(getJsonValue(JsonObj[i].SellingStatus.BidCount)) : 0);
|
| 2 |
- |
799 |
if (format == 'Chinese') {
|
|
|
800 |
format = 'Auction';
|
|
|
801 |
price = getJsonValue(JsonObj[i].StartPrice.text);
|
|
|
802 |
} else {
|
|
|
803 |
format = 'Fixed Price';
|
|
|
804 |
price = getJsonValue(JsonObj[i].BuyItNowPrice.text);
|
|
|
805 |
}
|
|
|
806 |
quantity = getJsonValue(JsonObj[i].QuantityAvailable);
|
|
|
807 |
views = '';
|
| 16 |
- |
808 |
watchers = Number(getJsonValue(JsonObj[i].WatchCount));
|
|
|
809 |
listingDate = getJsonValue((liveListing ? JsonObj[i].ListingDetails.StartTime : JsonObj[i].ListingDetails.EndTime)).substr(0, 10);
|
| 2 |
- |
810 |
privateNote = getJsonValue(JsonObj[i].PrivateNotes);
|
|
|
811 |
ebayNote = getJsonValue(JsonObj[i].eBayNotes);
|
|
|
812 |
relisted = getJsonValue(JsonObj[i].Relisted);
|
|
|
813 |
|
|
|
814 |
if (!liveListing) {
|
|
|
815 |
if (privateNote.startsWith("Exported to ") || relisted == 'true' || privateNote.startsWith("Sold via ") || privateNote.startsWith("Relisted As New Item")) {
|
|
|
816 |
continue;
|
|
|
817 |
}
|
| 16 |
- |
818 |
} else {
|
|
|
819 |
if (bidCount > 0) {
|
|
|
820 |
continue;
|
|
|
821 |
}
|
| 2 |
- |
822 |
}
|
|
|
823 |
|
| 16 |
- |
824 |
|
|
|
825 |
|
| 2 |
- |
826 |
html.push('<tr>');
|
|
|
827 |
|
|
|
828 |
html.push(tableCellCheckbox());
|
|
|
829 |
html.push(tableCell('<img class="w3-image" src="' + image + '" alt="Gallery Image" style="max-height:100px;max-width:100px;">'));
|
|
|
830 |
html.push(tableCell(title));
|
|
|
831 |
html.push(tableCell(itemId));
|
|
|
832 |
html.push(tableCell(sku));
|
|
|
833 |
html.push(tableCellLabel('Category' + itemId));
|
|
|
834 |
html.push(tableCell(format));
|
|
|
835 |
html.push(tableCell('$' + price));
|
|
|
836 |
html.push(tableCell(quantity));
|
|
|
837 |
html.push(tableCellLabel('Views' + itemId));
|
|
|
838 |
html.push(tableCell(watchers));
|
|
|
839 |
html.push(tableCell(listingDate));
|
|
|
840 |
html.push(tableCell(privateNote + ' ' + ebayNote));
|
|
|
841 |
|
|
|
842 |
html.push('</tr>');
|
|
|
843 |
}
|
|
|
844 |
}
|
|
|
845 |
|
|
|
846 |
function tableSorterEnd() {
|
|
|
847 |
html.push('</tbody>');
|
|
|
848 |
html.push('</table>');
|
|
|
849 |
html.push('</div>');
|
|
|
850 |
|
|
|
851 |
document.getElementById("logging").innerHTML = html.join('');
|
|
|
852 |
|
|
|
853 |
$(function() {
|
|
|
854 |
$("#" + tableSorterName).on('tablesorter-initialized', function() {
|
|
|
855 |
|
|
|
856 |
// class name to add on tr when checkbox is checked
|
|
|
857 |
var highlightClass = 'checked',
|
|
|
858 |
// resort the table after the checkbox is modified?
|
|
|
859 |
resort = true,
|
|
|
860 |
$table = $(this),
|
|
|
861 |
c = this.config,
|
|
|
862 |
wo = c && c.widgetOptions,
|
|
|
863 |
// include sticky header checkbox; if installed
|
|
|
864 |
$sticky = c && wo.$sticky || '',
|
|
|
865 |
doChecky = function(c, col) {
|
|
|
866 |
$table
|
|
|
867 |
.children('tbody')
|
|
|
868 |
.children('tr:visible')
|
|
|
869 |
.children('td:nth-child( ' + (parseInt(col, 10) + 1) + ' )')
|
|
|
870 |
.find('input[type=checkbox]')
|
|
|
871 |
.each(function() {
|
|
|
872 |
this.checked = c;
|
|
|
873 |
$(this).trigger('change');
|
|
|
874 |
});
|
|
|
875 |
};
|
|
|
876 |
|
|
|
877 |
$table
|
|
|
878 |
.children('tbody')
|
|
|
879 |
.on('change', 'input[type=checkbox]', function() {
|
|
|
880 |
// ignore change if updating all rows
|
|
|
881 |
if ($table[0].ignoreChange) {
|
|
|
882 |
return;
|
|
|
883 |
}
|
|
|
884 |
var $this = $(this);
|
|
|
885 |
$this.closest('tr').toggleClass(highlightClass, this.checked);
|
| 19 |
- |
886 |
// resort will jump bqack to the top
|
|
|
887 |
// $this.trigger('updateCell', [$this.closest('td'), resort]);
|
| 2 |
- |
888 |
|
|
|
889 |
// handle header
|
| 7 |
- |
890 |
var rowCount = $('#' + tableSorterName + ' tbody tr').length;
|
| 2 |
- |
891 |
var checkedCount = $('#' + tableSorterName + ' tbody .checked').length;
|
|
|
892 |
var ua = window.navigator.userAgent;
|
|
|
893 |
if (checkedCount === 0) {
|
|
|
894 |
$table.add($sticky).find('thead input[type=checkbox]').prop('checked', false);
|
|
|
895 |
$table.add($sticky).find('thead input[type=checkbox]').prop('indeterminate', false);
|
|
|
896 |
} else if (checkedCount === rowCount) {
|
|
|
897 |
$table.add($sticky).find('thead input[type=checkbox]').prop('checked', true);
|
|
|
898 |
$table.add($sticky).find('thead input[type=checkbox]').prop('indeterminate', false);
|
|
|
899 |
} else {
|
|
|
900 |
$table.add($sticky).find('thead input[type=checkbox]').prop('checked', !(ua.indexOf('Trident/') > -1 || ua.indexOf('Edge/') > -1));
|
|
|
901 |
$table.add($sticky).find('thead input[type=checkbox]').prop('indeterminate', true);
|
|
|
902 |
}
|
|
|
903 |
$('#selected-rows').html(checkedCount);
|
|
|
904 |
})
|
|
|
905 |
.end()
|
|
|
906 |
.add($sticky)
|
|
|
907 |
.find('thead input[type=checkbox]')
|
|
|
908 |
// Click on checkbox in table header to toggle all inputs
|
|
|
909 |
.on('change', function() {
|
|
|
910 |
// prevent updateCell for every cell
|
|
|
911 |
$table[0].ignoreChange = true;
|
|
|
912 |
var c = this.checked,
|
|
|
913 |
col = $(this).closest('th').attr('data-column');
|
|
|
914 |
doChecky(c, col);
|
|
|
915 |
// update main & sticky header
|
|
|
916 |
|
|
|
917 |
$table.children('tbody').children('tr:visible').toggleClass(highlightClass, c);
|
|
|
918 |
// update all at once
|
|
|
919 |
$table[0].ignoreChange = false;
|
|
|
920 |
$table.trigger('update', [resort]);
|
|
|
921 |
|
|
|
922 |
// handle header
|
| 7 |
- |
923 |
var rowCount = $('#' + tableSorterName + ' tbody tr').length;
|
| 2 |
- |
924 |
var checkedCount = $('#' + tableSorterName + ' tbody .checked').length;
|
|
|
925 |
var ua = window.navigator.userAgent;
|
|
|
926 |
if (checkedCount === 0) {
|
|
|
927 |
$table.add($sticky).find('th[data-column=' + col + '] input[type=checkbox]').prop('checked', false);
|
|
|
928 |
$table.add($sticky).find('th[data-column=' + col + '] input[type=checkbox]').prop('indeterminate', false);
|
|
|
929 |
} else if (checkedCount === rowCount) {
|
|
|
930 |
$table.add($sticky).find('th[data-column=' + col + '] input[type=checkbox]').prop('checked', true);
|
|
|
931 |
$table.add($sticky).find('th[data-column=' + col + '] input[type=checkbox]').prop('indeterminate', false);
|
|
|
932 |
} else {
|
|
|
933 |
$table.add($sticky).find('th[data-column=' + col + '] input[type=checkbox]').prop('checked', !(ua.indexOf('Trident/') > -1 || ua.indexOf('Edge/') > -1));
|
|
|
934 |
$table.add($sticky).find('th[data-column=' + col + '] input[type=checkbox]').prop('indeterminate', true);
|
|
|
935 |
}
|
|
|
936 |
$('#selected-rows').html(checkedCount);
|
|
|
937 |
})
|
|
|
938 |
.on('mouseup', function() {
|
|
|
939 |
return false;
|
|
|
940 |
});
|
|
|
941 |
|
|
|
942 |
});
|
|
|
943 |
|
|
|
944 |
$("#" + tableSorterName).tablesorter({
|
|
|
945 |
theme: "blue",
|
|
|
946 |
widgets: ["zebra", "stickyHeaders", "filter"],
|
|
|
947 |
headers: {
|
|
|
948 |
0: {
|
|
|
949 |
sorter: "checkbox"
|
|
|
950 |
},
|
|
|
951 |
1: {
|
|
|
952 |
sorter: false,
|
|
|
953 |
filter: false
|
|
|
954 |
}
|
|
|
955 |
},
|
|
|
956 |
initialized: function() {
|
|
|
957 |
fillSorterListings();
|
|
|
958 |
}
|
|
|
959 |
});
|
|
|
960 |
|
|
|
961 |
$("#" + tableSorterName).bind('filterInit filterEnd', function(event, data) {
|
|
|
962 |
$('#filtered-rows').html(data.filteredRows);
|
|
|
963 |
$('#total-rows').html(data.totalRows);
|
|
|
964 |
});
|
|
|
965 |
});
|
|
|
966 |
}
|
|
|
967 |
|
|
|
968 |
function eBaySorterSearch(pageNo) {
|
|
|
969 |
var i;
|
|
|
970 |
var xml;
|
|
|
971 |
|
|
|
972 |
var xw = new XMLWriter('UTF-8', '1.0');
|
|
|
973 |
var xhr = new XMLHttpRequest();
|
|
|
974 |
|
|
|
975 |
if (!createSorterAddXMLSearch(xw, xhr, 'GetMyeBaySelling', pageNo)) {
|
|
|
976 |
return;
|
|
|
977 |
}
|
|
|
978 |
|
|
|
979 |
xml = xw.flush();
|
|
|
980 |
xw.close();
|
|
|
981 |
|
|
|
982 |
xhr.onload = function() {
|
| 16 |
- |
983 |
var jsonObj = XMLparse(xhr.responseXML, false);
|
|
|
984 |
var obj = jsonObj.GetMyeBaySellingResponse;
|
| 2 |
- |
985 |
var returnCode = obj.Ack;
|
| 19 |
- |
986 |
var str;
|
| 2 |
- |
987 |
|
|
|
988 |
var objArray = (liveListing ? obj.ActiveList : obj.UnsoldList);
|
|
|
989 |
|
|
|
990 |
var x = document.getElementById("results");
|
|
|
991 |
|
|
|
992 |
if (returnCode == 'Success') {
|
| 16 |
- |
993 |
tableSorterEntry(objArray.ItemArray.Item);
|
| 2 |
- |
994 |
|
|
|
995 |
if (Number(objArray.PaginationResult.TotalNumberOfPages) > pageNo) {
|
|
|
996 |
maxPagesToProcess = Number(objArray.PaginationResult.TotalNumberOfPages);
|
|
|
997 |
++pagesToProcess;
|
|
|
998 |
eBaySorterSearch(pageNo + 1);
|
|
|
999 |
}
|
|
|
1000 |
|
|
|
1001 |
updateProgressBar(maxPagesToProcess, pagesProcessed);
|
|
|
1002 |
} else {
|
|
|
1003 |
x.className += " process-errors";
|
| 19 |
- |
1004 |
str = '<p class="w3-red">' + obj.CorrelationID + ': <strong>' + returnCode + ':</strong></p>';
|
| 6 |
- |
1005 |
var errors = getJsonArray(obj.Errors);
|
| 19 |
- |
1006 |
str += "<p>";
|
| 6 |
- |
1007 |
for (i = 0; i < errors.length; i++) {
|
| 19 |
- |
1008 |
str += errors[i].SeverityCode + " (" + errors[i].ErrorCode + "): " + escapeHtml(errors[i].LongMessage) + "<br/>";
|
| 2 |
- |
1009 |
}
|
| 19 |
- |
1010 |
str += "</p>";
|
| 6 |
- |
1011 |
|
| 19 |
- |
1012 |
x.innerHTML += str;
|
| 2 |
- |
1013 |
}
|
|
|
1014 |
|
|
|
1015 |
--pagesToProcess;
|
|
|
1016 |
++pagesProcessed;
|
|
|
1017 |
|
|
|
1018 |
updateProgressBar(maxPagesToProcess, pagesProcessed);
|
|
|
1019 |
};
|
|
|
1020 |
|
|
|
1021 |
xhr.send(xml);
|
|
|
1022 |
}
|
|
|
1023 |
|
|
|
1024 |
function createSorterAddXMLSearch(xw, xhr, callname, pageNo) {
|
| 14 |
- |
1025 |
var outputSelector;
|
|
|
1026 |
|
| 2 |
- |
1027 |
xw.writeStartDocument();
|
|
|
1028 |
xw.writeStartElement(callname + "Request");
|
|
|
1029 |
xw.writeAttributeString('xmlns', 'urn:ebay:apis:eBLBaseComponents');
|
|
|
1030 |
|
|
|
1031 |
xw.writeStartElement('RequesterCredentials');
|
|
|
1032 |
xw.writeElementString('eBayAuthToken', eBayAuthToken);
|
|
|
1033 |
xw.writeEndElement(); /* RequesterCredentials */
|
|
|
1034 |
|
|
|
1035 |
xw.writeElementString('DetailLevel', 'ReturnAll');
|
|
|
1036 |
xw.writeStartElement('DeletedFromSoldList');
|
|
|
1037 |
xw.writeElementString('Include', 'false');
|
|
|
1038 |
xw.writeEndElement(); /* DeletedFromSoldList */
|
|
|
1039 |
xw.writeStartElement('DeletedFromUnsoldList');
|
|
|
1040 |
xw.writeElementString('Include', 'false');
|
|
|
1041 |
xw.writeEndElement(); /* DeletedFromUnsoldList */
|
|
|
1042 |
xw.writeStartElement('ScheduledList');
|
|
|
1043 |
xw.writeElementString('Include', 'false');
|
|
|
1044 |
xw.writeEndElement(); /* ScheduledList */
|
|
|
1045 |
xw.writeStartElement('SellingSummary');
|
|
|
1046 |
xw.writeElementString('Include', 'false');
|
|
|
1047 |
xw.writeEndElement(); /* SellingSummary */
|
|
|
1048 |
xw.writeStartElement('SoldList');
|
|
|
1049 |
xw.writeElementString('Include', 'false');
|
|
|
1050 |
xw.writeEndElement(); /* SoldList */
|
|
|
1051 |
|
|
|
1052 |
xw.writeStartElement(liveListing ? 'UnsoldList' : 'ActiveList');
|
|
|
1053 |
xw.writeElementString('Include', 'false');
|
|
|
1054 |
xw.writeEndElement(); /* ActiveList */
|
|
|
1055 |
|
|
|
1056 |
xw.writeStartElement(liveListing ? 'ActiveList' : 'UnsoldList');
|
|
|
1057 |
xw.writeElementString('Include', 'true');
|
|
|
1058 |
xw.writeElementString('IncludeNotes', 'true');
|
|
|
1059 |
xw.writeStartElement('Pagination');
|
|
|
1060 |
xw.writeElementString('EntriesPerPage', '200');
|
|
|
1061 |
xw.writeElementString('PageNumber', '' + pageNo);
|
|
|
1062 |
xw.writeEndElement(); /* Pagination*/
|
|
|
1063 |
xw.writeEndElement(); /* UnsoldList> */
|
|
|
1064 |
|
| 14 |
- |
1065 |
outputSelector = liveListing ? 'ActiveList.' : 'UnsoldList.';
|
|
|
1066 |
|
| 16 |
- |
1067 |
xw.writeElementString('OutputSelector', outputSelector + 'ItemArray.Item.SellingStatus.BidCount');
|
| 14 |
- |
1068 |
xw.writeElementString('OutputSelector', outputSelector + 'ItemArray.Item.BuyItNowPrice');
|
|
|
1069 |
xw.writeElementString('OutputSelector', outputSelector + 'ItemArray.Item.eBayNotes');
|
|
|
1070 |
xw.writeElementString('OutputSelector', outputSelector + 'ItemArray.Item.ItemID');
|
| 16 |
- |
1071 |
xw.writeElementString('OutputSelector', outputSelector + 'ItemArray.Item.ListingDetails.' + (liveListing ? 'StartTime' : 'EndTime'));
|
| 14 |
- |
1072 |
xw.writeElementString('OutputSelector', outputSelector + 'ItemArray.Item.ListingType');
|
|
|
1073 |
xw.writeElementString('OutputSelector', outputSelector + 'ItemArray.Item.PrivateNotes');
|
|
|
1074 |
xw.writeElementString('OutputSelector', outputSelector + 'ItemArray.Item.QuantityAvailable');
|
|
|
1075 |
xw.writeElementString('OutputSelector', outputSelector + 'ItemArray.Item.PictureDetails');
|
|
|
1076 |
xw.writeElementString('OutputSelector', outputSelector + 'ItemArray.Item.Relisted');
|
|
|
1077 |
xw.writeElementString('OutputSelector', outputSelector + 'ItemArray.Item.SKU');
|
|
|
1078 |
xw.writeElementString('OutputSelector', outputSelector + 'ItemArray.Item.Title');
|
|
|
1079 |
xw.writeElementString('OutputSelector', outputSelector + 'ItemArray.Item.StartPrice');
|
|
|
1080 |
xw.writeElementString('OutputSelector', outputSelector + 'ItemArray.Item.WatchCount');
|
|
|
1081 |
xw.writeElementString('OutputSelector', outputSelector + 'PaginationResult');
|
|
|
1082 |
|
| 2 |
- |
1083 |
xw.writeElementString('ErrorLanguage', 'en_US');
|
|
|
1084 |
xw.writeElementString('Version', configeBayTradingVersion);
|
|
|
1085 |
xw.writeElementString('WarningLevel', configWarningLevel);
|
|
|
1086 |
|
|
|
1087 |
xw.writeEndElement(); /* xmlrequest */
|
|
|
1088 |
xw.writeEndDocument();
|
|
|
1089 |
|
|
|
1090 |
xhr.open('POST', configProxyUrl, true);
|
|
|
1091 |
xhr.setRequestHeader('Content-Type', 'text/xml');
|
|
|
1092 |
xhr.setRequestHeader('X-EBAY-API-APP-NAME', configAppid);
|
|
|
1093 |
xhr.setRequestHeader('X-EBAY-API-COMPATIBILITY-LEVEL', configeBayTradingVersion);
|
|
|
1094 |
xhr.setRequestHeader('X-EBAY-API-CALL-NAME', callname);
|
|
|
1095 |
xhr.setRequestHeader('X-EBAY-API-SITEID', '0');
|
|
|
1096 |
xhr.setRequestHeader('X-EBAY-API-DEV-NAME', '');
|
|
|
1097 |
xhr.setRequestHeader('X-EBAY-API-CERT-NAME', '');
|
|
|
1098 |
xhr.setRequestHeader('X-Proxy-URL', configServiceEndpoint);
|
|
|
1099 |
|
|
|
1100 |
return true;
|
|
|
1101 |
}
|
|
|
1102 |
|
|
|
1103 |
function fillSorterListings() {
|
|
|
1104 |
var i;
|
|
|
1105 |
var x = document.getElementById(tableSorterName);
|
|
|
1106 |
var fillList = [];
|
|
|
1107 |
var maxItems = 20;
|
|
|
1108 |
|
|
|
1109 |
listingsToFill = 0;
|
|
|
1110 |
maxListingsToFill = 0;
|
|
|
1111 |
listingsFilled = 0;
|
|
|
1112 |
|
|
|
1113 |
initProgressBar('Filling Listing Information (2/2)');
|
|
|
1114 |
|
|
|
1115 |
for (i = 2; i < x.rows.length; i++) {
|
|
|
1116 |
fillList.push(x.rows[i].cells[3].innerHTML);
|
|
|
1117 |
}
|
| 6 |
- |
1118 |
|
| 16 |
- |
1119 |
for (i = 0; (i * maxItems) < fillList.length; i++) {
|
| 2 |
- |
1120 |
++listingsToFill;
|
|
|
1121 |
++maxListingsToFill;
|
|
|
1122 |
fillSorterListing(fillList.slice(i * maxItems, (i + 1) * maxItems));
|
|
|
1123 |
}
|
|
|
1124 |
|
|
|
1125 |
function checkListingsToFill() {
|
|
|
1126 |
if (listingsToFill > 0) {
|
|
|
1127 |
window.setTimeout(checkListingsToFill, 100); // wait 100 milliseconds
|
|
|
1128 |
} else {
|
|
|
1129 |
$("#" + tableSorterName).trigger("update");
|
|
|
1130 |
|
|
|
1131 |
endProgressBar();
|
|
|
1132 |
|
|
|
1133 |
x = document.getElementById("form1div");
|
|
|
1134 |
x.className = x.className.replace(" w3-show", "");
|
|
|
1135 |
x = document.getElementById("form2div");
|
|
|
1136 |
x.className += " w3-show";
|
|
|
1137 |
|
|
|
1138 |
x = document.getElementById("results");
|
|
|
1139 |
x.innerHTML += '<p><strong>Report Finished!</strong></p>';
|
|
|
1140 |
if (!x.className.includes("process-errors")) {
|
|
|
1141 |
setTimeout(function() {
|
|
|
1142 |
x.className = x.className.replace(" w3-show", "");
|
|
|
1143 |
}, 3000);
|
|
|
1144 |
}
|
|
|
1145 |
}
|
|
|
1146 |
}
|
|
|
1147 |
|
|
|
1148 |
checkListingsToFill();
|
|
|
1149 |
}
|
|
|
1150 |
|
|
|
1151 |
function fillSorterListing(itemIdList) {
|
|
|
1152 |
var i;
|
|
|
1153 |
var xml;
|
|
|
1154 |
|
|
|
1155 |
var xw = new XMLWriter('UTF-8', '1.0');
|
|
|
1156 |
var xhr = new XMLHttpRequest();
|
|
|
1157 |
|
|
|
1158 |
if (!createSorterFillXMLSearch(xw, xhr, 'GetMultipleItems', itemIdList)) {
|
|
|
1159 |
return;
|
|
|
1160 |
}
|
|
|
1161 |
|
|
|
1162 |
xml = xw.flush();
|
|
|
1163 |
xw.close();
|
|
|
1164 |
|
|
|
1165 |
xhr.onload = function() {
|
| 16 |
- |
1166 |
var jsonObj = XMLparse(xhr.responseXML, false);
|
|
|
1167 |
var obj = jsonObj.GetMultipleItemsResponse;
|
| 2 |
- |
1168 |
var returnCode = obj.Ack;
|
| 19 |
- |
1169 |
var str;
|
| 2 |
- |
1170 |
|
|
|
1171 |
var x = document.getElementById("results");
|
|
|
1172 |
|
|
|
1173 |
if (returnCode == 'Success') {
|
|
|
1174 |
for (i = 0; i < obj.Item.length; i++) {
|
|
|
1175 |
var itemId = getJsonValue(obj.Item[i].ItemID);
|
|
|
1176 |
document.getElementById("Views" + itemId).innerHTML = getJsonValue(obj.Item[i].HitCount);
|
|
|
1177 |
document.getElementById("Category" + itemId).innerHTML = getJsonValue(obj.Item[i].PrimaryCategoryName);
|
| 6 |
- |
1178 |
}
|
| 2 |
- |
1179 |
} else {
|
|
|
1180 |
x.className += " process-errors";
|
| 19 |
- |
1181 |
str = '<p class="w3-red"><strong>' + returnCode + ':</strong></p>';
|
| 2 |
- |
1182 |
|
| 6 |
- |
1183 |
var errors = getJsonArray(obj.Errors);
|
| 19 |
- |
1184 |
str += "<p>";
|
| 6 |
- |
1185 |
for (i = 0; i < errors.length; i++) {
|
| 19 |
- |
1186 |
str += errors[i].SeverityCode + " (" + errors[i].ErrorCode + "): " + escapeHtml(errors[i].LongMessage) + "<br/>";
|
| 2 |
- |
1187 |
}
|
|
|
1188 |
x.innerHTML += "</p>";
|
| 19 |
- |
1189 |
|
|
|
1190 |
x.innerHTML += str;
|
| 2 |
- |
1191 |
}
|
|
|
1192 |
|
|
|
1193 |
--listingsToFill;
|
|
|
1194 |
++listingsFilled;
|
|
|
1195 |
updateProgressBar(maxListingsToFill, listingsFilled);
|
|
|
1196 |
};
|
|
|
1197 |
|
|
|
1198 |
xhr.send(xml);
|
|
|
1199 |
}
|
|
|
1200 |
|
|
|
1201 |
function createSorterFillXMLSearch(xw, xhr, callname, itemIdList) {
|
|
|
1202 |
var i;
|
| 6 |
- |
1203 |
|
| 2 |
- |
1204 |
xw.writeStartDocument();
|
|
|
1205 |
xw.writeStartElement(callname + "Request");
|
|
|
1206 |
xw.writeAttributeString('xmlns', 'urn:ebay:apis:eBLBaseComponents');
|
|
|
1207 |
|
|
|
1208 |
for (i = 0; i < itemIdList.length; i++) {
|
|
|
1209 |
xw.writeElementString('ItemID', itemIdList[i]);
|
|
|
1210 |
}
|
|
|
1211 |
|
|
|
1212 |
xw.writeElementString('ErrorLanguage', 'en_US');
|
|
|
1213 |
xw.writeElementString('Version', configeBayShoppingVersion);
|
|
|
1214 |
xw.writeElementString('WarningLevel', configWarningLevel);
|
|
|
1215 |
|
|
|
1216 |
xw.writeEndElement(); /* xmlrequest */
|
|
|
1217 |
xw.writeEndDocument();
|
|
|
1218 |
|
|
|
1219 |
xhr.open('POST', configProxyUrl, true);
|
|
|
1220 |
xhr.setRequestHeader('Content-Type', 'text/xml');
|
|
|
1221 |
xhr.setRequestHeader('X-EBAY-API-APP-NAME', configAppid);
|
|
|
1222 |
xhr.setRequestHeader('X-EBAY-API-VERSION', configeBayShoppingVersion);
|
|
|
1223 |
xhr.setRequestHeader('X-EBAY-API-CALL-NAME', callname);
|
|
|
1224 |
xhr.setRequestHeader('X-EBAY-API-SITEID', '0');
|
|
|
1225 |
xhr.setRequestHeader('X-EBAY-API-DEV-NAME', '');
|
|
|
1226 |
xhr.setRequestHeader('X-EBAY-API-CERT-NAME', '');
|
|
|
1227 |
xhr.setRequestHeader('X-EBAY-API-REQUEST-ENCODING', 'XML');
|
|
|
1228 |
xhr.setRequestHeader('X-Proxy-URL', configeBayShopping);
|
|
|
1229 |
|
|
|
1230 |
return true;
|
|
|
1231 |
}
|
|
|
1232 |
|
|
|
1233 |
</script>
|
| 17 |
- |
1234 |
<script>includeHTML();</script>
|
| 2 |
- |
1235 |
|
|
|
1236 |
</body>
|
|
|
1237 |
</html>
|