refactor: drop order quick shortcuts, keep My Orders tile only
Per feedback the 待支付/售后 shortcut row is not wanted. Remove the nested quick grid, delete the now-orphaned sidebar-orders renderer, and strip its uc-order-grid CSS. 我的订单 remains a single tile in the 我的服务 grid.
This commit is contained in:
1 parent
16fdeceaf7
commit
e71a5b7585
3 files changed
-112
No files matched your search
@@ -79,9 +79,6 @@ $render_grid = static function (array $items): void {
|
||||
<div class="uc-sidebar__section">
|
||||
<div class="uc-sidebar__heading"><span><?php esc_html_e('我的服务', 'aksrt'); ?></span></div>
|
||||
<?php $render_grid($services); ?>
|
||||
<?php if ($orders_url !== '') : ?>
|
||||
<?php require __DIR__ . '/sidebar-orders.php'; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* User center sidebar: task-oriented order shortcuts.
|
||||
*
|
||||
* Rendered inside the 我的服务 (My Services) section — see sidebar-nav.php.
|
||||
*
|
||||
* @package AKSRT
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
$orders_base_url = (string) ($orders_url ?? '');
|
||||
if ($orders_base_url === '') {
|
||||
return;
|
||||
}
|
||||
|
||||
$order_user_id = (int) ($user_id ?? 0);
|
||||
$order_stats = class_exists('\AKSRT\Payment\Order')
|
||||
? \AKSRT\Payment\Order::get_instance()->get_stats($order_user_id)
|
||||
: [];
|
||||
$order_items = [
|
||||
[
|
||||
'label' => __('待支付', 'aksrt'),
|
||||
'icon' => 'wallet',
|
||||
'tab' => 'pending',
|
||||
'count' => (int) ($order_stats['pending'] ?? 0),
|
||||
],
|
||||
[
|
||||
'label' => __('售后', 'aksrt'),
|
||||
'icon' => 'undo-alt',
|
||||
'tab' => 'after',
|
||||
'count' => (int) ($order_stats['refunding'] ?? 0),
|
||||
],
|
||||
];
|
||||
?>
|
||||
<div class="uc-order-grid uc-order-grid--quick">
|
||||
<?php foreach ($order_items as $item) :
|
||||
$item_url = add_query_arg('order_tab', $item['tab'], $orders_base_url);
|
||||
?>
|
||||
<a class="uc-order-grid__item" href="<?php echo esc_url($item_url); ?>">
|
||||
<span class="uc-order-grid__icon">
|
||||
<i class="fas fa-<?php echo esc_attr((string) $item['icon']); ?>" aria-hidden="true"></i>
|
||||
<?php if ($item['count'] > 0) : ?>
|
||||
<small><?php echo esc_html($item['count'] > 99 ? '99+' : (string) $item['count']); ?></small>
|
||||
<?php endif; ?>
|
||||
</span>
|
||||
<span><?php echo esc_html((string) $item['label']); ?></span>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
Reference in new issue
Block a user