PluginProbe
The Innovative Form Builder – IvyForms / 1.0
The Innovative Form Builder – IvyForms v1.0
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
ivyforms / backend / src / Services / Template / CustomerLoyaltyRecommendationFormTemplate.php

CustomerLoyaltyRecommendationFormTemplate.php in The Innovative Form Builder – IvyForms 1.0, at backend/src/Services/Template/CustomerLoyaltyRecommendationFormTemplate.php

310 lines 10.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace IvyForms\Services\Template;
4
5 use IvyForms\Services\Translations\BackendStrings;
6
7 class CustomerLoyaltyRecommendationFormTemplate
8 {
9 /**
10 * Get the Customer Loyalty & Recommendation template
11 *
12 * @return array<string, mixed>
13 */
14 public static function getTemplate(): array
15 {
16 return [
17 'id' => 'customer_loyalty_recommendation_form',
18 'name' => BackendStrings::getTemplateStrings()['customer_loyalty_recommendation_form'],
19 'description' => BackendStrings::getTemplateStrings()['customer_loyalty_recommendation_form_desc'],
20 'category' => 'feedback-forms',
21 'subcategory' => 'customer-feedback-forms',
22 'is_pro' => false,
23 'screenshot' => IVYFORMS_TEMPLATES_IMAGES_URL . 'customer-loyalty-recommendation-form.svg',
24 'form_data' => [
25 'name' => BackendStrings::getTemplateStrings()['customer_loyalty_recommendation_form'],
26 'published' => 1,
27 'showTitle' => 1,
28 'storeEntries' => 1,
29 'integrationSettings' => TemplateDefaults::getDefaultIntegrationSettings(),
30 'fields' => array_merge(
31 self::getUsageFrequencyField(),
32 self::getOverallSatisfactionRatingField(),
33 self::getRecommendationLikelihoodField(),
34 self::getWhatKeepsYouComingBackField(),
35 self::getWhatCouldMakeMoreLoyalTextareaField(),
36 self::getEmailField()
37 ),
38 'settings' => []
39 ]
40 ];
41 }
42
43 /**
44 * How often do you use our product/service? (radio)
45 *
46 * @return array<int, array<string, mixed>>
47 */
48 private static function getUsageFrequencyField(): array
49 {
50 return [[
51 'id' => 5,
52 'fieldIndex' => 1,
53 'type' => 'radio',
54 'label' => BackendStrings::getTemplateStrings()['how_often_use_product_service'],
55 'required' => true,
56 'parentId' => null,
57 'defaultValue' => '',
58 'placeholder' => '',
59 'position' => 1,
60 'fieldOptions' => [
61 [
62 'label' => BackendStrings::getTemplateStrings()['usage_first_time'],
63 'value' => 'first_time',
64 'position' => 1,
65 ],
66 [
67 'label' => BackendStrings::getTemplateStrings()['usage_occasionally'],
68 'value' => 'occasionally',
69 'position' => 2,
70 ],
71 [
72 'label' => BackendStrings::getTemplateStrings()['usage_regularly'],
73 'value' => 'regularly',
74 'position' => 3,
75 ],
76 [
77 'label' => BackendStrings::getTemplateStrings()['usage_long_term_customer'],
78 'value' => 'long_term',
79 'position' => 4,
80 ],
81 ]
82 ]];
83 }
84
85 /**
86 * Overall satisfaction rating
87 *
88 * @return array<int, array<string, mixed>>
89 */
90 private static function getOverallSatisfactionRatingField(): array
91 {
92 return [[
93 'id' => 6,
94 'fieldIndex' => 2,
95 'type' => 'rating',
96 'label' => BackendStrings::getTemplateStrings()['overall_satisfaction'],
97 'required' => true,
98 'defaultValue' => '',
99 'placeholder' => '',
100 'position' => 2,
101 'labelPosition' => 'default',
102 'ratingIcon' => 'star',
103 'fieldOptions' => self::getStandardRatingOptions(1),
104 'showValues' => false,
105 'showRatingText' => true,
106 ]];
107 }
108
109 /**
110 * How likely are you to recommend us? (rating)
111 *
112 * @return array<int, array<string, mixed>>
113 */
114 private static function getRecommendationLikelihoodField(): array
115 {
116 return [[
117 'id' => 12,
118 'fieldIndex' => 3,
119 'type' => 'rating',
120 'label' => BackendStrings::getTemplateStrings()['how_likely_recommend_us'],
121 'required' => true,
122 'parentId' => null,
123 'defaultValue' => '',
124 'placeholder' => '',
125 'position' => 3,
126 'labelPosition' => 'default',
127 'ratingIcon' => 'star',
128 'fieldOptions' => [
129 [
130 'id' => 7,
131 'label' => BackendStrings::getTemplateStrings()['recommendation_very_likely'],
132 'value' => '5',
133 'isDefault' => false,
134 'position' => 1,
135 ],
136 [
137 'id' => 8,
138 'label' => BackendStrings::getTemplateStrings()['recommendation_likely'],
139 'value' => '4',
140 'isDefault' => false,
141 'position' => 2,
142 ],
143 [
144 'id' => 9,
145 'label' => BackendStrings::getTemplateStrings()['recommendation_not_sure'],
146 'value' => '3',
147 'isDefault' => false,
148 'position' => 3,
149 ],
150 [
151 'id' => 10,
152 'label' => BackendStrings::getTemplateStrings()['recommendation_unlikely'],
153 'value' => '2',
154 'isDefault' => false,
155 'position' => 4,
156 ],
157 [
158 'id' => 11,
159 'label' => BackendStrings::getTemplateStrings()['recommendation_very_unlikely'],
160 'value' => '1',
161 'isDefault' => false,
162 'position' => 5,
163 ],
164 ],
165 'showValues' => false,
166 'showRatingText' => true,
167 ]];
168 }
169
170 /**
171 * What keeps you coming back? (checkbox)
172 *
173 * @return array<int, array<string, mixed>>
174 */
175 private static function getWhatKeepsYouComingBackField(): array
176 {
177 return [[
178 'id' => 18,
179 'fieldIndex' => 4,
180 'type' => 'checkbox',
181 'label' => BackendStrings::getTemplateStrings()['what_keeps_you_coming_back'],
182 'required' => false,
183 'parentId' => null,
184 'defaultValue' => '',
185 'placeholder' => '',
186 'position' => 4,
187 'fieldOptions' => [
188 [
189 'id' => 13,
190 'label' => BackendStrings::getTemplateStrings()['keeps_product_quality'],
191 'value' => 'product_quality',
192 'position' => 1,
193 ],
194 [
195 'id' => 14,
196 'label' => BackendStrings::getTemplateStrings()['keeps_pricing'],
197 'value' => 'pricing',
198 'position' => 2,
199 ],
200 [
201 'id' => 15,
202 'label' => BackendStrings::getTemplateStrings()['keeps_customer_support'],
203 'value' => 'customer_support',
204 'position' => 3,
205 ],
206 [
207 'id' => 16,
208 'label' => BackendStrings::getTemplateStrings()['keeps_ease_of_use'],
209 'value' => 'ease_of_use',
210 'position' => 4,
211 ],
212 [
213 'id' => 17,
214 'label' => BackendStrings::getTemplateStrings()['keeps_trust_in_brand'],
215 'value' => 'trust_in_brand',
216 'position' => 5,
217 ],
218 ]
219 ]];
220 }
221
222 /**
223 * What could make you more loyal? (textarea)
224 *
225 * @return array<int, array<string, mixed>>
226 */
227 private static function getWhatCouldMakeMoreLoyalTextareaField(): array
228 {
229 return [[
230 'id' => 19,
231 'fieldIndex' => 5,
232 'type' => 'textarea',
233 'label' => BackendStrings::getTemplateStrings()['what_could_make_you_more_loyal'],
234 'placeholder' => BackendStrings::getTemplateStrings()['what_could_make_you_more_loyal_placeholder'],
235 'required' => false,
236 'parentId' => null,
237 'defaultValue' => '',
238 'position' => 5,
239 'labelPosition' => 'default',
240 ]];
241 }
242
243 /**
244 * Email field
245 *
246 * @return array<int, array<string, mixed>>
247 */
248 private static function getEmailField(): array
249 {
250 return [[
251 'id' => 20,
252 'fieldIndex' => 6,
253 'type' => 'email',
254 'label' => BackendStrings::getTemplateStrings()['email_address'],
255 'placeholder' => '[email protected]',
256 'required' => false,
257 'parentId' => null,
258 'defaultValue' => '',
259 'position' => 6,
260 'description' => BackendStrings::getTemplateStrings()['follow_up_email_description'],
261 ]];
262 }
263
264 /**
265 * Standard rating options (1-5)
266 *
267 * @return array<int, array<string, mixed>>
268 */
269 private static function getStandardRatingOptions(int $startId): array
270 {
271 return [
272 [
273 'id' => $startId,
274 'label' => BackendStrings::getNewFormStrings()['good'],
275 'value' => '1',
276 'isDefault' => false,
277 'position' => 1,
278 ],
279 [
280 'id' => $startId + 1,
281 'label' => BackendStrings::getNewFormStrings()['nice'],
282 'value' => '2',
283 'isDefault' => false,
284 'position' => 2,
285 ],
286 [
287 'id' => $startId + 2,
288 'label' => BackendStrings::getNewFormStrings()['very_good'],
289 'value' => '3',
290 'isDefault' => false,
291 'position' => 3,
292 ],
293 [
294 'id' => $startId + 3,
295 'label' => BackendStrings::getNewFormStrings()['awesome'],
296 'value' => '4',
297 'isDefault' => false,
298 'position' => 4,
299 ],
300 [
301 'id' => $startId + 4,
302 'label' => BackendStrings::getNewFormStrings()['amazing'],
303 'value' => '5',
304 'isDefault' => false,
305 'position' => 5,
306 ],
307 ];
308 }
309 }
310