existing skus working now too

This commit is contained in:
2025-10-03 03:04:57 -07:00
parent 49912abd3a
commit 73349b736e
4 changed files with 203 additions and 25 deletions

View File

@@ -1,7 +1,7 @@
<?php
/**
* @var \App\View\AppView $this
* @var \Cake\Datasource\EntityInterface $productSku
* @var \App\Model\Entity\ProductSkus $productSku
*/
?>
<div class="row">
@@ -52,22 +52,22 @@
</tr>
</table>
<div class="related">
<h4><?= __('Product Attributes') ?></h4>
<h4><?= __('SKU Variant 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')) {
if (!isset($variantValue->product_variant->product_category_variant)) {
continue;
}
if (!$variantValue->hasValue('product_category_variant_option')) {
if (!isset($variantValue->product_category_variant_option)) {
continue;
}
?>
<tr>
<th><?= h($variantValue->product_category_variant->name) ?></th>
<th><?= h($variantValue->product_variant->product_category_variant->name) ?></th>
<td><?= h($variantValue->product_category_variant_option->variant_label ?? $variantValue->product_category_variant_option->variant_value) ?></td>
</tr>