WIP Snopp Order

This commit is contained in:
Frank Schubert
2026-01-22 17:07:51 +01:00
parent 225e14c74d
commit 976844d623
7 changed files with 334 additions and 47 deletions

View File

@@ -54,6 +54,28 @@ class Product extends mfBaseModel {
}
public function getAttributeValue($name) {
$attributes = $this->getProperty("attributes");
if(!array_key_exists($name, $attributes) || !$attributes[$name]->value) {
return null;
}
return $attributes[$name]->value;
}
public function getOwnerSnoppApiCredentials() {
$owner = $this->getProperty("owner");
if(!$owner) return false;
foreach(TT_SNOPP_API_CREDS as $api_creds) {
if($api_creds["address_id"] == $owner->id) {
return $api_creds;
}
}
return null;
}
public function getProperty($name) {
if($this->$name == null) {