testing
This commit is contained in:
@@ -60,7 +60,9 @@ class ProductCategoriesController extends AppController
|
||||
'ProductCategoryAttributes',
|
||||
'ProductCategoryAttributes.ProductCategoryAttributeOptions',
|
||||
]);
|
||||
$this->set(compact('productCategory'));
|
||||
|
||||
$productCategoryAttributes = $this->getTable()->ProductCategoryAttributes->getAllCategoryAttributesForCategoryId($productCategory->internal_id);
|
||||
$this->set(compact('productCategory', 'productCategoryAttributes'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -61,6 +61,7 @@ class ProductCategoryAttributesController extends AppController
|
||||
'ProductCategories',
|
||||
'ProductCategoryAttributeOptions',
|
||||
]);
|
||||
|
||||
$this->set(compact('productCategoryAttribute'));
|
||||
}
|
||||
|
||||
@@ -165,4 +166,11 @@ class ProductCategoryAttributesController extends AppController
|
||||
|
||||
return $this->redirect(['action' => 'index']);
|
||||
}
|
||||
|
||||
public function form($categoryId = null)
|
||||
{
|
||||
$productCategoryAttributes = $this->getTable()->getAllCategoryAttributesForCategoryId($categoryId);
|
||||
|
||||
$this->set(compact('productCategoryAttributes'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,8 +77,9 @@ class ProductsController extends AppController
|
||||
Log::debug(print_r($product->getErrors(), true));
|
||||
$this->Flash->error(__('The product could not be saved. Please, try again.'));
|
||||
}
|
||||
$productCategories = $productsTable->ProductCategories->find('list', keyField: 'internal_id', valueField: 'name' )->all();
|
||||
$this->set(compact('product', 'productCategories'));
|
||||
$productCategory = $product->product_category_id ? $productsTable->ProductCategories->find()->where(['internal_id' => $product->product_category_id])->first() : null;
|
||||
$productCatalogs = $productsTable->ProductCategories->ProductCatalogs->find('list')->toArray();
|
||||
$this->set(compact('product', 'productCatalogs', 'productCategory'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user