attributes form wip

This commit is contained in:
2025-04-02 01:27:25 -07:00
parent 732819ff73
commit 2f80ba1fa3
4 changed files with 48 additions and 70 deletions

View File

@@ -161,13 +161,10 @@ class ProductCategoriesController extends AppController
'product_catalog_id' => $this->request->getQuery('product_catalog_id', -1),
],
]);
$form = $this->request->getQuery('form', 'product_category');
if ($form === 'product') {
$productCategoriesQ = $productCategoriesTable
->find('treeList', keyPath: 'internal_id', valuePath: 'name');
} else {
$productCategoriesQ = $productCategoriesTable->find('treeList');
}
$productCategoriesQ = $this->request->getQuery('form', 'product_category') === 'product' ?
$productCategoriesTable->find('treeList', keyPath: 'internal_id', valuePath: 'name') :
$productCategoriesTable->find('treeList');
$productCategories = $productCategoriesQ
->orderBy(['ProductCategories.name'])
->toArray();