Hallo,
gibt es keine Möglichkeit Tags für Produkte, über API, zu setzen?
Über Endpoint /product kommt die Meldung das ‚tagIds‘ write-protected sind.
Über Endpoint /tag kann man nur Tags bearbeiten aber keine Produkte zuweisen.
Gruß
Floo0
Hallo,
gibt es keine Möglichkeit Tags für Produkte, über API, zu setzen?
Über Endpoint /product kommt die Meldung das ‚tagIds‘ write-protected sind.
Über Endpoint /tag kann man nur Tags bearbeiten aber keine Produkte zuweisen.
Gruß
Floo0
Hi Floo0,
ja das geht, ich mache das über den _action/sync Endpoint:
$request_url = "/_action/sync";
$payload['create-product-tags'] = array(
"entity" => "product_tag",
"action" => "upsert",
"payload" => $id_mapping
);
Die Variable $id_mapping ist widerrum ein Array welches für jede Produkt / Tag Kombination die ID’s des Produktes / Tags als Array schachtelt.
Also:
$id_mapping = array( array( "productId => "fsdd8fs8...", "tagId" => "42398482..." ), array( "productId" => ... ) );