start of variant values
This commit is contained in:
@@ -4,7 +4,11 @@ use function BenTools\CartesianProduct\combinations;
|
||||
|
||||
/**
|
||||
* @var \App\View\AppView $this
|
||||
* @var \App\Model\Entity\ProductSku[] $productSkus
|
||||
* @var \App\Model\Entity\ProductSku $productSku
|
||||
* @var \Cake\Collection\CollectionInterface|string[] $products
|
||||
* @var array $optionMapping
|
||||
* @var array $variantNameMapping
|
||||
* @var array $toGetCartesianProductsFrom
|
||||
*/
|
||||
|
||||
|
||||
@@ -52,8 +56,8 @@ use function BenTools\CartesianProduct\combinations;
|
||||
$variantCnt = 0;
|
||||
foreach ($variantNameMapping as $singleVariantId => $singleVariantName) : ?>
|
||||
<td>
|
||||
<?= $this->Form->hidden($cnt . '.product_skus_variant_values.' . $variantCnt . '.product_category_variant_id', ['value' => $singleVariantId ?? null]); ?>
|
||||
<?= $this->Form->hidden($cnt . '.product_skus_variant_values.' . $variantCnt . '.product_category_variant_option_id', ['value' => $combination[$singleVariantId] ?? null]); ?>
|
||||
<?= $this->Form->hidden($cnt . '.product_sku_variant_values.' . $variantCnt . '.product_category_variant_id', ['value' => $singleVariantId ?? null]); ?>
|
||||
<?= $this->Form->hidden($cnt . '.product_sku_variant_values.' . $variantCnt . '.product_category_variant_option_id', ['value' => $combination[$singleVariantId] ?? null]); ?>
|
||||
<?= $optionMapping[$combination[$singleVariantId]]; ?>
|
||||
</td>
|
||||
<?php
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
<aside class="column">
|
||||
<div class="side-nav">
|
||||
<h4 class="heading"><?= __('Actions') ?></h4>
|
||||
<?= $this->Html->link(__('Edit Product Skus'), ['action' => 'edit', $productSku->id], ['class' => 'side-nav-item']) ?>
|
||||
<?= $this->Form->postLink(__('Delete Product Skus'), ['action' => 'delete', $productSku->id], ['confirm' => __('Are you sure you want to delete # {0}?', $productSku->id), 'class' => 'side-nav-item']) ?>
|
||||
<?= $this->Html->link(__('List Product Skus'), ['action' => 'index'], ['class' => 'side-nav-item']) ?>
|
||||
<?= $this->Html->link(__('New Product Skus'), ['action' => 'add'], ['class' => 'side-nav-item']) ?>
|
||||
<?= $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">
|
||||
@@ -19,12 +19,8 @@
|
||||
<h3><?= h($productSku->sku) ?></h3>
|
||||
<table>
|
||||
<tr>
|
||||
<th><?= __('Id') ?></th>
|
||||
<td><?= h($productSku->id) ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?= __('Product Id') ?></th>
|
||||
<td><?= h($productSku->product_id) ?></td>
|
||||
<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>
|
||||
@@ -55,6 +51,31 @@
|
||||
<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>
|
||||
|
||||
Reference in New Issue
Block a user