attributes form wip
This commit is contained in:
@@ -114,11 +114,16 @@ class ProductCategoryAttributesTable extends Table
|
||||
public function getAllCategoryAttributesForCategoryId(string $internalCategoryId)
|
||||
{
|
||||
$category = $this->ProductCategories->find()->where(['internal_id' => $internalCategoryId])->first();
|
||||
$categories = [];
|
||||
if ($category) {
|
||||
$categories = $this->ProductCategories->find('path', for: $category->id)->all();
|
||||
}
|
||||
|
||||
return $categories;
|
||||
$this->ProductCategories->behaviors()->get('Tree')->setConfig([
|
||||
'scope' => [
|
||||
'product_catalog_id' => $category->product_catalog_id ?? 1,
|
||||
],
|
||||
]);
|
||||
|
||||
return $category ? $this->ProductCategories
|
||||
->find('path', for: $category->id)
|
||||
->contain(['ProductCategoryAttributes', 'ProductCategoryAttributes.ProductCategoryAttributeOptions'])
|
||||
->toArray() : [];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user