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:
@@ -315,6 +315,12 @@
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
/* Item without a thumbnail: drop the fixed 64px image column so the title
|
||||
* and price fill the row instead of being crushed into the missing image cell. */
|
||||
.aksrt-orders-page__card-item--no-image {
|
||||
grid-template-columns: minmax(0, 1fr) auto;
|
||||
}
|
||||
|
||||
.aksrt-orders-page__card-img {
|
||||
width: 64px;
|
||||
height: 64px;
|
||||
@@ -1520,6 +1526,14 @@ html.dark .aksrt-order-detail-dialog .aksrt-modal__footer {
|
||||
align-items: baseline;
|
||||
}
|
||||
|
||||
.aksrt-orders-page__card-item--no-image {
|
||||
grid-template-columns: minmax(0, 1fr);
|
||||
}
|
||||
|
||||
.aksrt-orders-page__card-item--no-image .aksrt-orders-page__card-item-price {
|
||||
grid-column: auto;
|
||||
}
|
||||
|
||||
.aksrt-orders-page__card-time {
|
||||
margin-left: 0;
|
||||
width: 100%;
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user