Skip to content

Commit

Permalink
v6.1: Patch for added eBay item SKUs
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-mous committed Nov 16, 2020
1 parent fe09f7d commit cc2f977
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
11 changes: 6 additions & 5 deletions PrinterPiExtension/js/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

try { //Try eBay
let address = document.querySelector("#shipToAddress").innerText;
let shipping = document.querySelectorAll(".BuyerPurchaseDetails--1nhS6")[3].children[1].innerText;
let shipping = document.querySelectorAll(".BuyerPurchaseDetails--1nhS6")[3].children[1].innerText;
shipping = parseFloat(shipping.substring(shipping.indexOf("$")+1)); //Shipping as a float
let grandTotal = document.querySelectorAll(".BuyerPurchaseDetails--1nhS6")[2].children[1].innerText; //Shipping+items+tax
grandTotal = parseFloat(grandTotal.substring(grandTotal.indexOf("$")+1));
Expand All @@ -28,12 +28,13 @@
let item_arr = [];
for (let i=0; i<items.length; i++) { //Iterate through the items
let itm = items[i].children[1];
let price = itm.children[2].innerText;
itemTotal += parseFloat(price.substring(price.indexOf("$")+1));
let price = itm.children[3].innerText;
price = parseFloat(price.substring(price.indexOf("$")+1));
itemTotal += price;
item_arr.push({
desc: itm.children[0].innerText,
sku: "I",
qty: itm.children[1].innerText.slice(5),
sku: itm.children[1].innerText.slice(5),
qty: itm.children[2].innerText.slice(5),
price: price
});
}
Expand Down
2 changes: 1 addition & 1 deletion PrinterPiExtension/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"manifest_version": 2,
"name": "PrinterPi",
"version": "6.0",
"version": "6.1",
"description": "Parse eBay Print Shipping Label or PayPal Activity pages and send the data to an application that controls a receipt printer",

"options_page": "options.html",
Expand Down

0 comments on commit cc2f977

Please sign in to comment.