fix(orders): stop no-thumbnail order items being squeezed

Order items without a product thumbnail render the title and price into the
3-column grid with the image slot missing, so the title gets crushed into the
64px image column and the price floats far right. Tag such items with a
--no-image modifier that drops the image column (desktop: title fills the row
with price right-aligned; mobile: title full-width, price wraps below).
This commit is contained in:
kate522 committed 2026-08-03 09:42:40 +08:00
1 parent e71a5b7585
commit 9f429e5a62
2 files changed
+27 -9

No files matched your search

@@ -197,12 +197,15 @@ $pending_count = (int) ($stats['pending'] ?? 0);
<div class="aksrt-orders-page__card-items">
<?php if (!empty($items) && is_array($items)) : ?>
<?php foreach ($items as $item) : ?>
<div class="aksrt-orders-page__card-item" data-product-id="<?php echo esc_attr((string) ($item['product_id'] ?? 0)); ?>">
<?php if (!empty($item['image'])) : ?>
<img src="<?php echo esc_url((string) $item['image']); ?>" alt="" class="aksrt-orders-page__card-img">
<?php elseif (!empty($order['image'])) : ?>
<img src="<?php echo esc_url((string) $order['image']); ?>" alt="" class="aksrt-orders-page__card-img">
<?php foreach ($items as $item) :
$item_image = (string) ($item['image'] ?? '');
if ($item_image === '') {
$item_image = (string) ($order['image'] ?? '');
}
?>
<div class="aksrt-orders-page__card-item<?php echo $item_image === '' ? ' aksrt-orders-page__card-item--no-image' : ''; ?>" data-product-id="<?php echo esc_attr((string) ($item['product_id'] ?? 0)); ?>">
<?php if ($item_image !== '') : ?>
<img src="<?php echo esc_url($item_image); ?>" alt="" class="aksrt-orders-page__card-img">
<?php endif; ?>
<div class="aksrt-orders-page__card-item-info">
<span class="aksrt-orders-page__card-item-title"><?php echo esc_html((string) ($item['product_title'] ?? $order['product_name'] ?? '')); ?></span>
@@ -223,9 +226,10 @@ $pending_count = (int) ($stats['pending'] ?? 0);
</div>
<?php endforeach; ?>
<?php else : ?>
<div class="aksrt-orders-page__card-item" data-product-id="<?php echo esc_attr((string) ($order['product_id'] ?? 0)); ?>">
<?php if (!empty($order['image'])) : ?>
<img src="<?php echo esc_url((string) $order['image']); ?>" alt="" class="aksrt-orders-page__card-img">
<?php $order_image = (string) ($order['image'] ?? ''); ?>
<div class="aksrt-orders-page__card-item<?php echo $order_image === '' ? ' aksrt-orders-page__card-item--no-image' : ''; ?>" data-product-id="<?php echo esc_attr((string) ($order['product_id'] ?? 0)); ?>">
<?php if ($order_image !== '') : ?>
<img src="<?php echo esc_url($order_image); ?>" alt="" class="aksrt-orders-page__card-img">
<?php endif; ?>
<div class="aksrt-orders-page__card-item-info">
<span class="aksrt-orders-page__card-item-title"><?php echo esc_html((string) ($order['product_name'] ?? __('订单', 'aksrt'))); ?></span>