fix(polish): 订单购物车论坛粉边软化 + 论坛付费帖购链路

- 购物车/商品/论坛表面复用 #77 soft recipe(mix 边 + soft ring)
- 论坛 visibility=pay:订单 resource + 余额扣费闭环
- VIP 价/免费解锁 + 购买 CTA/AJAX,复用现有 Order/Credits

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Fable 5 committed 2026-07-12 13:34:03 +08:00
1 parent de204c4794
commit 043ac178fe
21 files changed
+411 -52

No files matched your search

+28
View File
@@ -144,6 +144,13 @@ class AKSRT_Forum {
return ['enabled' => false];
}
/**
* Alias kept for topic-service helpers that still call get_forum_config().
*/
public function get_forum_config(): array {
return $this->get_config();
}
public function get_boards(array $args = []): array {
return $this->board_service()->get_boards($args);
}
@@ -345,6 +352,7 @@ class AKSRT_Forum {
add_action('wp_ajax_aksrt_forum_create_topic', [$this, 'ajax_create_topic']);
add_action('wp_ajax_aksrt_forum_follow_plate', [$this, 'ajax_follow_plate']);
add_action('wp_ajax_aksrt_forum_unlock_topic', [$this, 'ajax_unlock_topic']);
add_action('wp_ajax_aksrt_forum_purchase_topic', [$this, 'ajax_purchase_topic']);
// §7.4 draft persistence
add_action('wp_ajax_aksrt_forum_save_draft', [$this, 'ajax_save_draft']);
@@ -446,6 +454,26 @@ class AKSRT_Forum {
$this->topic_service()->ajax_unlock_topic();
}
public function ajax_purchase_topic(): void {
$this->topic_service()->ajax_purchase_topic();
}
/**
* Lightweight result helper for topic service actions.
*
* @return array{success:bool,message:string}
*/
public function success(string $message = '', array $extra = []): array {
return array_merge(['success' => true, 'message' => $message], $extra);
}
/**
* @return array{success:bool,message:string}
*/
public function error(string $message = '', array $extra = []): array {
return array_merge(['success' => false, 'message' => $message], $extra);
}
public function apply_moderator(int $user_id, int $board_id, string $reason) {
return $this->moderation_service()->apply_moderator($user_id, $board_id, $reason);
}