updated new iframe

This commit is contained in:
Luca Haid
2025-06-24 15:21:13 +02:00
parent b740e7b752
commit c502d3c205
4 changed files with 188 additions and 86 deletions

View File

@@ -38,6 +38,27 @@ class PreorderIFrameController extends mfBaseController
self::returnJson(['clusters' => $this->preorderIFrameModel->getClusters($_SERVER['HTTP_X_FRAME_REFERRER'])]);
}
public function getClusterInfoAction()
{
$clusterId = $this->request->get('cluster_id');
if (!$clusterId) self::sendError("Cluster ID is required.");
$allClusters = $this->preorderIFrameModel->getClusters($_SERVER['HTTP_X_FRAME_REFERRER']);
if (!$allClusters) self::sendError("No cluster found for the given ID.");
$clusterInfo = null;
foreach ($allClusters as $cluster) {
if ($cluster['id'] == $clusterId) {
$clusterInfo = $cluster;
break;
}
}
$preorderCampaign = new Preordercampaign($clusterInfo['campaign_id']);
self::returnJson(['iframe_consents' => json_decode($preorderCampaign->iframe_consents ?? '[]')]);
}
public function findCityAction()
{
$allowedClusters = $this->preorderIFrameModel->getClusters($_SERVER['HTTP_X_FRAME_REFERRER']);