CakeProducts/templates/ProductSkus/view.php

82 lines
3.7 KiB
PHP

<?php
/**
* @var \App\View\AppView $this
* @var \Cake\Datasource\EntityInterface $productSku
*/
?>
<div class="row">
<aside class="column">
<div class="side-nav">
<h4 class="heading"><?= __('Actions') ?></h4>
<?= $this->Html->link(__('Edit Product SKU'), ['action' => 'edit', $productSku->id], ['class' => 'side-nav-item']) ?>
<?= $this->Form->postLink(__('Delete Product SKU'), ['action' => 'delete', $productSku->id], ['confirm' => __('Are you sure you want to delete # {0}?', $productSku->id), 'class' => 'side-nav-item']) ?>
<?= $this->Html->link(__('List Product SKU'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
<?= $this->Html->link(__('New Product SKU'), ['action' => 'add'], ['class' => 'side-nav-item']) ?>
</div>
</aside>
<div class="column column-80">
<div class="productSkus view content">
<h3><?= h($productSku->sku) ?></h3>
<table>
<tr>
<th><?= __('Product') ?></th>
<td><?= $productSku->hasValue('product') ? $this->Html->link($productSku->product->name, ['controller' => 'Products', 'action' => 'view', $productSku->product->id]) : '' ?></td>
</tr>
<tr>
<th><?= __('Sku') ?></th>
<td><?= h($productSku->sku) ?></td>
</tr>
<tr>
<th><?= __('Barcode') ?></th>
<td><?= h($productSku->barcode) ?></td>
</tr>
<tr>
<th><?= __('Price') ?></th>
<td><?= $productSku->price === null ? '' : $this->Number->format($productSku->price) ?></td>
</tr>
<tr>
<th><?= __('Cost') ?></th>
<td><?= $productSku->cost === null ? '' : $this->Number->format($productSku->cost) ?></td>
</tr>
<tr>
<th><?= __('Created') ?></th>
<td><?= h($productSku->created) ?></td>
</tr>
<tr>
<th><?= __('Modified') ?></th>
<td><?= h($productSku->modified) ?></td>
</tr>
<tr>
<th><?= __('Deleted') ?></th>
<td><?= h($productSku->deleted) ?></td>
</tr>
</table>
<div class="related">
<h4><?= __('Product Attributes') ?></h4>
<?php if (!empty($productSku->product_sku_variant_values)) : ?>
<div class="table-responsive">
<table>
<?php foreach ($productSku->product_sku_variant_values as $variantValue) : ?>
<?php
if (!$variantValue->hasValue('product_category_variant')) {
continue;
}
if (!$variantValue->hasValue('product_category_variant_option')) {
continue;
}
?>
<tr>
<th><?= h($variantValue->product_category_variant->name) ?></th>
<td><?= h($variantValue->product_category_variant_option->variant_label ?? $variantValue->product_category_variant_option->variant_value) ?></td>
</tr>
<?php endforeach; ?>
</table>
</div>
<?php endif; ?>
</div>
</div>
</div>
</div>