fix(shop): flatten widget products REST payload for ajax-list
success() already nests fields; drop extra data wrapper so normalizeJson/tab lazy-load read html/paginate_html directly.
This commit is contained in:
1 parent
7ac9f113dd
commit
43fb65dcdd
1 file changed
+6
-8
@@ -532,14 +532,12 @@ trait ShopControllerFrontendFlowOperations {
|
|||||||
$payload = \AKSRT\Widgets\WidgetProductList::query_payload($instance, $page);
|
$payload = \AKSRT\Widgets\WidgetProductList::query_payload($instance, $page);
|
||||||
|
|
||||||
return $this->success([
|
return $this->success([
|
||||||
'data' => [
|
'html' => (string) ($payload['html'] ?? ''),
|
||||||
'html' => (string) ($payload['html'] ?? ''),
|
'paginate_html' => (string) ($payload['paginate_html'] ?? ''),
|
||||||
'paginate_html' => (string) ($payload['paginate_html'] ?? ''),
|
'has_more' => !empty($payload['has_more']),
|
||||||
'has_more' => !empty($payload['has_more']),
|
'page' => (int) ($payload['page'] ?? $page),
|
||||||
'page' => (int) ($payload['page'] ?? $page),
|
'max_pages' => (int) ($payload['max_pages'] ?? 1),
|
||||||
'max_pages' => (int) ($payload['max_pages'] ?? 1),
|
'total' => (int) ($payload['total'] ?? 0),
|
||||||
'total' => (int) ($payload['total'] ?? 0),
|
|
||||||
],
|
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user