mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-05 12:56:04 -06:00
commit
254b1d35f4
@ -263,16 +263,16 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
|
|||||||
|
|
||||||
public function stockControl($id, $quantity)
|
public function stockControl($id, $quantity)
|
||||||
{
|
{
|
||||||
$adv = $this->getAdv($id);
|
if($adv = $this->getAdv($id))
|
||||||
$stock = $adv->stock;
|
{
|
||||||
if ($stock == NULL or $stock == 0) {
|
$stock = $adv->stock;
|
||||||
return 0;
|
|
||||||
} elseif ($stock < $quantity) {
|
|
||||||
return 0;//Adet yetmiyorsa
|
|
||||||
} else {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
if($stock and $stock >= $quantity)
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function saveCustomField($category_id, $field_id, $name)
|
public function saveCustomField($category_id, $field_id, $name)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user