Merge pull request #1053 from openclassify/vedat

fixed stockControl
This commit is contained in:
Fatih Alp 2021-04-22 18:07:15 +03:00 committed by GitHub
commit 254b1d35f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -263,16 +263,16 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
public function stockControl($id, $quantity)
{
$adv = $this->getAdv($id);
$stock = $adv->stock;
if ($stock == NULL or $stock == 0) {
return 0;
} elseif ($stock < $quantity) {
return 0;//Adet yetmiyorsa
} else {
return 1;
}
if($adv = $this->getAdv($id))
{
$stock = $adv->stock;
if($stock and $stock >= $quantity)
{
return 1;
}
}
return 0;
}
public function saveCustomField($category_id, $field_id, $name)