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

fix: scope issues fixed -> int errors; fix: coupons cannot attach themselves to coupons

Übergeordneter 3613dd0d
Keine zugehörigen Branchen gefunden
Keine zugehörigen Tags gefunden
Keine zugehörigen Merge Requests gefunden
......@@ -213,6 +213,13 @@ public function setAttribute($key, $value)
$value = null;
}
if ($key === 'scope' ||
$key === 'discount_type' ||
$key === 'usage_type'
) {
$value = (int)$value;
}
parent::setAttribute($key, $value);
}
......@@ -353,11 +360,22 @@ public function canUsedWith(QUI\ERP\Products\Interfaces\ProductInterface $Produc
return false;
}
$articles = $this->getAttribute('articles');
$articles = explode(',', $articles);
// coupon
if ($Product->getId() === '-') {
return false;
}
$articles = $this->getAttribute('articles');
$categories = $this->getAttribute('categories');
$categories = explode(',', $categories);
if (is_string($articles)) {
$articles = explode(',', $articles);
}
if (is_string($categories)) {
$categories = explode(',', $categories);
}
// article / product check
if (empty($articles) && empty($categories)) {
......@@ -464,7 +482,7 @@ public function toPriceFactor($Locale = null)
}
if ($this->getAttribute('scope') == Handler::DISCOUNT_SCOPE_TOTAL) {
if ($this->getAttribute('scope') === Handler::DISCOUNT_SCOPE_TOTAL) {
return new PriceFactor([
'title' => $this->getTitle($Locale),
'description' => '',
......
0% Lade oder .
You are about to add 0 people to the discussion. Proceed with caution.
Bearbeitung dieser Nachricht zuerst beenden!
Bitte registrieren oder zum Kommentieren