Delete all shop domain classes, controllers, schema builders, templates, JS/CSS, admin SPA pages, and shop-only payment classes (Shipping, AfterSale, Discount). Remove shop-only DB table definitions (product_variant, after_sale, order_shipping, card_key) from migrator and add their DROP to uninstall.php. Clean up shared files: - Remove aksrt_product CPT + taxonomies from Setup.php - Remove shop rewrite rules/query vars/template redirect from SetupPart2.php - Remove shop widget areas from SetupPart1.php - Remove shop enqueues from ScriptsPart1b.php - Remove sepakerator-aksrt-shop from SetupPart2.php - Remove get_shop_settings facade (delete ForumShop.php, clean DomainGroups.php) - Remove ORDER_PRODUCT_SHOP constant from DomainModel.php - Remove Shop::class fallback branches from UserOrders.php, OrderCenterRest.php - Remove shipping/after-sale branches from OrderRepositoryAdmin.php, PayMenus.php, PayOrders.php - Remove shop product widgets from widgets-register.php - Remove cart page from template-registry.php, routing.php, ScriptsPart2.php - Remove cart UI from sidebar-nav.php, profile-orders.php, sidebar-orders.php - Clean up order-center.js (remove rebuy/cartUrl/receipt/after-sale handlers) - Remove aksrt_get_cart_page_url/product_page/product_edit from transactions.php - Clean up aksrt_product_cat references in Coupon.php, PayCoupons.php Shared payment/order/credits/content-pay stack fully retained.
60 lines
1.7 KiB
PHP
60 lines
1.7 KiB
PHP
<?php
|
|
/**
|
|
* User center sidebar: task-oriented order shortcuts.
|
|
*
|
|
* @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_repo = class_exists('\AKSRT\Payment\OrderRepository')
|
|
? \AKSRT\Payment\OrderRepository::get_instance()
|
|
: null;
|
|
$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-sidebar__section uc-order-card">
|
|
<div class="uc-sidebar__heading">
|
|
<span><?php esc_html_e('我的订单', 'aksrt'); ?></span>
|
|
<a href="<?php echo esc_url($orders_base_url); ?>">
|
|
<?php esc_html_e('全部', 'aksrt'); ?><i class="fas fa-angle-right" aria-hidden="true"></i>
|
|
</a>
|
|
</div>
|
|
<div class="uc-order-grid">
|
|
<?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>
|
|
</div>
|