WIP Snopp Order
This commit is contained in:
@@ -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) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user