feat(orders): embed My Orders inside user center (zibll-style)
Register UC panel tab=orders with full order list/actions UI; route aksrt_get_orders_page_url and /orders template to profile?tab=orders; enqueue order assets when the UC orders tab is active.
This commit is contained in:
1 parent
dae85f0198
commit
354a1072ef
8 files changed
+598
-464
No files matched your search
@@ -129,6 +129,7 @@ if (!function_exists('aksrt_get_user_center_tab_url')) {
|
||||
$url = remove_query_arg([
|
||||
'tab', 'posts_page', 'comments_page', 'favorites_page', 'credits_page',
|
||||
'post_status', 'saved', 'profile_error',
|
||||
'order_tab', 'otab', 'order_status', 'order_page', 'order_type', 'section',
|
||||
], aksrt_get_user_center_url());
|
||||
|
||||
return add_query_arg('tab', sanitize_key($tab), $url);
|
||||
@@ -170,6 +171,7 @@ if (!function_exists('aksrt_capture_user_center_view')) {
|
||||
'favorites' => 'favorites',
|
||||
'credits' => 'credits',
|
||||
'vip' => 'vip',
|
||||
'orders' => 'orders',
|
||||
'settings' => 'settings',
|
||||
'header' => 'header',
|
||||
'sidebar' => 'sidebar',
|
||||
@@ -194,7 +196,7 @@ if (!function_exists('aksrt_capture_user_center_panel')) {
|
||||
* Capture a built-in or registered user-center panel body.
|
||||
*/
|
||||
function aksrt_capture_user_center_panel(string $tab_key, array $tab, array $context): string {
|
||||
$built_in_tabs = ['profile', 'posts', 'comments', 'favorites', 'credits', 'vip', 'settings'];
|
||||
$built_in_tabs = ['profile', 'posts', 'comments', 'favorites', 'credits', 'vip', 'orders', 'settings'];
|
||||
if (in_array($tab_key, $built_in_tabs, true)) {
|
||||
return aksrt_capture_user_center_view($tab_key, $context);
|
||||
}
|
||||
@@ -501,7 +503,9 @@ if (!function_exists('aksrt_get_user_center_render_context')) {
|
||||
'svg_empty_post' => $svgs['post'],
|
||||
'svg_empty_comment' => $svgs['comment'],
|
||||
'svg_empty_favorite' => $svgs['favorite'],
|
||||
'orders_url' => function_exists('aksrt_get_orders_page_url') ? aksrt_get_orders_page_url() : '',
|
||||
'orders_url' => function_exists('aksrt_get_user_center_tab_url')
|
||||
? aksrt_get_user_center_tab_url('orders')
|
||||
: (function_exists('aksrt_get_orders_page_url') ? aksrt_get_orders_page_url() : ''),
|
||||
'show_vip' => !empty($vip_settings['enabled']),
|
||||
'show_credit_tabs' => $show_credit_tabs,
|
||||
'affiliate_enabled' => $show_credit_tabs && !empty($affiliate_settings['enabled']),
|
||||
|
||||
Reference in new issue
Block a user