Files
orderPRO/resources/views/marketplace/offers.php

59 lines
2.4 KiB
PHP

<?php $integrationData = is_array($integration ?? null) ? $integration : []; ?>
<?php $rows = is_array($offers ?? null) ? $offers : []; ?>
<section class="card">
<h1><?= $e($t('marketplace.offers_title', ['name' => (string) ($integrationData['name'] ?? '')])) ?></h1>
<p class="muted"><?= $e($t('marketplace.offers_description')) ?></p>
</section>
<section class="card mt-16">
<a class="btn btn--secondary" href="/marketplace"><?= $e($t('marketplace.actions.back_to_marketplace')) ?></a>
<?php if (!empty($errorMessage)): ?>
<div class="alert alert--danger mt-12" role="alert"><?= $e((string) $errorMessage) ?></div>
<?php endif; ?>
<?php if ($rows === []): ?>
<p class="muted mt-12"><?= $e($t('marketplace.empty_offers')) ?></p>
<?php else: ?>
<div class="table-wrap mt-12">
<table class="table">
<thead>
<tr>
<th><?= $e($t('marketplace.fields.offer_name')) ?></th>
<th><?= $e($t('marketplace.fields.external_product_id')) ?></th>
<th><?= $e($t('marketplace.fields.external_variant_id')) ?></th>
<th><?= $e($t('marketplace.fields.external_offer_id')) ?></th>
<th><?= $e($t('marketplace.fields.channel')) ?></th>
<th><?= $e($t('marketplace.fields.product')) ?></th>
<th>SKU</th>
<th>EAN</th>
<th><?= $e($t('marketplace.fields.updated_at')) ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($rows as $row): ?>
<?php $productId = (int) ($row['product_id'] ?? 0); ?>
<tr>
<td><?= $e((string) ($row['offer_name'] ?? '')) ?></td>
<td><?= $e((string) ($row['external_product_id'] ?? '')) ?></td>
<td><?= $e((string) ($row['external_variant_id'] ?? '')) ?></td>
<td><?= $e((string) ($row['external_offer_id'] ?? '')) ?></td>
<td><?= $e((string) ($row['channel_name'] ?? '')) ?></td>
<td>
<a href="/products/<?= $e((string) $productId) ?>">
<?= $e((string) ($row['product_name'] ?? '')) ?>
</a>
</td>
<td><?= $e((string) ($row['product_sku'] ?? '')) ?></td>
<td><?= $e((string) ($row['product_ean'] ?? '')) ?></td>
<td><?= $e((string) ($row['updated_at'] ?? '')) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php endif; ?>
</section>