more product types (events, subscriptions, digital goods), photos templates index/view
This commit is contained in:
parent
46e8712161
commit
868f9dbcce
|
|
@ -30,7 +30,7 @@ class ProductPhotosController extends AppController
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$query = $this->getTable()->find()
|
$query = $this->getTable()->find()
|
||||||
->contain(['Products', 'ProductSkus']);
|
->contain(['Products', 'ProductSkus', 'ProductCategories']);
|
||||||
$productPhotos = $this->paginate($query);
|
$productPhotos = $this->paginate($query);
|
||||||
|
|
||||||
$this->set(compact('productPhotos'));
|
$this->set(compact('productPhotos'));
|
||||||
|
|
|
||||||
|
|
@ -11,13 +11,19 @@ enum ProductProductTypeId: int implements EnumLabelInterface
|
||||||
case Service = 1;
|
case Service = 1;
|
||||||
case Product = 2;
|
case Product = 2;
|
||||||
case Consumable = 3;
|
case Consumable = 3;
|
||||||
|
case DigitalGood = 4;
|
||||||
|
case Subscription = 5;
|
||||||
|
// case Event = 5;
|
||||||
|
|
||||||
public function label(): string
|
public function label(): string
|
||||||
{
|
{
|
||||||
return match($this) {
|
return match($this) {
|
||||||
self::Service => 'Service',
|
self::Service => 'Service',
|
||||||
self::Product => 'Product',
|
self::Product => 'Product',
|
||||||
self::Consumable => 'Consumable'
|
self::Consumable => 'Consumable',
|
||||||
|
self::DigitalGood => 'Digital Good',
|
||||||
|
self::Subscription => 'Subscription',
|
||||||
|
// self::Event => 'Event',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th><?= $this->Paginator->sort('id') ?></th>
|
<th><?= $this->Paginator->sort('id') ?></th>
|
||||||
|
<th><?= $this->Paginator->sort('product_category_id') ?></th>
|
||||||
<th><?= $this->Paginator->sort('product_id') ?></th>
|
<th><?= $this->Paginator->sort('product_id') ?></th>
|
||||||
<th><?= $this->Paginator->sort('product_sku_id') ?></th>
|
<th><?= $this->Paginator->sort('product_sku_id') ?></th>
|
||||||
<th><?= $this->Paginator->sort('photo_filename') ?></th>
|
<th><?= $this->Paginator->sort('photo_filename') ?></th>
|
||||||
|
|
@ -28,8 +29,9 @@
|
||||||
<?php foreach ($productPhotos as $productPhoto): ?>
|
<?php foreach ($productPhotos as $productPhoto): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?= h($productPhoto->id) ?></td>
|
<td><?= h($productPhoto->id) ?></td>
|
||||||
|
<td><?= $productPhoto->hasValue('product_category') ? $this->Html->link($productPhoto->product_category->name, ['controller' => 'ProductCategories', 'action' => 'view', $productPhoto->product_category->internal_id]) : '' ?></td>
|
||||||
<td><?= $productPhoto->hasValue('product') ? $this->Html->link($productPhoto->product->name, ['controller' => 'Products', 'action' => 'view', $productPhoto->product->id]) : '' ?></td>
|
<td><?= $productPhoto->hasValue('product') ? $this->Html->link($productPhoto->product->name, ['controller' => 'Products', 'action' => 'view', $productPhoto->product->id]) : '' ?></td>
|
||||||
<td><?= h($productPhoto->product_sku_id) ?></td>
|
<td><?= $productPhoto->hasValue('product_sku') ? $this->Html->link($productPhoto->product_sku->sku, ['controller' => 'ProductSkus', 'action' => 'view', $productPhoto->product_sku->id]) : '' ?></td>
|
||||||
<td><?= h($productPhoto->photo_filename) ?></td>
|
<td><?= h($productPhoto->photo_filename) ?></td>
|
||||||
<td><?= h($productPhoto->primary_photo) ?></td>
|
<td><?= h($productPhoto->primary_photo) ?></td>
|
||||||
<td><?= $this->Number->format($productPhoto->photo_position) ?></td>
|
<td><?= $this->Number->format($productPhoto->photo_position) ?></td>
|
||||||
|
|
|
||||||
|
|
@ -26,13 +26,18 @@
|
||||||
<th><?= __('Id') ?></th>
|
<th><?= __('Id') ?></th>
|
||||||
<td><?= h($productPhoto->id) ?></td>
|
<td><?= h($productPhoto->id) ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<th><?= __('Product Category') ?></th>
|
||||||
|
<td><?= $productPhoto->hasValue('product_category') ? $this->Html->link($productPhoto->product_category->name, ['controller' => 'ProductCategories', 'action' => 'view', $productPhoto->product_category->internal_id]) : '' ?></td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th><?= __('Product') ?></th>
|
<th><?= __('Product') ?></th>
|
||||||
<td><?= $productPhoto->hasValue('product') ? $this->Html->link($productPhoto->product->name, ['controller' => 'Products', 'action' => 'view', $productPhoto->product->id]) : '' ?></td>
|
<td><?= $productPhoto->hasValue('product') ? $this->Html->link($productPhoto->product->name, ['controller' => 'Products', 'action' => 'view', $productPhoto->product->id]) : '' ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th><?= __('Product Sku Id') ?></th>
|
<th><?= __('SKU') ?></th>
|
||||||
<td><?= h($productPhoto->product_sku_id) ?></td>
|
<td><?= $productPhoto->hasValue('product_sku') ? $this->Html->link($productPhoto->product_sku->sku, ['controller' => 'ProductSkus', 'action' => 'view', $productPhoto->product_sku->id]) : '' ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th><?= __('Photo Filename') ?></th>
|
<th><?= __('Photo Filename') ?></th>
|
||||||
|
|
@ -54,10 +59,18 @@
|
||||||
<th><?= __('Deleted') ?></th>
|
<th><?= __('Deleted') ?></th>
|
||||||
<td><?= h($productPhoto->deleted) ?></td>
|
<td><?= h($productPhoto->deleted) ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><?= __('Primary Category Photo') ?></th>
|
||||||
|
<td><?= $productPhoto->primary_category_photo ? __('Yes') : __('No'); ?></td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th><?= __('Primary Photo') ?></th>
|
<th><?= __('Primary Photo') ?></th>
|
||||||
<td><?= $productPhoto->primary_photo ? __('Yes') : __('No'); ?></td>
|
<td><?= $productPhoto->primary_photo ? __('Yes') : __('No'); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th><?= __('Primary SKU Photo') ?></th>
|
||||||
|
<td><?= $productPhoto->primary_sku_photo ? __('Yes') : __('No'); ?></td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th><?= __('Enabled') ?></th>
|
<th><?= __('Enabled') ?></th>
|
||||||
<td><?= $productPhoto->enabled ? __('Yes') : __('No'); ?></td>
|
<td><?= $productPhoto->enabled ? __('Yes') : __('No'); ?></td>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue