PluginProbe
King Addons for Elementor – 100+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce Builder, Mega Menu, Popup Builder / 51.1.84
King Addons for Elementor – 100+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce Builder, Mega Menu, Popup Builder v51.1.84
51.1.86 51.1.84 51.1.85 51.1.83 51.1.82 51.1.81 51.1.79 51.1.78 51.1.77 51.1.76 51.1.74 51.1.75 51.1.65 51.1.64 51.1.63 trunk 51.1.14 51.1.2 51.1.35 51.1.36 51.1.37 51.1.38 51.1.39 51.1.44 51.1.45 All 40 releases
king-addons / includes / extensions / Pricing_Table_Builder / templates / admin-editor.php

admin-editor.php in King Addons for Elementor – 100+ Elementor Widgets, 4 000+ Elementor Templates, WooCommerce Builder, Mega Menu, Popup Builder 51.1.84, at includes/extensions/Pricing_Table_Builder/templates/admin-editor.php

580 lines 42.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Pricing Table Builder - Admin Editor Page.
4 *
5 * @package King_Addons
6 */
7
8 if (!defined('ABSPATH')) {
9 exit;
10 }
11
12 $list_url = admin_url('admin.php?page=king-addons-pricing-tables');
13 $save_url = admin_url('admin-post.php');
14 $table_id_val = $table ? $table->ID : 0;
15 $table_title = $table ? $table->post_title : '';
16 $is_new = $table_id_val === 0;
17 $page_title = $is_new ? __('Create Pricing Table', 'king-addons') : __('Edit Pricing Table', 'king-addons');
18 ?>
19 <script>
20 // Pass initial config to JS BEFORE admin.js loads
21 window.kngPTInitialConfig = <?php echo wp_json_encode($config); ?>;
22 </script>
23 <div class="kng-v3-wrap kng-pt-editor">
24 <div class="kng-v3-header">
25 <div class="kng-v3-header-content">
26 <a href="<?php echo esc_url($list_url); ?>" class="kng-pt-back-link">
27 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="20" height="20"><line x1="19" y1="12" x2="5" y2="12"/><polyline points="12 19 5 12 12 5"/></svg>
28 </a>
29 <h1 class="kng-v3-title"><?php echo esc_html($page_title); ?></h1>
30 </div>
31 <div class="kng-v3-header-actions">
32 <button type="button" class="kng-v3-btn kng-v3-btn-outline" id="kng-pt-preview-btn">
33 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="18" height="18"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>
34 <?php esc_html_e('Preview', 'king-addons'); ?>
35 </button>
36 <button type="button" class="kng-v3-btn kng-v3-btn-secondary" id="kng-pt-save-draft">
37 <?php esc_html_e('Save Draft', 'king-addons'); ?>
38 </button>
39 <button type="button" class="kng-v3-btn kng-v3-btn-primary" id="kng-pt-publish">
40 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="18" height="18"><polyline points="20 6 9 17 4 12"/></svg>
41 <?php echo $is_new ? esc_html__('Publish', 'king-addons') : esc_html__('Update', 'king-addons'); ?>
42 </button>
43 </div>
44 </div>
45
46 <?php if (isset($_GET['saved']) && $_GET['saved'] === '1'): ?>
47 <div class="kng-v3-notice kng-v3-notice-success">
48 <p><?php esc_html_e('Pricing table saved successfully.', 'king-addons'); ?></p>
49 </div>
50 <?php endif; ?>
51
52 <form id="kng-pt-form" method="post" action="<?php echo esc_url($save_url); ?>">
53 <input type="hidden" name="action" value="king_addons_pt_save">
54 <input type="hidden" name="table_id" value="<?php echo esc_attr($table_id_val); ?>">
55 <input type="hidden" name="config" id="kng-pt-config-input" value="">
56 <?php wp_nonce_field('kng_pt_save', 'kng_pt_nonce'); ?>
57
58 <div class="kng-pt-editor-layout">
59 <!-- Left Panel: Settings -->
60 <div class="kng-pt-editor-sidebar">
61 <!-- Tabs -->
62 <div class="kng-pt-tabs">
63 <button type="button" class="kng-pt-tab is-active" data-tab="general">
64 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="18" height="18"><circle cx="12" cy="12" r="3"/><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"/></svg>
65 <?php esc_html_e('General', 'king-addons'); ?>
66 </button>
67 <button type="button" class="kng-pt-tab" data-tab="billing">
68 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="18" height="18"><rect x="1" y="4" width="22" height="16" rx="2"/><line x1="1" y1="10" x2="23" y2="10"/></svg>
69 <?php esc_html_e('Billing', 'king-addons'); ?>
70 </button>
71 <button type="button" class="kng-pt-tab" data-tab="plans">
72 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="18" height="18"><rect x="3" y="3" width="18" height="18" rx="2"/><line x1="3" y1="9" x2="21" y2="9"/><line x1="9" y1="21" x2="9" y2="9"/></svg>
73 <?php esc_html_e('Plans', 'king-addons'); ?>
74 </button>
75 <button type="button" class="kng-pt-tab" data-tab="features">
76 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="18" height="18"><polyline points="9 11 12 14 22 4"/><path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"/></svg>
77 <?php esc_html_e('Features', 'king-addons'); ?>
78 </button>
79 <button type="button" class="kng-pt-tab" data-tab="styles">
80 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="18" height="18"><path d="M12 2.69l5.66 5.66a8 8 0 1 1-11.31 0z"/></svg>
81 <?php esc_html_e('Styles', 'king-addons'); ?>
82 </button>
83 <button type="button" class="kng-pt-tab" data-tab="advanced">
84 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="18" height="18"><circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/><circle cx="5" cy="12" r="1"/></svg>
85 <?php esc_html_e('Advanced', 'king-addons'); ?>
86 </button>
87 </div>
88
89 <!-- Tab Panels -->
90 <div class="kng-pt-tab-panels">
91
92 <!-- General Tab -->
93 <div class="kng-pt-tab-panel is-active" data-panel="general">
94 <div class="kng-v3-field">
95 <label class="kng-v3-label" for="kng-pt-name"><?php esc_html_e('Table Name', 'king-addons'); ?></label>
96 <input type="text" id="kng-pt-name" class="kng-v3-input" value="<?php echo esc_attr($config['table']['name'] ?? ''); ?>" placeholder="<?php esc_attr_e('My Pricing Table', 'king-addons'); ?>">
97 </div>
98
99 <div class="kng-v3-field">
100 <label class="kng-v3-label"><?php esc_html_e('Layout Mode', 'king-addons'); ?></label>
101 <div class="kng-v3-radio-cards">
102 <label class="kng-v3-radio-card">
103 <input type="radio" name="layout_mode" value="cards" <?php checked(($config['table']['layout']['mode'] ?? 'cards'), 'cards'); ?>>
104 <span class="kng-v3-radio-card-content">
105 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" width="24" height="24"><rect x="2" y="4" width="6" height="16" rx="1"/><rect x="9" y="4" width="6" height="16" rx="1"/><rect x="16" y="4" width="6" height="16" rx="1"/></svg>
106 <span><?php esc_html_e('Cards', 'king-addons'); ?></span>
107 </span>
108 </label>
109 <label class="kng-v3-radio-card">
110 <input type="radio" name="layout_mode" value="table" <?php checked(($config['table']['layout']['mode'] ?? 'cards'), 'table'); ?>>
111 <span class="kng-v3-radio-card-content">
112 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" width="24" height="24"><rect x="3" y="3" width="18" height="18" rx="2"/><line x1="3" y1="9" x2="21" y2="9"/><line x1="3" y1="15" x2="21" y2="15"/><line x1="9" y1="3" x2="9" y2="21"/></svg>
113 <span><?php esc_html_e('Table', 'king-addons'); ?></span>
114 </span>
115 </label>
116 </div>
117 </div>
118
119 <div class="kng-v3-field-group">
120 <div class="kng-v3-field">
121 <label class="kng-v3-label" for="kng-pt-cols-desktop"><?php esc_html_e('Columns (Desktop)', 'king-addons'); ?></label>
122 <select id="kng-pt-cols-desktop" class="kng-v3-select">
123 <?php for ($i = 1; $i <= 6; $i++): ?>
124 <option value="<?php echo $i; ?>" <?php selected(($config['table']['layout']['columns_desktop'] ?? 3), $i); ?>><?php echo $i; ?></option>
125 <?php endfor; ?>
126 </select>
127 </div>
128 <div class="kng-v3-field">
129 <label class="kng-v3-label" for="kng-pt-cols-tablet"><?php esc_html_e('Columns (Tablet)', 'king-addons'); ?></label>
130 <select id="kng-pt-cols-tablet" class="kng-v3-select">
131 <?php for ($i = 1; $i <= 4; $i++): ?>
132 <option value="<?php echo $i; ?>" <?php selected(($config['table']['layout']['columns_tablet'] ?? 2), $i); ?>><?php echo $i; ?></option>
133 <?php endfor; ?>
134 </select>
135 </div>
136 <div class="kng-v3-field">
137 <label class="kng-v3-label" for="kng-pt-cols-mobile"><?php esc_html_e('Columns (Mobile)', 'king-addons'); ?></label>
138 <select id="kng-pt-cols-mobile" class="kng-v3-select">
139 <?php for ($i = 1; $i <= 2; $i++): ?>
140 <option value="<?php echo $i; ?>" <?php selected(($config['table']['layout']['columns_mobile'] ?? 1), $i); ?>><?php echo $i; ?></option>
141 <?php endfor; ?>
142 </select>
143 </div>
144 </div>
145
146 <div class="kng-v3-field-group">
147 <div class="kng-v3-field">
148 <label class="kng-v3-label" for="kng-pt-gap"><?php esc_html_e('Gap (px)', 'king-addons'); ?></label>
149 <input type="number" id="kng-pt-gap" class="kng-v3-input" value="<?php echo esc_attr($config['table']['layout']['gap'] ?? 24); ?>" min="0" max="100">
150 </div>
151 <div class="kng-v3-field">
152 <label class="kng-v3-label" for="kng-pt-max-width"><?php esc_html_e('Max Width (px)', 'king-addons'); ?></label>
153 <input type="number" id="kng-pt-max-width" class="kng-v3-input" value="<?php echo esc_attr($config['table']['layout']['max_width'] ?? 1200); ?>" min="600" max="2000">
154 </div>
155 </div>
156
157 <div class="kng-v3-field">
158 <label class="kng-v3-label"><?php esc_html_e('Alignment', 'king-addons'); ?></label>
159 <div class="kng-v3-btn-group">
160 <button type="button" class="kng-v3-btn-group-item <?php echo ($config['table']['layout']['alignment'] ?? 'center') === 'left' ? 'is-active' : ''; ?>" data-value="left">
161 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="16" height="16"><line x1="17" y1="10" x2="3" y2="10"/><line x1="21" y1="6" x2="3" y2="6"/><line x1="21" y1="14" x2="3" y2="14"/><line x1="17" y1="18" x2="3" y2="18"/></svg>
162 </button>
163 <button type="button" class="kng-v3-btn-group-item <?php echo ($config['table']['layout']['alignment'] ?? 'center') === 'center' ? 'is-active' : ''; ?>" data-value="center">
164 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="16" height="16"><line x1="18" y1="10" x2="6" y2="10"/><line x1="21" y1="6" x2="3" y2="6"/><line x1="21" y1="14" x2="3" y2="14"/><line x1="18" y1="18" x2="6" y2="18"/></svg>
165 </button>
166 <button type="button" class="kng-v3-btn-group-item <?php echo ($config['table']['layout']['alignment'] ?? 'center') === 'right' ? 'is-active' : ''; ?>" data-value="right">
167 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="16" height="16"><line x1="21" y1="10" x2="7" y2="10"/><line x1="21" y1="6" x2="3" y2="6"/><line x1="21" y1="14" x2="3" y2="14"/><line x1="21" y1="18" x2="7" y2="18"/></svg>
168 </button>
169 </div>
170 <input type="hidden" id="kng-pt-alignment" value="<?php echo esc_attr($config['table']['layout']['alignment'] ?? 'center'); ?>">
171 </div>
172 </div>
173
174 <!-- Billing Tab -->
175 <div class="kng-pt-tab-panel" data-panel="billing">
176 <div class="kng-v3-field">
177 <div class="kng-v3-toggle-wrap">
178 <span class="kng-v3-toggle-label"><?php esc_html_e('Enable Billing Toggle', 'king-addons'); ?></span>
179 <label class="kng-v3-toggle">
180 <input type="checkbox" id="kng-pt-billing-enabled" <?php checked(!empty($config['billing']['enabled'])); ?>>
181 <span class="kng-v3-toggle-slider"></span>
182 </label>
183 </div>
184 <p class="kng-v3-field-help"><?php esc_html_e('Show monthly/annual toggle for visitors', 'king-addons'); ?></p>
185 </div>
186
187 <div class="kng-pt-billing-options" style="<?php echo empty($config['billing']['enabled']) ? 'display:none' : ''; ?>">
188 <div class="kng-v3-field">
189 <label class="kng-v3-label"><?php esc_html_e('Toggle Style', 'king-addons'); ?></label>
190 <div class="kng-v3-radio-cards kng-v3-radio-cards-sm">
191 <label class="kng-v3-radio-card">
192 <input type="radio" name="billing_type" value="segmented" <?php checked(($config['billing']['type'] ?? 'segmented'), 'segmented'); ?>>
193 <span class="kng-v3-radio-card-content"><?php esc_html_e('Segmented', 'king-addons'); ?></span>
194 </label>
195 <label class="kng-v3-radio-card">
196 <input type="radio" name="billing_type" value="switch" <?php checked(($config['billing']['type'] ?? 'segmented'), 'switch'); ?>>
197 <span class="kng-v3-radio-card-content"><?php esc_html_e('Switch', 'king-addons'); ?></span>
198 </label>
199 <label class="kng-v3-radio-card">
200 <input type="radio" name="billing_type" value="tabs" <?php checked(($config['billing']['type'] ?? 'segmented'), 'tabs'); ?>>
201 <span class="kng-v3-radio-card-content"><?php esc_html_e('Tabs', 'king-addons'); ?></span>
202 </label>
203 </div>
204 </div>
205
206 <div class="kng-v3-divider"></div>
207 <h4 class="kng-v3-section-title"><?php esc_html_e('Billing Periods', 'king-addons'); ?></h4>
208
209 <div id="kng-pt-periods-list" class="kng-pt-periods-list">
210 <?php
211 $periods = $config['billing']['periods'] ?? [];
212 foreach ($periods as $index => $period):
213 ?>
214 <div class="kng-pt-period-item" data-index="<?php echo $index; ?>">
215 <div class="kng-pt-period-header">
216 <span class="kng-pt-period-drag">
217 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="16" height="16"><line x1="8" y1="6" x2="8" y2="6"/><line x1="16" y1="6" x2="16" y2="6"/><line x1="8" y1="12" x2="8" y2="12"/><line x1="16" y1="12" x2="16" y2="12"/><line x1="8" y1="18" x2="8" y2="18"/><line x1="16" y1="18" x2="16" y2="18"/></svg>
218 </span>
219 <span class="kng-pt-period-name"><?php echo esc_html($period['label']); ?></span>
220 <label class="kng-pt-period-default">
221 <input type="radio" name="default_period" value="<?php echo esc_attr($period['key']); ?>" <?php checked(!empty($period['is_default'])); ?>>
222 <?php esc_html_e('Default', 'king-addons'); ?>
223 </label>
224 </div>
225 <div class="kng-pt-period-fields">
226 <div class="kng-v3-field-group">
227 <div class="kng-v3-field">
228 <label class="kng-v3-label"><?php esc_html_e('Key', 'king-addons'); ?></label>
229 <input type="text" class="kng-v3-input kng-pt-period-key" value="<?php echo esc_attr($period['key']); ?>">
230 </div>
231 <div class="kng-v3-field">
232 <label class="kng-v3-label"><?php esc_html_e('Label', 'king-addons'); ?></label>
233 <input type="text" class="kng-v3-input kng-pt-period-label" value="<?php echo esc_attr($period['label']); ?>">
234 </div>
235 <div class="kng-v3-field">
236 <label class="kng-v3-label"><?php esc_html_e('Suffix', 'king-addons'); ?></label>
237 <input type="text" class="kng-v3-input kng-pt-period-suffix" value="<?php echo esc_attr($period['suffix'] ?? ''); ?>" placeholder="/mo">
238 </div>
239 </div>
240 <div class="kng-v3-field">
241 <div class="kng-v3-toggle-wrap kng-v3-toggle-wrap-sm">
242 <span class="kng-v3-toggle-label"><?php esc_html_e('Show Badge', 'king-addons'); ?></span>
243 <label class="kng-v3-toggle">
244 <input type="checkbox" class="kng-pt-period-badge-enabled" <?php checked(!empty($period['badge']['enabled'])); ?>>
245 <span class="kng-v3-toggle-slider"></span>
246 </label>
247 </div>
248 </div>
249 <div class="kng-v3-field kng-pt-period-badge-text-wrap" style="<?php echo empty($period['badge']['enabled']) ? 'display:none' : ''; ?>">
250 <label class="kng-v3-label"><?php esc_html_e('Badge Text', 'king-addons'); ?></label>
251 <input type="text" class="kng-v3-input kng-pt-period-badge-text" value="<?php echo esc_attr($period['badge']['text'] ?? ''); ?>" placeholder="Save 16%">
252 </div>
253 </div>
254 </div>
255 <?php endforeach; ?>
256 </div>
257
258 <div class="kng-v3-divider"></div>
259 <h4 class="kng-v3-section-title"><?php esc_html_e('Currency', 'king-addons'); ?></h4>
260
261 <div class="kng-v3-field-group">
262 <div class="kng-v3-field">
263 <label class="kng-v3-label" for="kng-pt-currency"><?php esc_html_e('Symbol', 'king-addons'); ?></label>
264 <input type="text" id="kng-pt-currency" class="kng-v3-input" value="<?php echo esc_attr($config['billing']['currency'] ?? '$'); ?>" maxlength="5">
265 </div>
266 <div class="kng-v3-field">
267 <label class="kng-v3-label" for="kng-pt-currency-pos"><?php esc_html_e('Position', 'king-addons'); ?></label>
268 <select id="kng-pt-currency-pos" class="kng-v3-select">
269 <option value="before" <?php selected(($config['billing']['currency_position'] ?? 'before'), 'before'); ?>><?php esc_html_e('Before ($99)', 'king-addons'); ?></option>
270 <option value="after" <?php selected(($config['billing']['currency_position'] ?? 'before'), 'after'); ?>><?php esc_html_e('After (99$)', 'king-addons'); ?></option>
271 </select>
272 </div>
273 </div>
274 </div>
275 </div>
276
277 <!-- Plans Tab -->
278 <div class="kng-pt-tab-panel" data-panel="plans">
279 <div class="kng-pt-plans-header">
280 <h4 class="kng-v3-section-title"><?php esc_html_e('Plans', 'king-addons'); ?></h4>
281 <button type="button" class="kng-v3-btn kng-v3-btn-secondary kng-v3-btn-sm" id="kng-pt-add-plan">
282 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="14" height="14"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
283 <?php esc_html_e('Add Plan', 'king-addons'); ?>
284 </button>
285 </div>
286
287 <div id="kng-pt-plans-list" class="kng-pt-plans-list">
288 <!-- Plans will be rendered by JS -->
289 </div>
290 </div>
291
292 <!-- Features Tab -->
293 <div class="kng-pt-tab-panel" data-panel="features">
294 <div class="kng-v3-field">
295 <label class="kng-v3-label"><?php esc_html_e('Features Display Mode', 'king-addons'); ?></label>
296 <div class="kng-v3-radio-cards kng-v3-radio-cards-sm">
297 <label class="kng-v3-radio-card">
298 <input type="radio" name="features_mode" value="per_plan" <?php checked(($config['features']['mode'] ?? 'per_plan'), 'per_plan'); ?>>
299 <span class="kng-v3-radio-card-content"><?php esc_html_e('Per Plan', 'king-addons'); ?></span>
300 </label>
301 <label class="kng-v3-radio-card">
302 <input type="radio" name="features_mode" value="comparison" <?php checked(($config['features']['mode'] ?? 'per_plan'), 'comparison'); ?>>
303 <span class="kng-v3-radio-card-content"><?php esc_html_e('Comparison', 'king-addons'); ?></span>
304 </label>
305 </div>
306 <p class="kng-v3-field-help"><?php esc_html_e('Per Plan: Each plan shows its own features. Comparison: Global feature list with per-plan availability.', 'king-addons'); ?></p>
307 </div>
308
309 <div class="kng-v3-field">
310 <div class="kng-v3-toggle-wrap">
311 <span class="kng-v3-toggle-label"><?php esc_html_e('Show Feature Icons', 'king-addons'); ?></span>
312 <label class="kng-v3-toggle">
313 <input type="checkbox" id="kng-pt-show-icons" <?php checked(!empty($config['features']['show_icons'])); ?>>
314 <span class="kng-v3-toggle-slider"></span>
315 </label>
316 </div>
317 </div>
318 </div>
319
320 <!-- Styles Tab -->
321 <div class="kng-pt-tab-panel" data-panel="styles">
322 <h4 class="kng-v3-section-title"><?php esc_html_e('Preset', 'king-addons'); ?></h4>
323 <div class="kng-pt-presets-grid" id="kng-pt-presets">
324 <?php foreach ($presets as $preset_id => $preset): ?>
325 <button type="button"
326 class="kng-pt-preset-card <?php echo ($config['style']['preset_id'] ?? 'free_modern_cards') === $preset_id ? 'is-active' : ''; ?> <?php echo !empty($preset['disabled']) ? 'is-disabled' : ''; ?>"
327 data-preset="<?php echo esc_attr($preset_id); ?>"
328 <?php echo !empty($preset['disabled']) ? 'disabled' : ''; ?>>
329 <span class="kng-pt-preset-name"><?php echo esc_html($preset['name']); ?></span>
330 <?php if (!empty($preset['is_pro'])): ?>
331 <span class="kng-pt-preset-badge kng-pt-badge-pro"><?php esc_html_e('PRO', 'king-addons'); ?></span>
332 <?php endif; ?>
333 </button>
334 <?php endforeach; ?>
335 </div>
336
337 <div class="kng-v3-divider"></div>
338 <h4 class="kng-v3-section-title"><?php esc_html_e('Color Overrides', 'king-addons'); ?></h4>
339
340 <div class="kng-pt-color-overrides">
341 <div class="kng-v3-field">
342 <label class="kng-v3-label"><?php esc_html_e('Accent Color', 'king-addons'); ?></label>
343 <input type="text" class="kng-v3-color-input" id="kng-pt-color-accent" value="<?php echo esc_attr($config['style']['tokens']['colors']['accent'] ?? ''); ?>" data-default-color="">
344 </div>
345 <div class="kng-v3-field">
346 <label class="kng-v3-label"><?php esc_html_e('Card Background', 'king-addons'); ?></label>
347 <input type="text" class="kng-v3-color-input" id="kng-pt-color-card-bg" value="<?php echo esc_attr($config['style']['tokens']['colors']['card_bg'] ?? ''); ?>" data-default-color="">
348 </div>
349 <div class="kng-v3-field">
350 <label class="kng-v3-label"><?php esc_html_e('Text Color', 'king-addons'); ?></label>
351 <input type="text" class="kng-v3-color-input" id="kng-pt-color-text" value="<?php echo esc_attr($config['style']['tokens']['colors']['text'] ?? ''); ?>" data-default-color="">
352 </div>
353 </div>
354
355 <div class="kng-v3-divider"></div>
356 <h4 class="kng-v3-section-title"><?php esc_html_e('Custom CSS Class', 'king-addons'); ?></h4>
357
358 <div class="kng-v3-field">
359 <input type="text" id="kng-pt-custom-class" class="kng-v3-input" value="<?php echo esc_attr($config['style']['overrides']['custom_css_class'] ?? ''); ?>" placeholder="my-custom-class">
360 </div>
361 </div>
362
363 <!-- Advanced Tab -->
364 <div class="kng-pt-tab-panel" data-panel="advanced">
365 <div class="kng-v3-field">
366 <div class="kng-v3-toggle-wrap">
367 <span class="kng-v3-toggle-label"><?php esc_html_e('Hide Billing Toggle', 'king-addons'); ?></span>
368 <label class="kng-v3-toggle">
369 <input type="checkbox" id="kng-pt-hide-toggle" <?php checked(!empty($config['advanced']['hide_toggle'])); ?>>
370 <span class="kng-v3-toggle-slider"></span>
371 </label>
372 </div>
373 <p class="kng-v3-field-help"><?php esc_html_e('Hide the toggle even if billing is enabled', 'king-addons'); ?></p>
374 </div>
375
376 <div class="kng-v3-field">
377 <label class="kng-v3-label" for="kng-pt-force-period"><?php esc_html_e('Force Period', 'king-addons'); ?></label>
378 <select id="kng-pt-force-period" class="kng-v3-select">
379 <option value=""><?php esc_html_e('None (use default)', 'king-addons'); ?></option>
380 <option value="monthly" <?php selected(($config['advanced']['force_period'] ?? ''), 'monthly'); ?>><?php esc_html_e('Monthly', 'king-addons'); ?></option>
381 <option value="annual" <?php selected(($config['advanced']['force_period'] ?? ''), 'annual'); ?>><?php esc_html_e('Annual', 'king-addons'); ?></option>
382 </select>
383 <p class="kng-v3-field-help"><?php esc_html_e('Force a specific billing period to be shown', 'king-addons'); ?></p>
384 </div>
385
386 <div class="kng-v3-field">
387 <div class="kng-v3-toggle-wrap">
388 <span class="kng-v3-toggle-label"><?php esc_html_e('Disable Animations', 'king-addons'); ?></span>
389 <label class="kng-v3-toggle">
390 <input type="checkbox" id="kng-pt-disable-animations" <?php checked(!empty($config['advanced']['disable_animations'])); ?>>
391 <span class="kng-v3-toggle-slider"></span>
392 </label>
393 </div>
394 </div>
395
396 <div class="kng-v3-divider"></div>
397 <h4 class="kng-v3-section-title"><?php esc_html_e('Shortcode', 'king-addons'); ?></h4>
398
399 <?php if ($table_id_val > 0): ?>
400 <div class="kng-pt-shortcode-box">
401 <code class="kng-pt-shortcode-code">[kng_pricing_table id="<?php echo esc_attr($table_id_val); ?>"]</code>
402 <button type="button" class="kng-pt-copy-btn" data-copy='[kng_pricing_table id="<?php echo esc_attr($table_id_val); ?>"]'>
403 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="16" height="16"><rect x="9" y="9" width="13" height="13" rx="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/></svg>
404 </button>
405 </div>
406 <?php else: ?>
407 <p class="kng-v3-field-help"><?php esc_html_e('Save the table first to get the shortcode', 'king-addons'); ?></p>
408 <?php endif; ?>
409 </div>
410
411 </div>
412 </div>
413
414 <!-- Right Panel: Preview -->
415 <div class="kng-pt-editor-preview">
416 <div class="kng-pt-preview-header">
417 <span class="kng-pt-preview-label"><?php esc_html_e('Live Preview', 'king-addons'); ?></span>
418 <div class="kng-pt-preview-devices">
419 <button type="button" class="kng-pt-device-btn is-active" data-device="desktop" title="<?php esc_attr_e('Desktop', 'king-addons'); ?>">
420 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="18" height="18"><rect x="2" y="3" width="20" height="14" rx="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/></svg>
421 </button>
422 <button type="button" class="kng-pt-device-btn" data-device="tablet" title="<?php esc_attr_e('Tablet', 'king-addons'); ?>">
423 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="18" height="18"><rect x="4" y="2" width="16" height="20" rx="2"/><line x1="12" y1="18" x2="12" y2="18"/></svg>
424 </button>
425 <button type="button" class="kng-pt-device-btn" data-device="mobile" title="<?php esc_attr_e('Mobile', 'king-addons'); ?>">
426 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="18" height="18"><rect x="5" y="2" width="14" height="20" rx="2"/><line x1="12" y1="18" x2="12" y2="18"/></svg>
427 </button>
428 </div>
429 </div>
430 <div class="kng-pt-preview-frame" id="kng-pt-preview-frame">
431 <div class="kng-pt-preview-content" id="kng-pt-preview-content">
432 <!-- Preview rendered by JS -->
433 </div>
434 </div>
435 </div>
436 </div>
437 </form>
438 </div>
439
440 <!-- Plan Item Template -->
441 <template id="kng-pt-plan-template">
442 <div class="kng-pt-plan-item" data-plan-id="">
443 <div class="kng-pt-plan-header">
444 <span class="kng-pt-plan-drag">
445 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="16" height="16"><circle cx="8" cy="6" r="1"/><circle cx="16" cy="6" r="1"/><circle cx="8" cy="12" r="1"/><circle cx="16" cy="12" r="1"/><circle cx="8" cy="18" r="1"/><circle cx="16" cy="18" r="1"/></svg>
446 </span>
447 <input type="text" class="kng-pt-plan-name-input kng-v3-input" placeholder="<?php esc_attr_e('Plan Name', 'king-addons'); ?>">
448 <button type="button" class="kng-pt-plan-toggle">
449 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="16" height="16"><polyline points="6 9 12 15 18 9"/></svg>
450 </button>
451 <button type="button" class="kng-pt-plan-delete" title="<?php esc_attr_e('Delete Plan', 'king-addons'); ?>">
452 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="16" height="16"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
453 </button>
454 </div>
455 <div class="kng-pt-plan-body">
456 <div class="kng-v3-field">
457 <label class="kng-v3-label"><?php esc_html_e('Subtitle', 'king-addons'); ?></label>
458 <input type="text" class="kng-v3-input kng-pt-plan-subtitle" placeholder="<?php esc_attr_e('For individuals', 'king-addons'); ?>">
459 </div>
460
461 <div class="kng-v3-field-group">
462 <div class="kng-v3-field">
463 <div class="kng-v3-toggle-wrap kng-v3-toggle-wrap-compact">
464 <span class="kng-v3-toggle-label"><?php esc_html_e('Highlight', 'king-addons'); ?></span>
465 <label class="kng-v3-toggle kng-v3-toggle-sm">
466 <input type="checkbox" class="kng-pt-plan-highlight">
467 <span class="kng-v3-toggle-slider"></span>
468 </label>
469 </div>
470 </div>
471 <div class="kng-v3-field">
472 <div class="kng-v3-toggle-wrap kng-v3-toggle-wrap-compact">
473 <span class="kng-v3-toggle-label"><?php esc_html_e('Badge', 'king-addons'); ?></span>
474 <label class="kng-v3-toggle kng-v3-toggle-sm">
475 <input type="checkbox" class="kng-pt-plan-badge-enabled">
476 <span class="kng-v3-toggle-slider"></span>
477 </label>
478 </div>
479 </div>
480 </div>
481
482 <div class="kng-pt-plan-badge-fields" style="display: none;">
483 <div class="kng-v3-field">
484 <label class="kng-v3-label"><?php esc_html_e('Badge Text', 'king-addons'); ?></label>
485 <input type="text" class="kng-v3-input kng-pt-plan-badge-text" placeholder="<?php esc_attr_e('Popular', 'king-addons'); ?>">
486 </div>
487 </div>
488
489 <div class="kng-v3-divider-sm"></div>
490 <h5 class="kng-v3-subsection-title"><?php esc_html_e('Pricing', 'king-addons'); ?></h5>
491
492 <div class="kng-pt-plan-pricing">
493 <div class="kng-pt-plan-pricing-period" data-period="monthly">
494 <span class="kng-pt-pricing-period-label"><?php esc_html_e('Monthly', 'king-addons'); ?></span>
495 <div class="kng-v3-field-group">
496 <div class="kng-v3-field">
497 <input type="text" class="kng-v3-input kng-pt-plan-price" placeholder="29">
498 </div>
499 <div class="kng-v3-field">
500 <input type="text" class="kng-v3-input kng-pt-plan-note" placeholder="<?php esc_attr_e('billed monthly', 'king-addons'); ?>">
501 </div>
502 </div>
503 </div>
504 <div class="kng-pt-plan-pricing-period" data-period="annual">
505 <span class="kng-pt-pricing-period-label"><?php esc_html_e('Annual', 'king-addons'); ?></span>
506 <div class="kng-v3-field-group">
507 <div class="kng-v3-field">
508 <input type="text" class="kng-v3-input kng-pt-plan-price" placeholder="290">
509 </div>
510 <div class="kng-v3-field">
511 <input type="text" class="kng-v3-input kng-pt-plan-note" placeholder="<?php esc_attr_e('billed annually', 'king-addons'); ?>">
512 </div>
513 </div>
514 </div>
515 </div>
516
517 <div class="kng-v3-divider-sm"></div>
518 <h5 class="kng-v3-subsection-title"><?php esc_html_e('Call to Action', 'king-addons'); ?></h5>
519
520 <div class="kng-v3-field-group">
521 <div class="kng-v3-field">
522 <label class="kng-v3-label"><?php esc_html_e('Button Text', 'king-addons'); ?></label>
523 <input type="text" class="kng-v3-input kng-pt-plan-cta-text" placeholder="<?php esc_attr_e('Get Started', 'king-addons'); ?>">
524 </div>
525 <div class="kng-v3-field">
526 <label class="kng-v3-label"><?php esc_html_e('URL', 'king-addons'); ?></label>
527 <input type="url" class="kng-v3-input kng-pt-plan-cta-url" placeholder="https://">
528 </div>
529 </div>
530 <div class="kng-v3-field-group">
531 <div class="kng-v3-field">
532 <label class="kng-v3-label"><?php esc_html_e('Style', 'king-addons'); ?></label>
533 <select class="kng-v3-select kng-pt-plan-cta-style">
534 <option value="primary"><?php esc_html_e('Primary', 'king-addons'); ?></option>
535 <option value="secondary"><?php esc_html_e('Secondary', 'king-addons'); ?></option>
536 <option value="outline"><?php esc_html_e('Outline', 'king-addons'); ?></option>
537 </select>
538 </div>
539 <div class="kng-v3-field">
540 <label class="kng-v3-label"><?php esc_html_e('Target', 'king-addons'); ?></label>
541 <select class="kng-v3-select kng-pt-plan-cta-target">
542 <option value="_self"><?php esc_html_e('Same Window', 'king-addons'); ?></option>
543 <option value="_blank"><?php esc_html_e('New Window', 'king-addons'); ?></option>
544 </select>
545 </div>
546 </div>
547
548 <div class="kng-v3-divider-sm"></div>
549 <div class="kng-pt-plan-features-header">
550 <h5 class="kng-v3-subsection-title"><?php esc_html_e('Features', 'king-addons'); ?></h5>
551 <button type="button" class="kng-v3-btn kng-v3-btn-text kng-v3-btn-xs kng-pt-add-feature">
552 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="12" height="12"><line x1="12" y1="5" x2="12" y2="19"/><line x1="5" y1="12" x2="19" y2="12"/></svg>
553 <?php esc_html_e('Add', 'king-addons'); ?>
554 </button>
555 </div>
556
557 <div class="kng-pt-plan-features-list">
558 <!-- Features rendered by JS -->
559 </div>
560 </div>
561 </div>
562 </template>
563
564 <!-- Feature Item Template -->
565 <template id="kng-pt-feature-template">
566 <div class="kng-pt-feature-item">
567 <span class="kng-pt-feature-drag">
568 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="12" height="12"><circle cx="8" cy="6" r="1"/><circle cx="16" cy="6" r="1"/><circle cx="8" cy="12" r="1"/><circle cx="16" cy="12" r="1"/></svg>
569 </span>
570 <input type="text" class="kng-v3-input kng-v3-input-sm kng-pt-feature-text" placeholder="<?php esc_attr_e('Feature name', 'king-addons'); ?>">
571 <select class="kng-v3-select kng-v3-select-sm kng-pt-feature-state">
572 <option value="enabled"><?php esc_html_e('✓', 'king-addons'); ?></option>
573 <option value="disabled"><?php esc_html_e('✗', 'king-addons'); ?></option>
574 </select>
575 <button type="button" class="kng-pt-feature-delete">
576 <svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" width="14" height="14"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>
577 </button>
578 </div>
579 </template>
580