more product types (events, subscriptions, digital goods), photos templates index/view
CI / testsuite (mysql, 8.2, ) (push) Waiting to run Details
CI / testsuite (mysql, 8.4, ) (push) Waiting to run Details
CI / testsuite (sqlite, 8.2, prefer-lowest) (push) Waiting to run Details
CI / Coding Standard & Static Analysis (push) Waiting to run Details

This commit is contained in:
Brandon Shipley 2025-11-03 23:15:31 -08:00
parent 46e8712161
commit 868f9dbcce
Signed by: bmfs
GPG Key ID: 14E38571D8BB0DE4
4 changed files with 26 additions and 5 deletions

View File

@ -30,7 +30,7 @@ class ProductPhotosController extends AppController
public function index()
{
$query = $this->getTable()->find()
->contain(['Products', 'ProductSkus']);
->contain(['Products', 'ProductSkus', 'ProductCategories']);
$productPhotos = $this->paginate($query);
$this->set(compact('productPhotos'));

View File

@ -11,13 +11,19 @@ enum ProductProductTypeId: int implements EnumLabelInterface
case Service = 1;
case Product = 2;
case Consumable = 3;
case DigitalGood = 4;
case Subscription = 5;
// case Event = 5;
public function label(): string
{
return match($this) {
self::Service => 'Service',
self::Product => 'Product',
self::Consumable => 'Consumable'
self::Consumable => 'Consumable',
self::DigitalGood => 'Digital Good',
self::Subscription => 'Subscription',
// self::Event => 'Event',
};
}
}

View File

@ -12,6 +12,7 @@
<thead>
<tr>
<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_sku_id') ?></th>
<th><?= $this->Paginator->sort('photo_filename') ?></th>
@ -28,8 +29,9 @@
<?php foreach ($productPhotos as $productPhoto): ?>
<tr>
<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><?= 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->primary_photo) ?></td>
<td><?= $this->Number->format($productPhoto->photo_position) ?></td>

View File

@ -26,13 +26,18 @@
<th><?= __('Id') ?></th>
<td><?= h($productPhoto->id) ?></td>
</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>
<th><?= __('Product') ?></th>
<td><?= $productPhoto->hasValue('product') ? $this->Html->link($productPhoto->product->name, ['controller' => 'Products', 'action' => 'view', $productPhoto->product->id]) : '' ?></td>
</tr>
<tr>
<th><?= __('Product Sku Id') ?></th>
<td><?= h($productPhoto->product_sku_id) ?></td>
<th><?= __('SKU') ?></th>
<td><?= $productPhoto->hasValue('product_sku') ? $this->Html->link($productPhoto->product_sku->sku, ['controller' => 'ProductSkus', 'action' => 'view', $productPhoto->product_sku->id]) : '' ?></td>
</tr>
<tr>
<th><?= __('Photo Filename') ?></th>
@ -54,10 +59,18 @@
<th><?= __('Deleted') ?></th>
<td><?= h($productPhoto->deleted) ?></td>
</tr>
<tr>
<th><?= __('Primary Category Photo') ?></th>
<td><?= $productPhoto->primary_category_photo ? __('Yes') : __('No'); ?></td>
</tr>
<tr>
<th><?= __('Primary Photo') ?></th>
<td><?= $productPhoto->primary_photo ? __('Yes') : __('No'); ?></td>
</tr>
<tr>
<th><?= __('Primary SKU Photo') ?></th>
<td><?= $productPhoto->primary_sku_photo ? __('Yes') : __('No'); ?></td>
</tr>
<tr>
<th><?= __('Enabled') ?></th>
<td><?= $productPhoto->enabled ? __('Yes') : __('No'); ?></td>