subscribtion category variants / system category variants
This commit is contained in:
@@ -2,11 +2,30 @@
|
||||
/**
|
||||
* @var array $productCategories
|
||||
* @var array $products
|
||||
* @var \CakeProducts\Model\Entity\ProductCategoryVariant|\Cake\Datasource\EntityInterface $productCategoryVariant
|
||||
*/
|
||||
echo $this->Form->control('name');
|
||||
echo $this->Form->control('product_category_id', ['options' => $productCategories, 'empty' => true]);
|
||||
echo $this->Form->control('product_id', ['options' => $products, 'empty' => true]);
|
||||
echo $this->Form->control('enabled');
|
||||
|
||||
$nameOptions = [];
|
||||
$categoryOptions = ['options' => $productCategories, 'empty' => true];
|
||||
$enabledOptions = [];
|
||||
if ($productCategoryVariant->is_system_variant) {
|
||||
$nameOptions = [
|
||||
'disabled' => true,
|
||||
'readonly' => true,
|
||||
];
|
||||
$categoryOptions = $categoryOptions + [
|
||||
'disabled' => true,
|
||||
'readonly' => true,
|
||||
];
|
||||
$enabledOptions = [
|
||||
'disabled' => true,
|
||||
'readonly' => true,
|
||||
];
|
||||
|
||||
}
|
||||
echo $this->Form->control('name', $nameOptions);
|
||||
echo $this->Form->control('product_category_id', $categoryOptions);
|
||||
echo $this->Form->control('enabled', $enabledOptions);
|
||||
?>
|
||||
<legend><?= __('Variant Options') . '<small class="ms-2">' . $this->Html->link('Add Option', '#', [
|
||||
'id' => 'add-option-button',
|
||||
|
||||
Reference in New Issue
Block a user