'; } public function render_shortcode($atts = []): string { wp_enqueue_style(self::SLUG); wp_enqueue_script(self::SLUG); // Einstellungen aus DB holen $settings = Skrift_Konfigurator_Admin_Settings::get_settings(); $vouchers = Skrift_Konfigurator_Vouchers::get_vouchers(); // WICHTIG: Sicherstellen dass leere Arrays als Objekt {} encodiert werden, nicht als Array [] if (empty($vouchers)) { $vouchers = new stdClass(); } // PayPal-Einstellungen für Frontend vorbereiten (ohne sensible Daten) $paypal_frontend = []; if (!empty($settings['paypal']['enabled'])) { $mode = $settings['paypal']['mode'] ?? 'sandbox'; $client_id = ($mode === 'live') ? ($settings['paypal']['client_id_live'] ?? '') : ($settings['paypal']['client_id_sandbox'] ?? ''); $paypal_frontend = [ 'enabled' => true, 'mode' => $mode, 'client_id' => $client_id, ]; } ob_start(); ?>