diff --git a/js/customElements/sellingTable.js b/js/customElements/sellingTable.js index 645687b..cf88d68 100644 --- a/js/customElements/sellingTable.js +++ b/js/customElements/sellingTable.js @@ -19,6 +19,11 @@ class sellingTable extends HTMLElement { "fieldName": "price", "displayType": "text" }, + { + "title": "Versand", + "fieldName": "shipping", + "displayType": "text" + }, { "title": "Link", "fieldName": "link", diff --git a/public/API/ebk.php b/public/API/ebk.php index 9ac74d0..29541c1 100644 --- a/public/API/ebk.php +++ b/public/API/ebk.php @@ -24,9 +24,16 @@ $ads = $response["{http://www.ebayclassifiedsgroup.com/schema/ad/v1}ads"]["value foreach($ads as $ad) { $element = [ "title" => $ad["title"]["value"], - "price" => $ad["price"]["amount"]["value"] . " €" + "price" => $ad["price"]["amount"]["value"] . " €", + "shipping" => "nein" ]; + foreach($ad["attributes"]["attribute"] as $attribute) { + if(str_contains($attribute["name"], "versand")) { + $element["shipping"] = $attribute["value"][0]["value"]; + } + } + foreach($ad["link"] as $link) { if($link["rel"] == "self-public-website") { $element["link"] = $link["href"];