products form wip

This commit is contained in:
2025-04-01 01:24:18 -07:00
parent 17de2e97dd
commit f724b86674
3 changed files with 74 additions and 3 deletions

View File

@@ -12,8 +12,9 @@
<?php
echo $this->Form->control('name');
echo $this->Form->control('product_catalog_id', [
'empty' => 'Select a Catalog',
'options' => $productCatalogs,
'hx-trigger' => 'change, load delay:1s',
'hx-trigger' => 'change, load delay:500ms',
'hx-get' => $this->Url->build([
'controller' => 'ProductCategories',
'action' => 'select',
@@ -22,9 +23,16 @@ echo $this->Form->control('product_catalog_id', [
'hx-target' => '#product_category_id',
]);
echo $this->Form->control('product_category_id', [
'options' => $productCategories ?? [],
'options' => [],
'empty' => true,
'id' => 'product_category_id',
'hx-trigger' => 'change, load delay:1s',
'hx-get' => $this->Url->build([
'controller' => 'ProductCategoryAttributes',
'action' => 'form',
0 => $productCategory ? $productCategory->product_catalog_id : '',
]),
'hx-target' => '#product-attributes-container',
]);
echo $this->Form->control('product_type_id');
?>