feat: remove shop feature (Phase 2)

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.
This commit is contained in:
kate522 committed 2026-08-02 21:25:52 +08:00
1 parent 2bbd7c01a3
commit 1d2505356e
103 files changed
+46 -21267

No files matched your search

@@ -25,7 +25,7 @@ $section = sanitize_key((string) ($_GET['section'] ?? ''));
if ($tab === '' && isset($_GET['tab']) && sanitize_key((string) $_GET['tab']) !== 'orders') {
// When rendered as standalone legacy include, outer tab may be status.
$maybe = sanitize_key((string) $_GET['tab']);
if (in_array($maybe, ['pending', 'to-ship', 'shipped', 'received', 'review', 'after'], true)) {
if (in_array($maybe, ['pending', 'after'], true)) {
$tab = $maybe;
}
}
@@ -37,9 +37,6 @@ if (isset($tab_aliases[$tab])) {
$tab_status_map = [
'pending' => \AKSRT\Payment\Order::STATUS_PENDING,
'to-ship' => \AKSRT\Payment\Order::STATUS_PAID,
'shipped' => \AKSRT\Payment\Order::STATUS_DELIVERED,
'review' => \AKSRT\Payment\Order::STATUS_PENDING_REVIEW,
'after' => \AKSRT\Payment\Order::STATUS_REFUNDING,
];
if ($tab !== '' && isset($tab_status_map[$tab])) {
@@ -58,15 +55,10 @@ if ($type_options === [] && class_exists('\AKSRT\Core\DomainModel')) {
$type_options = array_merge(['' => __('全部类型', 'aksrt')], \AKSRT\Core\DomainModel::order_product_type_labels());
}
$shop = class_exists('\AKSRT\Shop\Shop') ? \AKSRT\Shop\Shop::get_instance() : null;
$tabs = [
'' => __('全部', 'aksrt'),
'pending' => __('待支付', 'aksrt'),
'to-ship' => __('待发货', 'aksrt'),
'shipped' => __('待收货', 'aksrt'),
'review' => __('待评价', 'aksrt'),
'after' => __('售后', 'aksrt'),
'after' => __('退款中', 'aksrt'),
];
$base_query = ['tab' => 'orders'];
@@ -115,16 +107,8 @@ $pending_count = (int) ($stats['pending'] ?? 0);
<i class="fas fa-receipt uc-orders-panel__title-icon" aria-hidden="true"></i>
<?php esc_html_e('我的订单', 'aksrt'); ?>
</div>
<div class="muted-2-color em09 mt3"><?php esc_html_e('查看商城、付费内容、会员与充值等全部订单。', 'aksrt'); ?></div>
<div class="muted-2-color em09 mt3"><?php esc_html_e('查看付费内容、会员与充值等全部订单。', 'aksrt'); ?></div>
</div>
<?php if (function_exists('aksrt_get_cart_page_url') && aksrt_get_cart_page_url() !== '') : ?>
<a class="uc-orders-panel__cart-link" href="<?php echo esc_url(aksrt_get_cart_page_url()); ?>">
<i class="fas fa-shopping-cart" aria-hidden="true"></i>
<span><?php esc_html_e('购物车', 'aksrt'); ?></span>
<i class="fa fa-angle-right em12" aria-hidden="true"></i>
</a>
<?php endif; ?>
</div>
<?php if (!empty($stats)) : ?>
<div class="aksrt-orders-page__stats" data-aksrt-order-stats>
@@ -145,9 +129,7 @@ $pending_count = (int) ($stats['pending'] ?? 0);
<div class="aksrt-orders-page__extra-nav" data-aksrt-orders-extra-nav>
<a href="<?php echo esc_url($orders_url(['section' => null])); ?>" class="aksrt-orders-page__extra-link<?php echo $section === '' ? ' is-active' : ''; ?>"><?php esc_html_e('订单列表', 'aksrt'); ?></a>
<a href="<?php echo esc_url($orders_url(['section' => 'after-sale'])); ?>" class="aksrt-orders-page__extra-link<?php echo $section === 'after-sale' ? ' is-active' : ''; ?>"><?php esc_html_e('售后工单', 'aksrt'); ?></a>
<a href="<?php echo esc_url($orders_url(['section' => 'coupons'])); ?>" class="aksrt-orders-page__extra-link<?php echo $section === 'coupons' ? ' is-active' : ''; ?>"><?php esc_html_e('优惠券', 'aksrt'); ?></a>
<a href="<?php echo esc_url($orders_url(['section' => 'favorites'])); ?>" class="aksrt-orders-page__extra-link<?php echo $section === 'favorites' ? ' is-active' : ''; ?>"><?php esc_html_e('收藏', 'aksrt'); ?></a>
</div>
<?php if ($type_options && $section === '') : ?>
@@ -304,23 +286,11 @@ $pending_count = (int) ($stats['pending'] ?? 0);
<?php if (!empty($actions['can_pay'])) : ?>
<button type="button" class="btn-primary btn-sm" data-aksrt-order-pay="<?php echo esc_attr($on); ?>" data-aksrt-order-method="<?php echo esc_attr((string) ($order['payment_method']['value'] ?? '')); ?>"><?php esc_html_e('去支付', 'aksrt'); ?></button>
<?php endif; ?>
<?php if (!empty($actions['can_receipt'])) : ?>
<button type="button" class="btn-primary btn-sm" data-aksrt-order-receipt="<?php echo esc_attr($on); ?>"><?php esc_html_e('确认收货', 'aksrt'); ?></button>
<?php endif; ?>
<?php if (!empty($actions['can_review']) || (class_exists('\AKSRT\Payment\Order') && $os === \AKSRT\Payment\Order::STATUS_PENDING_REVIEW)) : ?>
<button type="button" class="btn-primary btn-sm c-green" data-aksrt-order-review="<?php echo esc_attr($on); ?>"><?php esc_html_e('评价', 'aksrt'); ?></button>
<?php endif; ?>
<?php if (!empty($actions['can_rebuy'])) : ?>
<button type="button" class="btn-outline btn-sm" data-aksrt-order-rebuy="<?php echo esc_attr($on); ?>"><?php esc_html_e('再次购买', 'aksrt'); ?></button>
<?php endif; ?>
<?php if (!empty($actions['can_after_sale'])) : ?>
<button type="button" class="btn-outline btn-sm" data-aksrt-order-after-sale="<?php echo esc_attr($on); ?>"><?php esc_html_e('售后', 'aksrt'); ?></button>
<?php endif; ?>
<?php if (!empty($actions['can_view_product']) && !empty($order['permalink'])) : ?>
<a class="btn-ghost btn-sm" href="<?php echo esc_url((string) $order['permalink']); ?>"><?php
echo (class_exists('\AKSRT\Core\DomainModel') && $ptype === \AKSRT\Core\DomainModel::ORDER_PRODUCT_RESOURCE)
? esc_html__('去内容', 'aksrt')
: esc_html__('商品页', 'aksrt');
: esc_html__('查看', 'aksrt');
?></a>
<?php endif; ?>
</div>
@@ -348,7 +318,7 @@ $pending_count = (int) ($stats['pending'] ?? 0);
<div class="aksrt-orders-page__empty">
<i class="fas fa-receipt" aria-hidden="true"></i>
<p><?php esc_html_e('暂无订单记录', 'aksrt'); ?></p>
<p class="aksrt-orders-page__empty-hint muted-2-color em09"><?php esc_html_e('去逛逛商城或开通会员,订单会出现在这里。', 'aksrt'); ?></p>
<p class="aksrt-orders-page__empty-hint muted-2-color em09"><?php esc_html_e('开通会员或购买付费内容,订单会出现在这里。', 'aksrt'); ?></p>
</div>
<?php endif; ?>
@@ -367,114 +337,6 @@ $pending_count = (int) ($stats['pending'] ?? 0);
</div>
</div>
<!-- After-sale modal -->
<div class="aksrt-modal" data-aksrt-aftersale-modal hidden>
<div class="aksrt-modal__overlay"></div>
<div class="aksrt-modal__dialog">
<div class="aksrt-modal__header">
<h3><?php esc_html_e('申请售后', 'aksrt'); ?></h3>
<button type="button" class="aksrt-modal__close" data-aksrt-aftersale-modal-close>&times;</button>
</div>
<form class="aksrt-modal__body" data-aksrt-aftersale-form>
<input type="hidden" name="order_number" value="">
<div class="aksrt-orders-page__field">
<label><?php esc_html_e('售后类型', 'aksrt'); ?></label>
<select name="type" class="aksrt-orders-page__select">
<?php if (class_exists('\AKSRT\Payment\AfterSale')) : ?>
<?php foreach (\AKSRT\Payment\AfterSale::get_valid_types() as $type_key => $type_label) : ?>
<option value="<?php echo esc_attr($type_key); ?>"><?php echo esc_html($type_label); ?></option>
<?php endforeach; ?>
<?php endif; ?>
</select>
</div>
<div class="aksrt-orders-page__field">
<label><?php esc_html_e('售后原因', 'aksrt'); ?> *</label>
<textarea name="reason" class="aksrt-orders-page__textarea" rows="4" required placeholder="<?php esc_attr_e('请描述问题', 'aksrt'); ?>"></textarea>
</div>
<div class="aksrt-modal__footer">
<button type="button" class="btn-ghost" data-aksrt-aftersale-modal-close><?php esc_html_e('取消', 'aksrt'); ?></button>
<button type="submit" class="btn-primary"><?php esc_html_e('提交', 'aksrt'); ?></button>
</div>
</form>
</div>
</div>
<!-- Return shipping modal -->
<div class="aksrt-modal" data-aksrt-return-ship-modal hidden>
<div class="aksrt-modal__overlay"></div>
<div class="aksrt-modal__dialog">
<div class="aksrt-modal__header">
<h3><?php esc_html_e('填写退货物流', 'aksrt'); ?></h3>
<button type="button" class="aksrt-modal__close" data-aksrt-return-ship-close>&times;</button>
</div>
<form class="aksrt-modal__body" data-aksrt-return-ship-form>
<input type="hidden" name="ticket_id" value="">
<div class="aksrt-orders-page__field">
<label><?php esc_html_e('快递公司', 'aksrt'); ?> *</label>
<input type="text" name="carrier" class="aksrt-orders-page__input" required placeholder="<?php esc_attr_e('如:顺丰速运', 'aksrt'); ?>">
</div>
<div class="aksrt-orders-page__field">
<label><?php esc_html_e('运单号', 'aksrt'); ?> *</label>
<input type="text" name="tracking_no" class="aksrt-orders-page__input" required placeholder="<?php esc_attr_e('快递单号', 'aksrt'); ?>">
</div>
<div class="aksrt-modal__footer">
<button type="button" class="btn-ghost" data-aksrt-return-ship-close><?php esc_html_e('取消', 'aksrt'); ?></button>
<button type="submit" class="btn-primary"><?php esc_html_e('提交物流', 'aksrt'); ?></button>
</div>
</form>
</div>
</div>
<?php if ($section === 'after-sale' && class_exists('\AKSRT\Payment\AfterSale')) :
$tickets = \AKSRT\Payment\AfterSale::get_instance()->get_user_tickets($user_id, 50);
?>
<section class="aksrt-orders-page__aftersale" data-aksrt-aftersale-list>
<h2><?php esc_html_e('我的售后', 'aksrt'); ?></h2>
<?php if (!empty($tickets)) : ?>
<div class="aksrt-as-list">
<?php foreach ($tickets as $t) :
$tid = (int) ($t['id'] ?? 0);
$events = is_array($t['events'] ?? null) ? $t['events'] : [];
$actions_t = is_array($t['actions'] ?? null) ? $t['actions'] : [];
?>
<article class="aksrt-as-card" data-aksrt-as-ticket="<?php echo esc_attr((string) $tid); ?>">
<div class="aksrt-as-card__head">
<strong>#<?php echo esc_html((string) $tid); ?></strong>
<span class="aksrt-as-card__order"><?php echo esc_html((string) ($t['order_number'] ?? '')); ?></span>
<span class="aksrt-as-card__status"><?php echo esc_html((string) ($t['status_label'] ?? $t['status'] ?? '')); ?></span>
</div>
<div class="aksrt-as-card__meta muted-2-color">
<?php echo esc_html((string) ($t['type_label'] ?? $t['type'] ?? '')); ?>
· <?php echo esc_html((string) ($t['created_at'] ?? '')); ?>
</div>
<div class="aksrt-as-card__reason"><?php echo esc_html((string) ($t['reason'] ?? '')); ?></div>
<?php if ($events) : ?>
<ol class="aksrt-as-timeline">
<?php foreach (array_reverse($events) as $ev) : ?>
<li>
<time><?php echo esc_html((string) ($ev['time'] ?? '')); ?></time>
<span><?php echo esc_html((string) ($ev['label'] ?? '')); ?></span>
</li>
<?php endforeach; ?>
</ol>
<?php endif; ?>
<div class="aksrt-as-card__actions">
<?php if (!empty($actions_t['can_return_ship'])) : ?>
<button type="button" class="btn-primary btn-sm" data-aksrt-return-ship="<?php echo esc_attr((string) $tid); ?>"><?php esc_html_e('填写退货物流', 'aksrt'); ?></button>
<?php endif; ?>
<?php if (!empty($actions_t['can_cancel'])) : ?>
<button type="button" class="btn-ghost btn-sm" data-aksrt-as-cancel="<?php echo esc_attr((string) $tid); ?>"><?php esc_html_e('取消售后', 'aksrt'); ?></button>
<?php endif; ?>
</div>
</article>
<?php endforeach; ?>
</div>
<?php else : ?>
<p class="muted-2-color"><?php esc_html_e('暂无售后记录', 'aksrt'); ?></p>
<?php endif; ?>
</section>
<?php endif; ?>
<?php if ($section === 'coupons') : ?>
<section class="aksrt-orders-page__coupons" data-aksrt-coupon-wallet>
<h2><?php esc_html_e('优惠券', 'aksrt'); ?></h2>
@@ -483,27 +345,4 @@ $pending_count = (int) ($stats['pending'] ?? 0);
</div>
</section>
<?php endif; ?>
<?php if ($section === 'favorites' && $shop) :
$fav_data = $shop->get_user_favorites($user_id);
?>
<section class="aksrt-orders-page__favorites">
<h2><?php esc_html_e('收藏商品', 'aksrt'); ?></h2>
<?php if (!empty($fav_data['items'])) : ?>
<div class="aksrt-orders-page__fav-grid">
<?php foreach ($fav_data['items'] as $fav) : ?>
<a href="<?php echo esc_url((string) ($fav['permalink'] ?? '#')); ?>" class="aksrt-orders-page__fav-card">
<?php if (!empty($fav['image'])) : ?>
<img src="<?php echo esc_url((string) $fav['image']); ?>" alt="" loading="lazy">
<?php endif; ?>
<h3><?php echo esc_html((string) ($fav['title'] ?? '')); ?></h3>
<strong>¥<?php echo esc_html(number_format((float) ($fav['price'] ?? 0), 2)); ?></strong>
</a>
<?php endforeach; ?>
</div>
<?php else : ?>
<p><?php esc_html_e('暂无收藏商品', 'aksrt'); ?></p>
<?php endif; ?>
</section>
<?php endif; ?>
</div>