Skip to content
Code-Schnipsel Gruppen Projekte
Commit 2b3a3c5d erstellt von Henning Leutz's avatar Henning Leutz :martial_arts_uniform:
Dateien durchsuchen

refactor: shipping setup checks if shipping ids exists

Übergeordneter 31c82c68
No related branches found
No related tags found
Keine zugehörigen Merge Requests gefunden
......@@ -8,6 +8,7 @@
use QUI;
use QUI\ERP\Products\Handler\Fields as ProductFields;
use QUI\ERP\Shipping\ShippingStatus\Handler;
use \Quiqqer\Engine\Collector;
/**
......@@ -82,9 +83,19 @@ public static function onPackageSetup()
};
$StatusFactory->createShippingStatus(1, '#dbb50c', $getLocaleTranslations('processing.status.default.1'));
$StatusFactory->createShippingStatus(2, '#418e73', $getLocaleTranslations('processing.status.default.2'));
$StatusFactory->createShippingStatus(3, '#4fd500', $getLocaleTranslations('processing.status.default.3'));
$Handler = QUI\ERP\Shipping\ShippingStatus\Handler::getInstance();
if (!$Handler->exists(1)) {
$StatusFactory->createShippingStatus(1, '#dbb50c', $getLocaleTranslations('processing.status.default.1'));
}
if (!$Handler->exists(2)) {
$StatusFactory->createShippingStatus(2, '#418e73', $getLocaleTranslations('processing.status.default.2'));
}
if (!$Handler->exists(3)) {
$StatusFactory->createShippingStatus(3, '#4fd500', $getLocaleTranslations('processing.status.default.3'));
}
// Product fields
......
......@@ -24,6 +24,19 @@ class Handler extends QUI\Utils\Singleton
*/
protected $list = null;
/**
* Exists a specific status?
*
* @param integer $id
* @return bool
*/
public function exists($id)
{
$list = Handler::getInstance()->getList();
return isset($list[$id]);
}
/**
* Return all shipping status entries from the config
*
......
0% oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren