add shipping information
This commit is contained in:
parent
5fbd725f6c
commit
0eb8e4d22d
2 changed files with 13 additions and 1 deletions
|
@ -19,6 +19,11 @@ class sellingTable extends HTMLElement {
|
|||
"fieldName": "price",
|
||||
"displayType": "text"
|
||||
},
|
||||
{
|
||||
"title": "Versand",
|
||||
"fieldName": "shipping",
|
||||
"displayType": "text"
|
||||
},
|
||||
{
|
||||
"title": "Link",
|
||||
"fieldName": "link",
|
||||
|
|
|
@ -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"];
|
||||
|
|
Loading…
Reference in a new issue