2025-08-10 09:35:25 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var \App\View\AppView $this
|
|
|
|
* @var \CakeProducts\Model\Entity\Product[]|\Cake\Datasource\EntityInterface[] $products
|
|
|
|
* @var \CakeProducts\Model\Entity\Product[]|\Cake\Datasource\EntityInterface[] $productSkus
|
|
|
|
* @var bool $includeFile
|
|
|
|
*/
|
|
|
|
$includeFile = $includeFile ?? false;
|
|
|
|
|
2025-10-12 09:20:02 +00:00
|
|
|
echo $this->Form->control('product_catalog_id', [
|
|
|
|
'empty' => 'Select a Catalog',
|
|
|
|
'options' => $productCatalogs ?? [],
|
|
|
|
'hx-trigger' => 'change, load delay:500ms',
|
|
|
|
'hx-get' => $this->Url->build([
|
|
|
|
'controller' => 'ProductCategories',
|
|
|
|
'action' => 'select',
|
|
|
|
'?' => ['form' => 'product_photo'],
|
|
|
|
]),
|
|
|
|
'hx-target' => '#product_category_id',
|
|
|
|
]);
|
|
|
|
echo $this->Form->control('product_category_id', [
|
|
|
|
'options' => [],
|
|
|
|
'empty' => true,
|
|
|
|
'id' => 'product_category_id',
|
|
|
|
'hx-trigger' => 'change, load delay:1s',
|
|
|
|
'hx-get' => $this->Url->build([
|
|
|
|
'controller' => 'Products',
|
|
|
|
'action' => 'select',
|
|
|
|
'?' => ['form' => 'product_photo'],
|
|
|
|
]),
|
|
|
|
'hx-target' => '#product_id',
|
|
|
|
]);
|
|
|
|
|
2025-08-10 09:35:25 +00:00
|
|
|
echo $this->Form->control('product_id', [
|
|
|
|
'options' => $products ?? [],
|
2025-10-12 09:20:02 +00:00
|
|
|
'empty' => true,
|
|
|
|
'hx-trigger' => 'change, load delay:1s',
|
|
|
|
'id' => 'product_id',
|
|
|
|
'hx-get' => $this->Url->build([
|
|
|
|
'controller' => 'ProductSkus',
|
|
|
|
'action' => 'select',
|
|
|
|
'?' => ['form' => 'product'],
|
|
|
|
]),
|
|
|
|
'hx-target' => '#product_sku_id',
|
2025-08-10 09:35:25 +00:00
|
|
|
]);
|
|
|
|
echo $this->Form->control('product_sku_id', [
|
2025-10-12 09:20:02 +00:00
|
|
|
'options' => $productSkus ?? [],
|
|
|
|
'empty' => true,
|
|
|
|
'id' => 'product_sku_id',
|
2025-08-10 09:35:25 +00:00
|
|
|
]);
|
|
|
|
|
|
|
|
echo $includeFile ? $this->Form->control('photo', [
|
|
|
|
'type' => 'file',
|
|
|
|
]) : '';
|
|
|
|
echo $this->Form->control('primary_photo');
|
2025-10-12 09:20:02 +00:00
|
|
|
echo $this->Form->control('primary_category_photo');
|
2025-08-10 09:35:25 +00:00
|
|
|
echo $this->Form->control('photo_position');
|
|
|
|
echo $this->Form->control('enabled');
|
|
|
|
?>
|