wip product category variants
CI / testsuite (mysql, 8.1, ) (push) Failing after 0s
Details
CI / testsuite (mysql, 8.4, ) (push) Failing after 0s
Details
CI / testsuite (pgsql, 8.1, ) (push) Failing after 0s
Details
CI / testsuite (pgsql, 8.4, ) (push) Failing after 0s
Details
CI / testsuite (sqlite, 8.1, ) (push) Failing after 0s
Details
CI / testsuite (sqlite, 8.1, prefer-lowest) (push) Failing after 0s
Details
CI / testsuite (sqlite, 8.4, ) (push) Failing after 0s
Details
CI / Coding Standard & Static Analysis (push) Failing after 0s
Details
CI / testsuite (mysql, 8.1, ) (push) Failing after 0s
Details
CI / testsuite (mysql, 8.4, ) (push) Failing after 0s
Details
CI / testsuite (pgsql, 8.1, ) (push) Failing after 0s
Details
CI / testsuite (pgsql, 8.4, ) (push) Failing after 0s
Details
CI / testsuite (sqlite, 8.1, ) (push) Failing after 0s
Details
CI / testsuite (sqlite, 8.1, prefer-lowest) (push) Failing after 0s
Details
CI / testsuite (sqlite, 8.4, ) (push) Failing after 0s
Details
CI / Coding Standard & Static Analysis (push) Failing after 0s
Details
This commit is contained in:
parent
a01805dc53
commit
f61a4161be
|
@ -0,0 +1,65 @@
|
||||||
|
<?php
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
use Migrations\AbstractMigration;
|
||||||
|
|
||||||
|
class CreateProductCategoryAttributes extends AbstractMigration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Change Method.
|
||||||
|
*
|
||||||
|
* More information on this method is available here:
|
||||||
|
* https://book.cakephp.org/phinx/0/en/migrations.html#the-change-method
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function change(): void
|
||||||
|
{
|
||||||
|
$table = $this->table('product_category_variants', ['id' => false, 'primary_key' => ['id']]);
|
||||||
|
$table->addColumn('id', 'uuid', [
|
||||||
|
'default' => null,
|
||||||
|
'null' => false,
|
||||||
|
]);
|
||||||
|
$table->addColumn('name', 'string', [
|
||||||
|
'default' => null,
|
||||||
|
'limit' => 255,
|
||||||
|
'null' => false,
|
||||||
|
]);
|
||||||
|
$table->addColumn('product_category_id', 'uuid', [
|
||||||
|
'default' => null,
|
||||||
|
'null' => true,
|
||||||
|
]);
|
||||||
|
$table->addColumn('product_id', 'uuid', [
|
||||||
|
'default' => null,
|
||||||
|
'null' => true,
|
||||||
|
]);
|
||||||
|
$table->addColumn('attribute_type_id', 'integer', [
|
||||||
|
'default' => null,
|
||||||
|
'limit' => 11,
|
||||||
|
'null' => false,
|
||||||
|
]);
|
||||||
|
$table->addColumn('enabled', 'boolean', [
|
||||||
|
'default' => null,
|
||||||
|
'null' => false,
|
||||||
|
]);
|
||||||
|
$table->addIndex([
|
||||||
|
'product_category_id',
|
||||||
|
], [
|
||||||
|
'name' => 'BY_PRODUCT_CATEGORY_ID',
|
||||||
|
'unique' => false,
|
||||||
|
]);
|
||||||
|
$table->addIndex([
|
||||||
|
'product_id',
|
||||||
|
], [
|
||||||
|
'name' => 'BY_PRODUCT_ID',
|
||||||
|
'unique' => false,
|
||||||
|
]);
|
||||||
|
$table->addIndex([
|
||||||
|
'name',
|
||||||
|
'product_category_id',
|
||||||
|
], [
|
||||||
|
'name' => 'BY_NAME_AND_PRODUCT_CATEGORY_ID_UNIQUE',
|
||||||
|
'unique' => true,
|
||||||
|
]);
|
||||||
|
$table->create();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,107 @@
|
||||||
|
<?php
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace CakeProducts\Controller;
|
||||||
|
|
||||||
|
use App\Controller\AppController;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ProductCategoryVariants Controller
|
||||||
|
*
|
||||||
|
* @property \App\Model\Table\ProductCategoryVariantsTable $ProductCategoryVariants
|
||||||
|
*/
|
||||||
|
class ProductCategoryVariantsController extends AppController
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Index method
|
||||||
|
*
|
||||||
|
* @return \Cake\Http\Response|null|void Renders view
|
||||||
|
*/
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
$query = $this->ProductCategoryVariants->find()
|
||||||
|
->contain(['ProductCategories', 'Products']);
|
||||||
|
$productCategoryVariants = $this->paginate($query);
|
||||||
|
|
||||||
|
$this->set(compact('productCategoryVariants'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* View method
|
||||||
|
*
|
||||||
|
* @param string|null $id Product Category Variant id.
|
||||||
|
* @return \Cake\Http\Response|null|void Renders view
|
||||||
|
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
|
||||||
|
*/
|
||||||
|
public function view($id = null)
|
||||||
|
{
|
||||||
|
$productCategoryVariant = $this->ProductCategoryVariants->get($id, contain: ['ProductCategories', 'Products']);
|
||||||
|
$this->set(compact('productCategoryVariant'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add method
|
||||||
|
*
|
||||||
|
* @return \Cake\Http\Response|null|void Redirects on successful add, renders view otherwise.
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
$productCategoryVariant = $this->ProductCategoryVariants->newEmptyEntity();
|
||||||
|
if ($this->request->is('post')) {
|
||||||
|
$productCategoryVariant = $this->ProductCategoryVariants->patchEntity($productCategoryVariant, $this->request->getData());
|
||||||
|
if ($this->ProductCategoryVariants->save($productCategoryVariant)) {
|
||||||
|
$this->Flash->success(__('The product category variant has been saved.'));
|
||||||
|
|
||||||
|
return $this->redirect(['action' => 'index']);
|
||||||
|
}
|
||||||
|
$this->Flash->error(__('The product category variant could not be saved. Please, try again.'));
|
||||||
|
}
|
||||||
|
$productCategories = $this->ProductCategoryVariants->ProductCategories->find('list', limit: 200)->all();
|
||||||
|
$products = $this->ProductCategoryVariants->Products->find('list', limit: 200)->all();
|
||||||
|
$this->set(compact('productCategoryVariant', 'productCategories', 'products'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Edit method
|
||||||
|
*
|
||||||
|
* @param string|null $id Product Category Variant id.
|
||||||
|
* @return \Cake\Http\Response|null|void Redirects on successful edit, renders view otherwise.
|
||||||
|
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
|
||||||
|
*/
|
||||||
|
public function edit($id = null)
|
||||||
|
{
|
||||||
|
$productCategoryVariant = $this->ProductCategoryVariants->get($id, contain: []);
|
||||||
|
if ($this->request->is(['patch', 'post', 'put'])) {
|
||||||
|
$productCategoryVariant = $this->ProductCategoryVariants->patchEntity($productCategoryVariant, $this->request->getData());
|
||||||
|
if ($this->ProductCategoryVariants->save($productCategoryVariant)) {
|
||||||
|
$this->Flash->success(__('The product category variant has been saved.'));
|
||||||
|
|
||||||
|
return $this->redirect(['action' => 'index']);
|
||||||
|
}
|
||||||
|
$this->Flash->error(__('The product category variant could not be saved. Please, try again.'));
|
||||||
|
}
|
||||||
|
$productCategories = $this->ProductCategoryVariants->ProductCategories->find('list', limit: 200)->all();
|
||||||
|
$products = $this->ProductCategoryVariants->Products->find('list', limit: 200)->all();
|
||||||
|
$this->set(compact('productCategoryVariant', 'productCategories', 'products'));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete method
|
||||||
|
*
|
||||||
|
* @param string|null $id Product Category Variant id.
|
||||||
|
* @return \Cake\Http\Response|null Redirects to index.
|
||||||
|
* @throws \Cake\Datasource\Exception\RecordNotFoundException When record not found.
|
||||||
|
*/
|
||||||
|
public function delete($id = null)
|
||||||
|
{
|
||||||
|
$this->request->allowMethod(['post', 'delete']);
|
||||||
|
$productCategoryVariant = $this->ProductCategoryVariants->get($id);
|
||||||
|
if ($this->ProductCategoryVariants->delete($productCategoryVariant)) {
|
||||||
|
$this->Flash->success(__('The product category variant has been deleted.'));
|
||||||
|
} else {
|
||||||
|
$this->Flash->error(__('The product category variant could not be deleted. Please, try again.'));
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->redirect(['action' => 'index']);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,41 @@
|
||||||
|
<?php
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace CakeProducts\Model\Entity;
|
||||||
|
|
||||||
|
use Cake\ORM\Entity;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ProductCategoryVariant Entity
|
||||||
|
*
|
||||||
|
* @property string $id
|
||||||
|
* @property string $name
|
||||||
|
* @property string|null $product_category_id
|
||||||
|
* @property string|null $product_id
|
||||||
|
* @property int $attribute_type_id
|
||||||
|
* @property bool $enabled
|
||||||
|
*
|
||||||
|
* @property \App\Model\Entity\ProductCategory $product_category
|
||||||
|
* @property \App\Model\Entity\Product $product
|
||||||
|
*/
|
||||||
|
class ProductCategoryVariant extends Entity
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Fields that can be mass assigned using newEntity() or patchEntity().
|
||||||
|
*
|
||||||
|
* Note that when '*' is set to true, this allows all unspecified fields to
|
||||||
|
* be mass assigned. For security purposes, it is advised to set '*' to false
|
||||||
|
* (or remove it), and explicitly make individual fields accessible as needed.
|
||||||
|
*
|
||||||
|
* @var array<string, bool>
|
||||||
|
*/
|
||||||
|
protected array $_accessible = [
|
||||||
|
'name' => true,
|
||||||
|
'product_category_id' => true,
|
||||||
|
'product_id' => true,
|
||||||
|
'attribute_type_id' => true,
|
||||||
|
'enabled' => true,
|
||||||
|
'product_category' => true,
|
||||||
|
'product' => true,
|
||||||
|
];
|
||||||
|
}
|
|
@ -0,0 +1,108 @@
|
||||||
|
<?php
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace CakeProducts\Model\Table;
|
||||||
|
|
||||||
|
use Cake\ORM\Query\SelectQuery;
|
||||||
|
use Cake\ORM\RulesChecker;
|
||||||
|
use Cake\ORM\Table;
|
||||||
|
use Cake\Validation\Validator;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* ProductCategoryVariants Model
|
||||||
|
*
|
||||||
|
* @property \App\Model\Table\ProductCategoriesTable&\Cake\ORM\Association\BelongsTo $ProductCategories
|
||||||
|
* @property \App\Model\Table\ProductsTable&\Cake\ORM\Association\BelongsTo $Products
|
||||||
|
*
|
||||||
|
* @method \App\Model\Entity\ProductCategoryVariant newEmptyEntity()
|
||||||
|
* @method \App\Model\Entity\ProductCategoryVariant newEntity(array $data, array $options = [])
|
||||||
|
* @method array<\App\Model\Entity\ProductCategoryVariant> newEntities(array $data, array $options = [])
|
||||||
|
* @method \App\Model\Entity\ProductCategoryVariant get(mixed $primaryKey, array|string $finder = 'all', \Psr\SimpleCache\CacheInterface|string|null $cache = null, \Closure|string|null $cacheKey = null, mixed ...$args)
|
||||||
|
* @method \App\Model\Entity\ProductCategoryVariant findOrCreate($search, ?callable $callback = null, array $options = [])
|
||||||
|
* @method \App\Model\Entity\ProductCategoryVariant patchEntity(\Cake\Datasource\EntityInterface $entity, array $data, array $options = [])
|
||||||
|
* @method array<\App\Model\Entity\ProductCategoryVariant> patchEntities(iterable $entities, array $data, array $options = [])
|
||||||
|
* @method \App\Model\Entity\ProductCategoryVariant|false save(\Cake\Datasource\EntityInterface $entity, array $options = [])
|
||||||
|
* @method \App\Model\Entity\ProductCategoryVariant saveOrFail(\Cake\Datasource\EntityInterface $entity, array $options = [])
|
||||||
|
* @method iterable<\App\Model\Entity\ProductCategoryVariant>|\Cake\Datasource\ResultSetInterface<\App\Model\Entity\ProductCategoryVariant>|false saveMany(iterable $entities, array $options = [])
|
||||||
|
* @method iterable<\App\Model\Entity\ProductCategoryVariant>|\Cake\Datasource\ResultSetInterface<\App\Model\Entity\ProductCategoryVariant> saveManyOrFail(iterable $entities, array $options = [])
|
||||||
|
* @method iterable<\App\Model\Entity\ProductCategoryVariant>|\Cake\Datasource\ResultSetInterface<\App\Model\Entity\ProductCategoryVariant>|false deleteMany(iterable $entities, array $options = [])
|
||||||
|
* @method iterable<\App\Model\Entity\ProductCategoryVariant>|\Cake\Datasource\ResultSetInterface<\App\Model\Entity\ProductCategoryVariant> deleteManyOrFail(iterable $entities, array $options = [])
|
||||||
|
*/
|
||||||
|
class ProductCategoryVariantsTable extends Table
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Initialize method
|
||||||
|
*
|
||||||
|
* @param array<string, mixed> $config The configuration for the Table.
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function initialize(array $config): void
|
||||||
|
{
|
||||||
|
parent::initialize($config);
|
||||||
|
|
||||||
|
$this->setTable('product_category_variants');
|
||||||
|
$this->setDisplayField('name');
|
||||||
|
$this->setPrimaryKey('id');
|
||||||
|
|
||||||
|
$this->belongsTo('ProductCategories', [
|
||||||
|
'foreignKey' => 'product_category_id',
|
||||||
|
'bindingKey' => 'internal_id',
|
||||||
|
'className' => 'CakeProducts.ProductCategories',
|
||||||
|
]);
|
||||||
|
$this->belongsTo('Products', [
|
||||||
|
'foreignKey' => 'product_id',
|
||||||
|
'className' => 'CakeProducts.Products',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Default validation rules.
|
||||||
|
*
|
||||||
|
* @param \Cake\Validation\Validator $validator Validator instance.
|
||||||
|
* @return \Cake\Validation\Validator
|
||||||
|
*/
|
||||||
|
public function validationDefault(Validator $validator): Validator
|
||||||
|
{
|
||||||
|
$validator
|
||||||
|
->scalar('name')
|
||||||
|
->maxLength('name', 255)
|
||||||
|
->requirePresence('name', 'create')
|
||||||
|
->notEmptyString('name');
|
||||||
|
|
||||||
|
$validator
|
||||||
|
->uuid('product_category_id')
|
||||||
|
->allowEmptyString('product_category_id');
|
||||||
|
|
||||||
|
$validator
|
||||||
|
->uuid('product_id')
|
||||||
|
->allowEmptyString('product_id');
|
||||||
|
|
||||||
|
$validator
|
||||||
|
->integer('attribute_type_id')
|
||||||
|
->requirePresence('attribute_type_id', 'create')
|
||||||
|
->notEmptyString('attribute_type_id');
|
||||||
|
|
||||||
|
$validator
|
||||||
|
->boolean('enabled')
|
||||||
|
->requirePresence('enabled', 'create')
|
||||||
|
->notEmptyString('enabled');
|
||||||
|
|
||||||
|
return $validator;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns a rules checker object that will be used for validating
|
||||||
|
* application integrity.
|
||||||
|
*
|
||||||
|
* @param \Cake\ORM\RulesChecker $rules The rules object to be modified.
|
||||||
|
* @return \Cake\ORM\RulesChecker
|
||||||
|
*/
|
||||||
|
public function buildRules(RulesChecker $rules): RulesChecker
|
||||||
|
{
|
||||||
|
$rules->add($rules->isUnique(['name', 'product_category_id', 'product_id'], ['allowMultipleNulls' => true]), ['errorField' => 'product_category_id']);
|
||||||
|
$rules->add($rules->existsIn(['product_category_id'], 'ProductCategories'), ['errorField' => 'product_category_id']);
|
||||||
|
$rules->add($rules->existsIn(['product_id'], 'Products'), ['errorField' => 'product_id']);
|
||||||
|
|
||||||
|
return $rules;
|
||||||
|
}
|
||||||
|
}
|
|
@ -7,7 +7,7 @@
|
||||||
$this->setLayout('ajax');
|
$this->setLayout('ajax');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<option value="">Select a <?= strpos($this->getRequest()->referer(), 'products/add') ? 'Category ' : 'parent '; ?>(optional)</option>
|
<option value="">Select a <?= $this->request->getQuery('form', 'cataegory') == 'product' ? 'Category ' : 'parent (optional)'; ?></option>
|
||||||
<?php foreach ($productCategories as $productCategoryId => $productCategoryName): ?>
|
<?php foreach ($productCategories as $productCategoryId => $productCategoryName): ?>
|
||||||
<option value="<?= $productCategoryId; ?>" <?= $this->request->getQuery('category_id') == $productCategoryId ? 'selected="selected"' : ''; ?>><?= $productCategoryName; ?></option>
|
<option value="<?= $productCategoryId; ?>" <?= $this->request->getQuery('category_id') == $productCategoryId ? 'selected="selected"' : ''; ?>><?= $productCategoryName; ?></option>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
|
@ -0,0 +1,33 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @var \App\View\AppView $this
|
||||||
|
* @var \App\Model\Entity\ProductCategoryVariant $productCategoryVariant
|
||||||
|
* @var \Cake\Collection\CollectionInterface|string[] $productCategories
|
||||||
|
* @var \Cake\Collection\CollectionInterface|string[] $products
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<div class="row">
|
||||||
|
<aside class="column">
|
||||||
|
<div class="side-nav">
|
||||||
|
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||||
|
<?= $this->Html->link(__('List Product Category Variants'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||||
|
</div>
|
||||||
|
</aside>
|
||||||
|
<div class="column column-80">
|
||||||
|
<div class="productCategoryVariants form content">
|
||||||
|
<?= $this->Form->create($productCategoryVariant) ?>
|
||||||
|
<fieldset>
|
||||||
|
<legend><?= __('Add Product Category Variant') ?></legend>
|
||||||
|
<?php
|
||||||
|
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('attribute_type_id');
|
||||||
|
echo $this->Form->control('enabled');
|
||||||
|
?>
|
||||||
|
</fieldset>
|
||||||
|
<?= $this->Form->button(__('Submit')) ?>
|
||||||
|
<?= $this->Form->end() ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -0,0 +1,38 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @var \App\View\AppView $this
|
||||||
|
* @var \App\Model\Entity\ProductCategoryVariant $productCategoryVariant
|
||||||
|
* @var string[]|\Cake\Collection\CollectionInterface $productCategories
|
||||||
|
* @var string[]|\Cake\Collection\CollectionInterface $products
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<div class="row">
|
||||||
|
<aside class="column">
|
||||||
|
<div class="side-nav">
|
||||||
|
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||||
|
<?= $this->Form->postLink(
|
||||||
|
__('Delete'),
|
||||||
|
['action' => 'delete', $productCategoryVariant->id],
|
||||||
|
['confirm' => __('Are you sure you want to delete # {0}?', $productCategoryVariant->id), 'class' => 'side-nav-item']
|
||||||
|
) ?>
|
||||||
|
<?= $this->Html->link(__('List Product Category Variants'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||||
|
</div>
|
||||||
|
</aside>
|
||||||
|
<div class="column column-80">
|
||||||
|
<div class="productCategoryVariants form content">
|
||||||
|
<?= $this->Form->create($productCategoryVariant) ?>
|
||||||
|
<fieldset>
|
||||||
|
<legend><?= __('Edit Product Category Variant') ?></legend>
|
||||||
|
<?php
|
||||||
|
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('attribute_type_id');
|
||||||
|
echo $this->Form->control('enabled');
|
||||||
|
?>
|
||||||
|
</fieldset>
|
||||||
|
<?= $this->Form->button(__('Submit')) ?>
|
||||||
|
<?= $this->Form->end() ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -0,0 +1,52 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @var \App\View\AppView $this
|
||||||
|
* @var iterable<\App\Model\Entity\ProductCategoryVariant> $productCategoryVariants
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<div class="productCategoryVariants index content">
|
||||||
|
<?= $this->Html->link(__('New Product Category Variant'), ['action' => 'add'], ['class' => 'button float-right']) ?>
|
||||||
|
<h3><?= __('Product Category Variants') ?></h3>
|
||||||
|
<div class="table-responsive" id="table-container">
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th><?= $this->Paginator->sort('id') ?></th>
|
||||||
|
<th><?= $this->Paginator->sort('name') ?></th>
|
||||||
|
<th><?= $this->Paginator->sort('product_category_id') ?></th>
|
||||||
|
<th><?= $this->Paginator->sort('product_id') ?></th>
|
||||||
|
<th><?= $this->Paginator->sort('attribute_type_id') ?></th>
|
||||||
|
<th><?= $this->Paginator->sort('enabled') ?></th>
|
||||||
|
<th class="actions"><?= __('Actions') ?></th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php foreach ($productCategoryVariants as $productCategoryVariant): ?>
|
||||||
|
<tr>
|
||||||
|
<td><?= h($productCategoryVariant->id) ?></td>
|
||||||
|
<td><?= h($productCategoryVariant->name) ?></td>
|
||||||
|
<td><?= $productCategoryVariant->hasValue('product_category') ? $this->Html->link($productCategoryVariant->product_category->name, ['controller' => 'ProductCategories', 'action' => 'view', $productCategoryVariant->product_category->id]) : '' ?></td>
|
||||||
|
<td><?= $productCategoryVariant->hasValue('product') ? $this->Html->link($productCategoryVariant->product->name, ['controller' => 'Products', 'action' => 'view', $productCategoryVariant->product->id]) : '' ?></td>
|
||||||
|
<td><?= $this->Number->format($productCategoryVariant->attribute_type_id) ?></td>
|
||||||
|
<td><?= h($productCategoryVariant->enabled) ?></td>
|
||||||
|
<td class="actions">
|
||||||
|
<?= $this->Html->link(__('View'), ['action' => 'view', $productCategoryVariant->id]) ?>
|
||||||
|
<?= $this->Html->link(__('Edit'), ['action' => 'edit', $productCategoryVariant->id]) ?>
|
||||||
|
<?= $this->Form->postLink(__('Delete'), ['action' => 'delete', $productCategoryVariant->id], ['confirm' => __('Are you sure you want to delete # {0}?', $productCategoryVariant->id)]) ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="paginator">
|
||||||
|
<ul class="pagination">
|
||||||
|
<?= $this->Paginator->first('<< ' . __('first')) ?>
|
||||||
|
<?= $this->Paginator->prev('< ' . __('previous')) ?>
|
||||||
|
<?= $this->Paginator->numbers() ?>
|
||||||
|
<?= $this->Paginator->next(__('next') . ' >') ?>
|
||||||
|
<?= $this->Paginator->last(__('last') . ' >>') ?>
|
||||||
|
</ul>
|
||||||
|
<p><?= $this->Paginator->counter(__('Page {{page}} of {{pages}}, showing {{current}} record(s) out of {{count}} total')) ?></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -0,0 +1,48 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* @var \App\View\AppView $this
|
||||||
|
* @var \App\Model\Entity\ProductCategoryVariant $productCategoryVariant
|
||||||
|
*/
|
||||||
|
?>
|
||||||
|
<div class="row">
|
||||||
|
<aside class="column">
|
||||||
|
<div class="side-nav">
|
||||||
|
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||||
|
<?= $this->Html->link(__('Edit Product Category Variant'), ['action' => 'edit', $productCategoryVariant->id], ['class' => 'side-nav-item']) ?>
|
||||||
|
<?= $this->Form->postLink(__('Delete Product Category Variant'), ['action' => 'delete', $productCategoryVariant->id], ['confirm' => __('Are you sure you want to delete # {0}?', $productCategoryVariant->id), 'class' => 'side-nav-item']) ?>
|
||||||
|
<?= $this->Html->link(__('List Product Category Variants'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||||
|
<?= $this->Html->link(__('New Product Category Variant'), ['action' => 'add'], ['class' => 'side-nav-item']) ?>
|
||||||
|
</div>
|
||||||
|
</aside>
|
||||||
|
<div class="column column-80">
|
||||||
|
<div class="productCategoryVariants view content">
|
||||||
|
<h3><?= h($productCategoryVariant->name) ?></h3>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<th><?= __('Id') ?></th>
|
||||||
|
<td><?= h($productCategoryVariant->id) ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><?= __('Name') ?></th>
|
||||||
|
<td><?= h($productCategoryVariant->name) ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><?= __('Product Category') ?></th>
|
||||||
|
<td><?= $productCategoryVariant->hasValue('product_category') ? $this->Html->link($productCategoryVariant->product_category->name, ['controller' => 'ProductCategories', 'action' => 'view', $productCategoryVariant->product_category->id]) : '' ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><?= __('Product') ?></th>
|
||||||
|
<td><?= $productCategoryVariant->hasValue('product') ? $this->Html->link($productCategoryVariant->product->name, ['controller' => 'Products', 'action' => 'view', $productCategoryVariant->product->id]) : '' ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><?= __('Attribute Type Id') ?></th>
|
||||||
|
<td><?= $this->Number->format($productCategoryVariant->attribute_type_id) ?></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><?= __('Enabled') ?></th>
|
||||||
|
<td><?= $productCategoryVariant->enabled ? __('Yes') : __('No'); ?></td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
|
@ -16,14 +16,7 @@
|
||||||
<?= $this->Form->create($productSku) ?>
|
<?= $this->Form->create($productSku) ?>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend><?= __('Add Product Sku') ?></legend>
|
<legend><?= __('Add Product Sku') ?></legend>
|
||||||
<?php
|
<?= $this->element('ProductSkus/form'); ?>
|
||||||
echo $this->Form->control('product_id');
|
|
||||||
echo $this->Form->control('sku');
|
|
||||||
echo $this->Form->control('barcode');
|
|
||||||
echo $this->Form->control('price');
|
|
||||||
echo $this->Form->control('cost');
|
|
||||||
echo $this->Form->control('deleted', ['empty' => true]);
|
|
||||||
?>
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<?= $this->Form->button(__('Submit')) ?>
|
<?= $this->Form->button(__('Submit')) ?>
|
||||||
<?= $this->Form->end() ?>
|
<?= $this->Form->end() ?>
|
||||||
|
|
|
@ -21,13 +21,7 @@
|
||||||
<?= $this->Form->create($productSku) ?>
|
<?= $this->Form->create($productSku) ?>
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<legend><?= __('Edit Product Skus') ?></legend>
|
<legend><?= __('Edit Product Skus') ?></legend>
|
||||||
<?php
|
<?= $this->element('ProductSkus/form'); ?>
|
||||||
echo $this->Form->control('product_id');
|
|
||||||
echo $this->Form->control('sku');
|
|
||||||
echo $this->Form->control('barcode');
|
|
||||||
echo $this->Form->control('price');
|
|
||||||
echo $this->Form->control('cost');
|
|
||||||
?>
|
|
||||||
</fieldset>
|
</fieldset>
|
||||||
<?= $this->Form->button(__('Submit')) ?>
|
<?= $this->Form->button(__('Submit')) ?>
|
||||||
<?= $this->Form->end() ?>
|
<?= $this->Form->end() ?>
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
<?php
|
||||||
|
echo $this->Form->control('product_id');
|
||||||
|
echo $this->Form->control('sku');
|
||||||
|
echo $this->Form->control('barcode');
|
||||||
|
echo $this->Form->control('price');
|
||||||
|
echo $this->Form->control('cost');
|
||||||
|
?>
|
Loading…
Reference in New Issue