variant options wip

This commit is contained in:
2025-07-05 20:08:56 -07:00
parent c9d34f7115
commit 5adc791c20
16 changed files with 462 additions and 1 deletions

View File

@@ -25,3 +25,4 @@
</div>
</div>
</div>
<?= $this->Html->script('CakeProducts.product_category_variant_options.js'); ?>

View File

@@ -30,3 +30,4 @@
</div>
</div>
</div>
<?= $this->Html->script('CakeProducts.product_category_variant_options.js'); ?>

View File

@@ -7,4 +7,7 @@ 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');
?>
?>
<legend><?= __('Variant Options') . '<small class="ms-2">' . $this->Html->link('Add Option', '#', [
'id' => 'add-option-button',
]) . '</small>'; ?></legend>

View File

@@ -0,0 +1,32 @@
<?php
/**
* @var \App\View\AppView $this
* @var \Cake\Datasource\EntityInterface $productCategoryAttributeOption
*/
$cnt = 0;
$prefix = $prefix ?? '';
\Cake\Log\Log::debug('$prefix');
\Cake\Log\Log::debug($prefix);
?>
<div class="container product-category-attribute-options-container" data-test="1" data-prefix="<?= $prefix; ?>">
<div class="row">
<div class="col">
<?= $this->Form->control($prefix . 'attribute_value', [
'label' => 'Value',
]); ?>
</div>
<div class="col">
<?= $this->Form->control($prefix . 'attribute_label', [
'label' => 'Label',
]); ?>
</div>
<div class="col">
<?= $this->Form->control($prefix . 'enabled', [
'type' => 'checkbox',
'checked' => true,
'label' => 'Enabled',
]); ?>
</div>
</div>
</div>