PluginProbe
weForms – Easy Drag & Drop Contact Form Builder For WordPress / 1.6.28
weForms – Easy Drag & Drop Contact Form Builder For WordPress v1.6.28
1.6.7 1.6.8 1.6.9 1.6.12 1.6.13 1.6.14 1.6.15 1.6.16 1.6.17 1.6.18 1.6.19 1.6.2 1.6.20 1.6.21 1.6.22 1.6.23 1.6.24 1.6.25 1.6.26 1.6.27 1.6.28 1.6.3 1.6.4 1.6.5 1.6.6 All 74 releases
weforms / includes / templates / class-template-product-order-form.php

class-template-product-order-form.php in weForms – Easy Drag & Drop Contact Form Builder For WordPress 1.6.28, at includes/templates/class-template-product-order-form.php

147 lines 5.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Blank form template
5 */
6 class WeForms_Template_Product_Order_Form extends WeForms_Form_Template {
7
8 public function __construct() {
9 parent::__construct();
10
11 $this->enabled = class_exists( 'WeForms_Pro' );
12 $this->title = __( 'Product Order Form', 'weforms' );
13 $this->description = __( 'A simple order form template with quantity, color and size options. Ideal for preparing an order form in seconds.', 'weforms' );
14 $this->category = 'default';
15 $this->image = WEFORMS_ASSET_URI . '/images/form-template/product-order-form.png';
16 $this->category = 'payment';
17 }
18
19 /**
20 * Get the form fields
21 *
22 * @return array
23 */
24 public function get_form_fields() {
25 $all_fields = $this->get_available_fields();
26
27 $form_fields = [
28 array_merge( $all_fields['step_start']->get_field_props(), [
29 'label' => __( 'Product Order', 'weforms' ),
30 'name' => 'personal_order',
31 'step_start' => [
32 'prev_button_text' => __( 'Previous', 'weforms' ),
33 'next_button_text' => __( 'Next', 'weforms' ),
34 ],
35 ] ),
36 array_merge( $all_fields['name_field']->get_field_props(), [
37 'required' => 'yes',
38 'format' => 'first-middle-last',
39 'first_name' => [
40 'placeholder' => '',
41 'default' => '',
42 'sub' => __( 'First', 'weforms' ),
43 ],
44 'middle_name' => [
45 'placeholder' => '',
46 'default' => '',
47 'sub' => __( 'Middle', 'weforms' ),
48 ],
49 'last_name' => [
50 'placeholder' => '',
51 'default' => '',
52 'sub' => __( 'Last', 'weforms' ),
53 ],
54 'hide_subs' => false,
55 'name' => 'format',
56 ] ),
57 array_merge( $all_fields['email_address']->get_field_props(), [
58 'label' => __( 'Email Address', 'weforms' ),
59 'name' => 'email_address',
60 ] ),
61 array_merge( $all_fields['numeric_text_field']->get_field_props(), [
62 'required' => 'yes',
63 'label' => __( 'Contact Number', 'weforms' ),
64 'name' => 'phone_number',
65 ] ),
66 array_merge( $all_fields['address_field']->get_field_props(), [
67 'required' => 'yes',
68 'label' => 'Billing Address',
69 'name' => 'billing_address',
70 ] ),
71 array_merge( $all_fields['step_start']->get_field_props(), [
72 'label' => __( 'Product', 'weforms' ),
73 'name' => 'product',
74 'step_start' => [
75 'prev_button_text' => __( 'Previous', 'weforms' ),
76 'next_button_text' => __( 'Next', 'weforms' ),
77 ],
78 ] ),
79 array_merge( $all_fields['single_product']->get_field_props(), [
80 'label' => __( 'T-Shirt', 'weforms' ),
81 'name' => 't_shirt',
82 'price' => [
83 'price' => 10,
84 ],
85 'quantity' => [
86 'status' => 'yes',
87 ],
88 ] ),
89 array_merge( $all_fields['single_product']->get_field_props(), [
90 'label' => __( 'Sweatshirt', 'weforms' ),
91 'name' => 'sweatshirt',
92 'price' => [
93 'price' => 10,
94 ],
95 'quantity' => [
96 'status' => 'yes',
97 ],
98 ] ),
99 array_merge( $all_fields['single_product']->get_field_props(), [
100 'label' => __( 'Shoes', 'weforms' ),
101 'name' => 'shoes',
102 'price' => [
103 'price' => 10,
104 ],
105 'quantity' => [
106 'status' => 'yes',
107 ],
108 ] ),
109 array_merge( $all_fields['total']->get_field_props(), [
110 'label' => __( 'Total', 'weforms' ),
111 'price' => 0,
112 ] ),
113
114 array_merge( $all_fields['checkbox_field']->get_field_props(), [
115 'label' => __( 'Send Gift', 'weforms' ),
116 'name' => 'send_gift',
117 'options' => [
118 'yes' => __( 'Yes', 'weforms' ),
119 'no' => __( 'No', 'weforms' ),
120 ],
121 ] ),
122 array_merge( $all_fields['textarea_field']->get_field_props(), [
123 'label' => __( 'Additional Requests', 'weforms' ),
124 'name' => 'additional_request',
125 ] ),
126 ];
127
128 return $form_fields;
129 }
130
131 /**
132 * Get the form settings
133 *
134 * @return array
135 */
136 public function get_form_settings() {
137 $defaults = $this->get_default_settings();
138
139 return array_merge( $defaults, [
140 'submit_text' => __( 'Submit', 'weforms' ),
141 'label_position' => 'above',
142 'enable_multistep' => true,
143 'multistep_progressbar_type' => 'step_by_step',
144 ] );
145 }
146 }
147