Added product active flag, saving filter in Product/Index
This commit is contained in:
@@ -366,7 +366,7 @@ class OrderController extends mfBaseController {
|
||||
$this->layout()->setTemplate("Order/Form");
|
||||
if($this->me->is("Admin")) {
|
||||
//$this->layout()->set("addresses", AddressModel::search(['parents_only' => 1]));
|
||||
$this->layout()->set("products", ProductModel::getAll());
|
||||
$this->layout()->set("products", ProductModel::getActive());
|
||||
$this->layout()->set("terminations", TerminationModel::getAll());
|
||||
} else {
|
||||
// get all salespartner addresses of my networks
|
||||
@@ -396,6 +396,7 @@ class OrderController extends mfBaseController {
|
||||
// get products assigned to my networks
|
||||
$products = [];
|
||||
foreach(ProductNetworkModel::search(["network_id" => $network_ids]) as $pn) {
|
||||
if(!$pn->product->active) continue;
|
||||
if(!array_key_exists($pn->product_id, $products))
|
||||
$products[$pn->product_id] = $pn->product;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user