Woocommerce Products Slider - Version 1.13.11

Version Description

  • 2020-04-10 add - "Easy digital downloads" plugin downloads slider
    • 2020-04-10 add - add element "EDD price" under layout builder
    • 2020-04-10 add - add element "EDD add to cart" under layout builder
    • 2020-04-10 add - add element "EDD categories" under layout builder
    • 2020-04-10 add - add element "EDD tags" under layout builder
Download this release

Release Info

Developer pickplugins
Plugin Icon 128x128 Woocommerce Products Slider
Version 1.13.11
Comparing to
See all releases

Code changes from version 1.13.10 to 1.13.11

includes/3rd-party/3rd-party.php CHANGED
@@ -6,10 +6,18 @@ include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
6
7
8
if ( is_plugin_active( 'dokan-lite/dokan.php' ) ) {
9
- require_once( wcps_plugin_dir . 'includes/3rd-party/functions-layout-element-dokan.php');
10
}
11
12
13
14
15
6
7
8
if ( is_plugin_active( 'dokan-lite/dokan.php' ) ) {
9
+
10
+ require_once( wcps_plugin_dir . 'includes/3rd-party/dokan-lite/class-metabox-wcps-hook.php');
11
+ require_once( wcps_plugin_dir . 'includes/3rd-party/dokan-lite/functions-layout-element.php');
12
}
13
14
+ if ( is_plugin_active( 'easy-digital-downloads/easy-digital-downloads.php' ) ) {
15
+
16
+ require_once( wcps_plugin_dir . 'includes/3rd-party/easy-digital-downloads/class-metabox-wcps-hook.php');
17
+ require_once( wcps_plugin_dir . 'includes/3rd-party/easy-digital-downloads/functions-layout-element.php');
18
+ require_once( wcps_plugin_dir . 'includes/3rd-party/easy-digital-downloads/wcps-slider-hook.php');
19
20
+ }
21
22
23
includes/3rd-party/dokan-lite/class-metabox-wcps-hook.php ADDED
@@ -0,0 +1,157 @@
1
+ <?php
2
+ if ( ! defined('ABSPATH')) exit; // if direct access
3
+
4
+
5
+
6
+
7
+
8
+ add_filter('wcps_slider_for_args', 'wcps_slider_for_args_dokan');
9
+ function wcps_slider_for_args_dokan($args){
10
+
11
+ $args['dokan_vendors'] = __('Dokan vendors', 'woocommerce-products-slider');
12
+
13
+ return $args;
14
+ }
15
+
16
+ add_filter('wcps_metabox_navs', 'wcps_metabox_navs_dokan');
17
+ function wcps_metabox_navs_dokan($tabs){
18
+
19
+ global $post;
20
+ $post_id = $post->ID;
21
+
22
+
23
+ $wcps_options = get_post_meta($post_id,'wcps_options', true);
24
+ $current_tab = isset($wcps_options['current_tab']) ? $wcps_options['current_tab'] : 'layouts';
25
+ $slider_for = !empty($wcps_options['slider_for']) ? $wcps_options['slider_for'] : 'products';
26
+
27
+ $tabs[] = array(
28
+ 'id' => 'query_dokan_vendors',
29
+ 'title' => sprintf(__('%s Query dokan vendors','woocommerce-products-slider'),'<i class="fas fa-qrcode"></i>'),
30
+ 'priority' => 3,
31
+ 'active' => ($current_tab == 'query_dokan_vendors') ? true : false,
32
+ 'data_visible' => 'dokan_vendors',
33
+ 'hidden' => ($slider_for == 'products')? true : false || ($slider_for == 'orders')? true : false || ($slider_for == 'categories')? true : false || ($slider_for == 'edd_downloads')? true : false,
34
+ );
35
+ return $tabs;
36
+ }
37
+
38
+
39
+ add_action('wcps_metabox_content_query_dokan_vendors', 'wcps_metabox_content_query_dokan_vendors');
40
+
41
+ if(!function_exists('wcps_metabox_content_query_dokan_vendors')) {
42
+ function wcps_metabox_content_query_dokan_vendors($post_id){
43
+
44
+ $settings_tabs_field = new settings_tabs_field();
45
+
46
+ $wcps_options = get_post_meta( $post_id, 'wcps_options', true );
47
+ $vendors_query = !empty($wcps_options['dokan_vendors_query']) ? $wcps_options['dokan_vendors_query'] : array();
48
+
49
+ $posts_per_page = isset($vendors_query['posts_per_page']) ? $vendors_query['posts_per_page'] : 10;
50
+ $query_order = isset($vendors_query['order']) ? $vendors_query['order'] : 'DESC';
51
+ $query_orderby = isset($vendors_query['orderby']) ? $vendors_query['orderby'] : 'ID';
52
+
53
+ $vendors_ids = isset($vendors_query['vendors_ids']) ? $vendors_query['vendors_ids'] : '';
54
+
55
+ ?>
56
+ <div class="section">
57
+ <div class="section-title">Query Vendors</div>
58
+ <p class="description section-description">Setup vendors query settings.</p>
59
+
60
+
61
+ <?php
62
+
63
+ $args = array(
64
+ 'id' => 'posts_per_page',
65
+ 'parent' => 'wcps_options[dokan_vendors_query]',
66
+ 'title' => __('Max number of vendors','woocommerce-products-slider'),
67
+ 'details' => __('Set custom number you want to display maximum number of vendors','woocommerce-products-slider'),
68
+ 'type' => 'text',
69
+ 'value' => $posts_per_page,
70
+ 'default' => '10',
71
+ 'placeholder' => '10',
72
+ );
73
+
74
+ $settings_tabs_field->generate_field($args);
75
+
76
+
77
+
78
+ $args = array(
79
+ 'id' => 'order',
80
+ 'parent' => 'wcps_options[dokan_vendors_query]',
81
+ 'title' => __('Query order','woocommerce-products-slider'),
82
+ 'details' => __('Set query order.','woocommerce-products-slider'),
83
+ 'type' => 'select',
84
+ 'value' => $query_order,
85
+ 'default' => 'DESC',
86
+ 'args' => array(
87
+ 'DESC'=>__('Descending','woocommerce-products-slider'),
88
+ 'ASC'=>__('Ascending','woocommerce-products-slider'),
89
+ ),
90
+ );
91
+
92
+ $settings_tabs_field->generate_field($args);
93
+
94
+
95
+ $args = array(
96
+ 'id' => 'orderby',
97
+ 'parent' => 'wcps_options[dokan_vendors_query]',
98
+ 'title' => __('Query orderby','woocommerce-products-slider'),
99
+ 'details' => __('Set query orderby.','woocommerce-products-slider'),
100
+ 'type' => 'select',
101
+ 'value' => $query_orderby,
102
+ 'default' => 'DESC',
103
+ 'args' => array(
104
+ 'ID'=>__('ID','woocommerce-products-slider'),
105
+ 'display_name'=>__('display name','woocommerce-products-slider'),
106
+ 'user_login'=>__('user login','woocommerce-products-slider'),
107
+ 'user_nicename'=>__('user nicename','woocommerce-products-slider'),
108
+
109
+
110
+ ),
111
+ );
112
+
113
+ $settings_tabs_field->generate_field($args);
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+ $args = array(
123
+ 'id' => 'vendors_ids',
124
+ 'parent' => 'wcps_options[dokan_vendors_query]',
125
+ 'title' => __('vendor ID\'s','woocommerce-products-slider'),
126
+ 'details' => __('You can display vendors by ids.','woocommerce-products-slider'),
127
+ 'type' => 'text',
128
+ 'value' => $vendors_ids,
129
+ 'default' => '',
130
+ 'placeholder' => '1,4,2',
131
+ );
132
+
133
+ $settings_tabs_field->generate_field($args);
134
+
135
+
136
+
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+ ?>
145
+
146
+ </div>
147
+
148
+ <?php
149
+
150
+
151
+
152
+
153
+
154
+
155
+ }
156
+ }
157
+
includes/3rd-party/{functions-layout-element-dokan.php → dokan-lite/functions-layout-element.php} RENAMED
@@ -2,13 +2,6 @@
2
if ( ! defined('ABSPATH')) exit; // if direct access
3
4
5
- add_filter('wcps_slider_for_args', 'wcps_slider_for_args_dokan');
6
- function wcps_slider_for_args_dokan($args){
7
-
8
- $args['dokan_vendors'] = __('Dokan vendors', 'woocommerce-products-slider');
9
-
10
- return $args;
11
- }
12
13
14
2
if ( ! defined('ABSPATH')) exit; // if direct access
3
4
5
6
7
includes/3rd-party/easy-digital-downloads/class-metabox-wcps-hook.php ADDED
@@ -0,0 +1,300 @@
1
+ <?php
2
+ if ( ! defined('ABSPATH')) exit; // if direct access
3
+
4
+
5
+ add_filter('wcps_metabox_navs', 'wcps_metabox_navs_edd');
6
+ function wcps_metabox_navs_edd($tabs){
7
+
8
+ global $post;
9
+ $post_id = $post->ID;
10
+
11
+
12
+ $wcps_options = get_post_meta($post_id,'wcps_options', true);
13
+ $current_tab = isset($wcps_options['current_tab']) ? $wcps_options['current_tab'] : 'layouts';
14
+ $slider_for = !empty($wcps_options['slider_for']) ? $wcps_options['slider_for'] : 'products';
15
+
16
+ $tabs[] = array(
17
+ 'id' => 'query_edd_downloads',
18
+ 'title' => sprintf(__('%s Query edd downloads','woocommerce-products-slider'),'<i class="fas fa-qrcode"></i>'),
19
+ 'priority' => 3,
20
+ 'active' => ($current_tab == 'query_edd_downloads') ? true : false,
21
+ 'data_visible' => 'edd_downloads',
22
+ 'hidden' => ($slider_for == 'products')? true : false || ($slider_for == 'orders')? true : false || ($slider_for == 'categories')? true : false || ($slider_for == 'dokan_vendors')? true : false,
23
+ );
24
+ return $tabs;
25
+ }
26
+
27
+
28
+
29
+ add_filter('wcps_slider_for_args', 'wcps_slider_for_args_edd');
30
+ function wcps_slider_for_args_edd($args){
31
+
32
+ $args['edd_downloads'] = __('EDD downloads', 'woocommerce-products-slider');
33
+
34
+ return $args;
35
+ }
36
+
37
+
38
+
39
+ add_action('wcps_metabox_content_query_edd_downloads', 'wcps_metabox_content_query_edd_downloads');
40
+
41
+ if(!function_exists('wcps_metabox_content_query_edd_downloads')) {
42
+ function wcps_metabox_content_query_edd_downloads($post_id){
43
+
44
+ $settings_tabs_field = new settings_tabs_field();
45
+
46
+ $wcps_options = get_post_meta( $post_id, 'wcps_options', true );
47
+ $downloads_query = !empty($wcps_options['edd_downloads_query']) ? $wcps_options['edd_downloads_query'] : array();
48
+
49
+ $posts_per_page = isset($downloads_query['posts_per_page']) ? $downloads_query['posts_per_page'] : 10;
50
+ $query_order = isset($downloads_query['order']) ? $downloads_query['order'] : 'DESC';
51
+ $query_orderby = isset($downloads_query['orderby']) ? $downloads_query['orderby'] : 'ID';
52
+
53
+ $taxonomies = !empty($downloads_query['taxonomies']) ? $downloads_query['taxonomies'] : array();
54
+ $taxonomy_relation = !empty($downloads_query['taxonomy_relation']) ? $downloads_query['taxonomy_relation'] : 'OR';
55
+
56
+ $post_ids = isset($downloads_query['post_ids']) ? $downloads_query['post_ids'] : '';
57
+
58
+ //var_dump($taxonomies);
59
+
60
+
61
+ ?>
62
+ <div class="section">
63
+ <div class="section-title">Query edd downloads</div>
64
+ <p class="description section-description">Setup edd downloads query settings.</p>
65
+
66
+
67
+ <?php
68
+
69
+ $args = array(
70
+ 'id' => 'posts_per_page',
71
+ 'parent' => 'wcps_options[edd_downloads_query]',
72
+ 'title' => __('Max number of download','woocommerce-products-slider'),
73
+ 'details' => __('Set custom number you want to display maximum number of download','woocommerce-products-slider'),
74
+ 'type' => 'text',
75
+ 'value' => $posts_per_page,
76
+ 'default' => '10',
77
+ 'placeholder' => '10',
78
+ );
79
+
80
+ $settings_tabs_field->generate_field($args);
81
+
82
+
83
+
84
+ $wcps_allowed_taxonomies = apply_filters('wcps_allowed_taxonomies', array('download_category', 'download_tag'));
85
+
86
+ ob_start();
87
+
88
+
89
+ $post_types = array('download');
90
+ $post_taxonomies = array();
91
+
92
+ $post_taxonomies = get_object_taxonomies( $post_types );
93
+
94
+ if(!empty($post_taxonomies)){
95
+
96
+ ?>
97
+
98
+ <div class="expandable sortable">
99
+
100
+ <?php
101
+
102
+ foreach ($post_taxonomies as $taxonomy ) {
103
+
104
+ $terms = isset($taxonomies[$taxonomy]['terms']) ? $taxonomies[$taxonomy]['terms'] : array();
105
+ $terms_relation = isset($taxonomies[$taxonomy]['terms_relation']) ? $taxonomies[$taxonomy]['terms_relation'] : 'IN';
106
+
107
+ if(!in_array($taxonomy, $wcps_allowed_taxonomies)) continue;
108
+ //if($taxonomy != 'product_cat' && $taxonomy != 'product_tag') continue;
109
+
110
+ $the_taxonomy = get_taxonomy($taxonomy);
111
+ $args=array('orderby' => 'name', 'order' => 'ASC', 'taxonomy' => $taxonomy, 'hide_empty' => false);
112
+ $categories_all = get_categories($args);
113
+
114
+
115
+
116
+ ?>
117
+ <div class="item">
118
+ <div class="element-title header ">
119
+ <span class="expand"><i class="fas fa-expand"></i><i class="fas fa-compress"></i></span>
120
+ <?php
121
+ if(!empty($terms)):
122
+ ?><i class="fas fa-check"></i><?php
123
+ else:
124
+ ?><i class="fas fa-times"></i><?php
125
+ endif;?>
126
+ <span class="expand"><?php echo $the_taxonomy->labels->name; ?> - <?php echo $taxonomy; ?></span>
127
+
128
+ </div>
129
+ <div class="element-options options">
130
+
131
+ <?php
132
+ $term_list = array();
133
+ foreach($categories_all as $category_info){
134
+ $term_list[$category_info->cat_ID] = $category_info->cat_name.'('.$category_info->count.')';
135
+ }
136
+
137
+
138
+
139
+
140
+ $args = array(
141
+ 'id' => 'terms',
142
+ 'parent' => 'wcps_options[edd_downloads_query][taxonomies]['.$taxonomy.']',
143
+ 'title' => __('Select terms','woocommerce-products-slider'),
144
+ 'details' => __('Choose some terms.','woocommerce-products-slider'),
145
+ 'type' => 'select',
146
+ 'multiple' => true,
147
+ 'value' => $terms,
148
+ 'args' => $term_list,
149
+ 'default' => array(),
150
+ );
151
+
152
+ $settings_tabs_field->generate_field($args);
153
+
154
+ $args = array(
155
+ 'id' => 'terms_relation',
156
+ 'css_id' => $taxonomy.'_terms_relation',
157
+ 'parent' => 'wcps_options[edd_downloads_query][taxonomies]['.$taxonomy.']',
158
+ 'title' => __('Terms relation','post-grid'),
159
+ 'details' => __('Choose term relation.','post-grid'),
160
+ 'type' => 'radio',
161
+ 'value' => $terms_relation,
162
+ 'default' => 'IN',
163
+ 'args' => array(
164
+ 'IN'=>__('IN','post-grid'),
165
+ 'NOT IN'=>__('NOT IN','post-grid'),
166
+ 'AND'=>__('AND','post-grid'),
167
+ 'EXISTS'=>__('EXISTS','post-grid'),
168
+ 'NOT EXISTS'=>__('NOT EXISTS','post-grid'),
169
+ ),
170
+ );
171
+
172
+ $settings_tabs_field->generate_field($args, $post_id);
173
+
174
+
175
+ ?>
176
+
177
+ </div>
178
+ </div>
179
+ <?php
180
+
181
+
182
+
183
+
184
+
185
+
186
+ }
187
+
188
+ ?>
189
+ </div>
190
+ <?php
191
+
192
+ }
193
+ else{
194
+ echo 'No categories found.';
195
+ }
196
+
197
+
198
+
199
+ $html = ob_get_clean();
200
+ $args = array(
201
+ 'id' => 'wcps_categories',
202
+ 'title' => __('Download taxonomy & terms', 'woocommerce-products-slider'),
203
+ 'details' => __('Choose download taxonomy & terms. click to expand and see there is categories or terms you can select.', 'woocommerce-products-slider'),
204
+ 'type' => 'custom_html',
205
+ 'html' => $html,
206
+ );
207
+ $settings_tabs_field->generate_field($args);
208
+
209
+ $args = array(
210
+ 'id' => 'taxonomy_relation',
211
+ 'parent' => 'wcps_options[edd_downloads_query]',
212
+ 'title' => __('Taxonomy relation','woocommerce-products-slider'),
213
+ 'details' => __('Set taxonomy relation.','woocommerce-products-slider'),
214
+ 'type' => 'radio',
215
+ 'value' => $taxonomy_relation,
216
+ 'default' => 'OR',
217
+ 'args' => array(
218
+ 'OR'=>__('OR','post-grid'),
219
+ 'AND'=>__('AND','post-grid'),
220
+ ),
221
+ );
222
+
223
+ $settings_tabs_field->generate_field($args);
224
+
225
+ $args = array(
226
+ 'id' => 'order',
227
+ 'parent' => 'wcps_options[edd_downloads_query]',
228
+ 'title' => __('Query order','woocommerce-products-slider'),
229
+ 'details' => __('Set query order.','woocommerce-products-slider'),
230
+ 'type' => 'select',
231
+ 'value' => $query_order,
232
+ 'default' => 'DESC',
233
+ 'args' => array(
234
+ 'DESC'=>__('Descending','woocommerce-products-slider'),
235
+ 'ASC'=>__('Ascending','woocommerce-products-slider'),
236
+ ),
237
+ );
238
+
239
+ $settings_tabs_field->generate_field($args);
240
+
241
+
242
+ $args = array(
243
+ 'id' => 'orderby',
244
+ 'parent' => 'wcps_options[edd_downloads_query]',
245
+ 'title' => __('Query orderby','woocommerce-products-slider'),
246
+ 'details' => __('Set query orderby.','woocommerce-products-slider'),
247
+ 'type' => 'select',
248
+ 'value' => $query_orderby,
249
+ 'default' => 'DESC',
250
+ 'args' => array(
251
+ 'ID'=>__('ID','woocommerce-products-slider'),
252
+ 'display_name'=>__('display name','woocommerce-products-slider'),
253
+ 'user_login'=>__('user login','woocommerce-products-slider'),
254
+ 'user_nicename'=>__('user nicename','woocommerce-products-slider'),
255
+
256
+
257
+ ),
258
+ );
259
+
260
+ $settings_tabs_field->generate_field($args);
261
+
262
+
263
+
264
+
265
+
266
+
267
+
268
+
269
+ $args = array(
270
+ 'id' => 'post_ids',
271
+ 'parent' => 'wcps_options[edd_downloads_query]',
272
+ 'title' => __('Download ID\'s','woocommerce-products-slider'),
273
+ 'details' => __('You can display download by ids.','woocommerce-products-slider'),
274
+ 'type' => 'text',
275
+ 'value' => $post_ids,
276
+ 'default' => '',
277
+ 'placeholder' => '1,4,2',
278
+ );
279
+
280
+ $settings_tabs_field->generate_field($args);
281
+
282
+
283
+
284
+
285
+
286
+
287
+ ?>
288
+
289
+ </div>
290
+
291
+ <?php
292
+
293
+
294
+
295
+
296
+
297
+
298
+ }
299
+ }
300
+
includes/3rd-party/easy-digital-downloads/functions-layout-element.php ADDED
@@ -0,0 +1,1547 @@
1
+ <?php
2
+ if ( ! defined('ABSPATH')) exit; // if direct access
3
+
4
+ add_filter('wcps_layout_elements', 'wcps_layout_elements_edd');
5
+ function wcps_layout_elements_edd($elements){
6
+
7
+ $elements['edd_post_title'] = array('name' =>__('Download post title','woocommerce-products-slider'));
8
+
9
+ $elements['edd_price'] = array('name' =>__('EDD price','woocommerce-products-slider'));
10
+ // $elements['edd_variable_prices'] = array('name' =>__('EDD variable prices','woocommerce-products-slider'));
11
+ // $elements['edd_sales_stats'] = array('name' =>__('EDD sales stats','woocommerce-products-slider'));
12
+ // $elements['edd_earnings_stats'] = array('name' =>__('EDD earnings stats','woocommerce-products-slider'));
13
+ $elements['edd_add_to_cart'] = array('name' =>__('EDD add to cart','woocommerce-products-slider'));
14
+ $elements['edd_categories'] = array('name' =>__('EDD categories','woocommerce-products-slider'));
15
+ $elements['edd_tags'] = array('name' =>__('EDD tags','woocommerce-products-slider'));
16
+
17
+
18
+ return $elements;
19
+ }
20
+
21
+
22
+
23
+
24
+ add_action('wcps_layout_element_edd_post_title', 'wcps_layout_element_edd_post_title', 10);
25
+ function wcps_layout_element_edd_post_title($args){
26
+
27
+ //echo '<pre>'.var_export($args, true).'</pre>';
28
+ $post_id = isset($args['post_id']) ? $args['post_id'] : wcps_get_first_post('download');
29
+ $elementData = isset($args['elementData']) ? $args['elementData'] : array();
30
+ $element_index = isset($args['element_index']) ? $args['element_index'] : '';
31
+
32
+ $link_to = isset($elementData['link_to']) ? $elementData['link_to'] : '';
33
+
34
+
35
+ $post_data = get_post($post_id);
36
+ $post_title = isset($post_data->post_title) ? $post_data->post_title : '';
37
+
38
+ $element_class = !empty($element_index) ? 'element-post-title element-'.$element_index : 'element-post-title';
39
+
40
+ if($link_to == 'post_link'):
41
+ $post_title = '<a href="'.get_permalink($post_id).'">'.$post_title.'</a>';
42
+ endif;
43
+
44
+ ?>
45
+ <div class="<?php echo $element_class; ?>"><?php echo $post_title; ?></div>
46
+ <?php
47
+
48
+ }
49
+
50
+
51
+
52
+ add_action('wcps_layout_element_edd_add_to_cart', 'wcps_layout_element_edd_add_to_cart', 10);
53
+ function wcps_layout_element_edd_add_to_cart($args){
54
+
55
+ //echo '<pre>'.var_export($args, true).'</pre>';
56
+ $post_id = isset($args['post_id']) ? $args['post_id'] : wcps_get_first_post('download');
57
+ $elementData = isset($args['elementData']) ? $args['elementData'] : array();
58
+ $element_index = isset($args['element_index']) ? $args['element_index'] : '';
59
+
60
+
61
+ $element_class = !empty($element_index) ? 'element-post-title element-'.$element_index : 'element-post-title';
62
+
63
+ $purchase_link = do_shortcode('[purchase_link id="'.$post_id.'" text="'.__('Add to Cart','post-grid').'" style="button"]' );
64
+
65
+
66
+
67
+ ?>
68
+ <div class="<?php echo $element_class; ?>"><?php echo $purchase_link; ?></div>
69
+ <?php
70
+
71
+ }
72
+
73
+
74
+
75
+
76
+ add_action('wcps_layout_element_edd_price', 'wcps_layout_element_edd_price', 10);
77
+ function wcps_layout_element_edd_price($args){
78
+
79
+ //echo '<pre>'.var_export($args, true).'</pre>';
80
+ $post_id = isset($args['post_id']) ? $args['post_id'] : wcps_get_first_post('download');
81
+ $element_data = isset($args['elementData']) ? $args['elementData'] : array();
82
+ $element_index = isset($args['element_index']) ? $args['element_index'] : '';
83
+
84
+ $wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
85
+ $wrapper_html = !empty($wrapper_html) ? $wrapper_html : '%s';
86
+
87
+ $element_class = !empty($element_index) ? 'element-custom_text element-'.$element_index : 'element-custom_text';
88
+
89
+ $variable_prices = edd_get_variable_prices( $post_id );
90
+ $edd_prices_html = '';
91
+
92
+ if( $variable_prices ) {
93
+ $currency = edd_get_currency();
94
+
95
+
96
+
97
+ $edd_prices_html.= '<ul>';
98
+ foreach( $variable_prices as $price_id => $price ) {
99
+ $edd_prices_html.= '<li>'.$price['name'].': '.$currency.' '.$price['amount'].'</li>';; //is the name of the price
100
+
101
+ }
102
+ $edd_prices_html.= '</ul>';
103
+
104
+ }else{
105
+ $edd_prices_html = edd_price($post_id,false);
106
+
107
+ }
108
+
109
+ ?>
110
+ <div class="<?php echo $element_class; ?>"><?php echo sprintf($wrapper_html, $edd_prices_html); ?></div>
111
+ <?php
112
+
113
+ }
114
+
115
+
116
+
117
+ add_action('wcps_layout_element_edd_variable_prices', 'wcps_layout_element_edd_variable_prices', 10);
118
+ function wcps_layout_element_edd_variable_prices($args){
119
+
120
+ //echo '<pre>'.var_export($args, true).'</pre>';
121
+ $post_id = isset($args['post_id']) ? $args['post_id'] : wcps_get_first_post('download');
122
+ $element_data = isset($args['elementData']) ? $args['elementData'] : array();
123
+ $element_index = isset($args['element_index']) ? $args['element_index'] : '';
124
+
125
+ $wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
126
+ $wrapper_html = !empty($wrapper_html) ? $wrapper_html : '%s';
127
+
128
+ $element_class = !empty($element_index) ? 'element-custom_text element-'.$element_index : 'element-custom_text';
129
+
130
+ $currency = edd_get_currency();
131
+ $prices = edd_get_variable_prices( $post_id );
132
+
133
+ if( $prices ) {
134
+ $edd_variable_prices_html = '';
135
+ $edd_variable_prices_html.= '<ul>';
136
+ foreach( $prices as $price_id => $price ) {
137
+ $edd_variable_prices_html.= '<li>'.$price['name'].': '.$currency.' '.$price['amount'].'</li>';; //is the name of the price
138
+
139
+ }
140
+ $edd_variable_prices_html.= '</ul>';
141
+
142
+ }
143
+
144
+ ?>
145
+ <div class="<?php echo $element_class; ?>"><?php echo sprintf($wrapper_html, $edd_variable_prices_html); ?></div>
146
+ <?php
147
+
148
+ }
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+ add_action('wcps_layout_element_edd_categories', 'wcps_layout_element_edd_categories', 10);
157
+ function wcps_layout_element_edd_categories($args){
158
+
159
+ //echo '<pre>'.var_export($args, true).'</pre>';
160
+ $post_id = isset($args['post_id']) ? $args['post_id'] : wcps_get_first_post('download');
161
+ $element_data = isset($args['elementData']) ? $args['elementData'] : array();
162
+ $element_index = isset($args['element_index']) ? $args['element_index'] : '';
163
+
164
+ $wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
165
+ $wrapper_html = !empty($wrapper_html) ? $wrapper_html : '%s';
166
+
167
+ $element_class = !empty($element_index) ? 'element-custom_text element-'.$element_index : 'element-custom_text';
168
+
169
+ $term_list = wp_get_post_terms($post_id, 'download_category', array("fields" => "all"));
170
+ $term_count = count($term_list);
171
+
172
+
173
+ $edd_categories_html = '';
174
+ $i = 1;
175
+ if( !empty($term_list) ) {
176
+ foreach( $term_list as $term ) {
177
+ $edd_categories_html.= '<a href="#">'.$term->name.'</a>'; //is the name of the price
178
+ if( $i < $term_count){
179
+ $edd_categories_html .= ', ';
180
+ }
181
+ $i++;
182
+ }
183
+ }
184
+ ?>
185
+ <div class="<?php echo $element_class; ?>"><?php echo sprintf($wrapper_html, $edd_categories_html); ?></div>
186
+ <?php
187
+
188
+ }
189
+
190
+
191
+
192
+ add_action('wcps_layout_element_edd_tags', 'wcps_layout_element_edd_tags', 10);
193
+ function wcps_layout_element_edd_tags($args){
194
+
195
+ //echo '<pre>'.var_export($args, true).'</pre>';
196
+ $post_id = isset($args['post_id']) ? $args['post_id'] : wcps_get_first_post('download');
197
+ $element_data = isset($args['elementData']) ? $args['elementData'] : array();
198
+ $element_index = isset($args['element_index']) ? $args['element_index'] : '';
199
+
200
+ $wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
201
+ $wrapper_html = !empty($wrapper_html) ? $wrapper_html : '%s';
202
+
203
+ $element_class = !empty($element_index) ? 'element-custom_text element-'.$element_index : 'element-custom_text';
204
+
205
+ $term_list = wp_get_post_terms($post_id, 'download_tag', array("fields" => "all"));
206
+ $term_count = count($term_list);
207
+
208
+
209
+ $edd_categories_html = '';
210
+ $i = 1;
211
+ if( !empty($term_list) ) {
212
+ foreach( $term_list as $term ) {
213
+ $edd_categories_html.= '<a href="#">'.$term->name.'</a>'; //is the name of the price
214
+ if( $i < $term_count){
215
+ $edd_categories_html .= ', ';
216
+ }
217
+ $i++;
218
+ }
219
+ }
220
+ ?>
221
+ <div class="<?php echo $element_class; ?>"><?php echo sprintf($wrapper_html, $edd_categories_html); ?></div>
222
+ <?php
223
+
224
+ }
225
+
226
+
227
+
228
+
229
+ add_action('wcps_layout_element_css_edd_post_title', 'wcps_layout_element_css_edd_post_title', 10);
230
+ function wcps_layout_element_css_edd_post_title($args){
231
+
232
+
233
+ $element_index = isset($args['element_index']) ? $args['element_index'] : '';
234
+ $elementData = isset($args['elementData']) ? $args['elementData'] : array();
235
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
236
+
237
+ $color = isset($elementData['color']) ? $elementData['color'] : '';
238
+ $font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
239
+ $font_family = isset($elementData['font_family']) ? $elementData['font_family'] : '';
240
+ $margin = isset($elementData['margin']) ? $elementData['margin'] : '';
241
+ $text_align = isset($elementData['text_align']) ? $elementData['text_align'] : '';
242
+
243
+
244
+ //echo '<pre>'.var_export($layout_id, true).'</pre>';
245
+
246
+ ?>
247
+ <style type="text/css">
248
+ .layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
249
+ <?php if(!empty($color)): ?>
250
+ color: <?php echo $color; ?>;
251
+ <?php endif; ?>
252
+ <?php if(!empty($margin)): ?>
253
+ margin: <?php echo $margin; ?>;
254
+ <?php endif; ?>
255
+ <?php if(!empty($text_align)): ?>
256
+ text-align: <?php echo $text_align; ?>;
257
+ <?php endif; ?>
258
+ <?php if(!empty($color)): ?>
259
+ color: <?php echo $color; ?>;
260
+ <?php endif; ?>
261
+ <?php if(!empty($font_size)): ?>
262
+ font-size: <?php echo $font_size; ?>;
263
+ <?php endif; ?>
264
+ <?php if(!empty($font_family)): ?>
265
+ font-family: <?php echo $font_family; ?>;
266
+ <?php endif; ?>
267
+ }
268
+ .layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?> a{
269
+ <?php if(!empty($color)): ?>
270
+ color: <?php echo $color; ?>;
271
+ <?php endif; ?>
272
+ <?php if(!empty($font_size)): ?>
273
+ font-size: <?php echo $font_size; ?>;
274
+ <?php endif; ?>
275
+ <?php if(!empty($font_family)): ?>
276
+ font-family: <?php echo $font_family; ?>;
277
+ <?php endif; ?>
278
+ }
279
+
280
+
281
+ </style>
282
+ <?php
283
+ }
284
+
285
+
286
+
287
+ add_action('wcps_layout_element_css_edd_price', 'wcps_layout_element_css_edd_price', 10);
288
+ function wcps_layout_element_css_edd_price($args){
289
+
290
+
291
+ $element_index = isset($args['element_index']) ? $args['element_index'] : '';
292
+ $elementData = isset($args['elementData']) ? $args['elementData'] : array();
293
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
294
+
295
+ $color = isset($elementData['color']) ? $elementData['color'] : '';
296
+ $font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
297
+ $font_family = isset($elementData['font_family']) ? $elementData['font_family'] : '';
298
+ $margin = isset($elementData['margin']) ? $elementData['margin'] : '';
299
+ $text_align = isset($elementData['text_align']) ? $elementData['text_align'] : '';
300
+
301
+ ?>
302
+ <style type="text/css">
303
+ .layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
304
+ <?php if(!empty($color)): ?>
305
+ color: <?php echo $color; ?>;
306
+ <?php endif; ?>
307
+ <?php if(!empty($font_size)): ?>
308
+ font-size: <?php echo $font_size; ?>;
309
+ <?php endif; ?>
310
+ <?php if(!empty($font_family)): ?>
311
+ font-family: <?php echo $font_family; ?>;
312
+ <?php endif; ?>
313
+ <?php if(!empty($margin)): ?>
314
+ margin: <?php echo $margin; ?>;
315
+ <?php endif; ?>
316
+ <?php if(!empty($text_align)): ?>
317
+ text-align: <?php echo $text_align; ?>;
318
+ <?php endif; ?>
319
+ }
320
+ </style>
321
+ <?php
322
+ }
323
+
324
+
325
+ add_action('wcps_layout_element_css_edd_add_to_cart', 'wcps_layout_element_css_edd_add_to_cart', 10);
326
+ function wcps_layout_element_css_edd_add_to_cart($args){
327
+
328
+
329
+ $element_index = isset($args['element_index']) ? $args['element_index'] : '';
330
+ $elementData = isset($args['elementData']) ? $args['elementData'] : array();
331
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
332
+
333
+ $color = isset($elementData['color']) ? $elementData['color'] : '';
334
+ $font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
335
+ $font_family = isset($elementData['font_family']) ? $elementData['font_family'] : '';
336
+ $margin = isset($elementData['margin']) ? $elementData['margin'] : '';
337
+ $text_align = isset($elementData['text_align']) ? $elementData['text_align'] : '';
338
+
339
+ ?>
340
+ <style type="text/css">
341
+ .layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
342
+ <?php if(!empty($color)): ?>
343
+ color: <?php echo $color; ?>;
344
+ <?php endif; ?>
345
+ <?php if(!empty($font_size)): ?>
346
+ font-size: <?php echo $font_size; ?>;
347
+ <?php endif; ?>
348
+ <?php if(!empty($font_family)): ?>
349
+ font-family: <?php echo $font_family; ?>;
350
+ <?php endif; ?>
351
+ <?php if(!empty($margin)): ?>
352
+ margin: <?php echo $margin; ?>;
353
+ <?php endif; ?>
354
+ <?php if(!empty($text_align)): ?>
355
+ text-align: <?php echo $text_align; ?>;
356
+ <?php endif; ?>
357
+ }
358
+ .layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?> a{
359
+ <?php if(!empty($color)): ?>
360
+ color: <?php echo $color; ?>;
361
+ <?php endif; ?>
362
+ <?php if(!empty($font_size)): ?>
363
+ font-size: <?php echo $font_size; ?>;
364
+ <?php endif; ?>
365
+ <?php if(!empty($font_family)): ?>
366
+ font-family: <?php echo $font_family; ?>;
367
+ <?php endif; ?>
368
+ }
369
+ </style>
370
+ <?php
371
+ }
372
+
373
+
374
+
375
+
376
+
377
+ add_action('wcps_layout_element_css_edd_categories', 'wcps_layout_element_css_edd_categories', 10);
378
+ function wcps_layout_element_css_edd_categories($args){
379
+
380
+
381
+ $element_index = isset($args['element_index']) ? $args['element_index'] : '';
382
+ $elementData = isset($args['elementData']) ? $args['elementData'] : array();
383
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
384
+
385
+ $color = isset($elementData['color']) ? $elementData['color'] : '';
386
+ $font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
387
+ $font_family = isset($elementData['font_family']) ? $elementData['font_family'] : '';
388
+ $margin = isset($elementData['margin']) ? $elementData['margin'] : '';
389
+ $text_align = isset($elementData['text_align']) ? $elementData['text_align'] : '';
390
+
391
+ ?>
392
+ <style type="text/css">
393
+ .layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
394
+ <?php if(!empty($margin)): ?>
395
+ margin: <?php echo $margin; ?>;
396
+ <?php endif; ?>
397
+ <?php if(!empty($text_align)): ?>
398
+ text-align: <?php echo $text_align; ?>;
399
+ <?php endif; ?>
400
+ }
401
+ .layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?> a{
402
+ <?php if(!empty($color)): ?>
403
+ color: <?php echo $color; ?>;
404
+ <?php endif; ?>
405
+ <?php if(!empty($font_size)): ?>
406
+ font-size: <?php echo $font_size; ?>;
407
+ <?php endif; ?>
408
+ <?php if(!empty($font_family)): ?>
409
+ font-family: <?php echo $font_family; ?>;
410
+ <?php endif; ?>
411
+ }
412
+ </style>
413
+ <?php
414
+ }
415
+
416
+
417
+
418
+
419
+ add_action('wcps_layout_element_css_edd_tags', 'wcps_layout_element_css_edd_tags', 10);
420
+ function wcps_layout_element_css_edd_tags($args){
421
+
422
+
423
+ $element_index = isset($args['element_index']) ? $args['element_index'] : '';
424
+ $elementData = isset($args['elementData']) ? $args['elementData'] : array();
425
+ $layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
426
+
427
+ $color = isset($elementData['color']) ? $elementData['color'] : '';
428
+ $font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
429
+ $font_family = isset($elementData['font_family']) ? $elementData['font_family'] : '';
430
+ $margin = isset($elementData['margin']) ? $elementData['margin'] : '';
431
+ $text_align = isset($elementData['text_align']) ? $elementData['text_align'] : '';
432
+
433
+ ?>
434
+ <style type="text/css">
435
+ .layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
436
+ <?php if(!empty($margin)): ?>
437
+ margin: <?php echo $margin; ?>;
438
+ <?php endif; ?>
439
+ <?php if(!empty($text_align)): ?>
440
+ text-align: <?php echo $text_align; ?>;
441
+ <?php endif; ?>
442
+ }
443
+ .layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?> a{
444
+ <?php if(!empty($color)): ?>
445
+ color: <?php echo $color; ?>;
446
+ <?php endif; ?>
447
+ <?php if(!empty($font_size)): ?>
448
+ font-size: <?php echo $font_size; ?>;
449
+ <?php endif; ?>
450
+ <?php if(!empty($font_family)): ?>
451
+ font-family: <?php echo $font_family; ?>;
452
+ <?php endif; ?>
453
+ }
454
+ </style>
455
+ <?php
456
+ }
457
+
458
+
459
+
460
+
461
+
462
+
463
+
464
+
465
+
466
+
467
+
468
+ add_action('wcps_layout_elements_option_edd_post_title','wcps_layout_elements_option_edd_post_title');
469
+
470
+
471
+ function wcps_layout_elements_option_edd_post_title($parameters){
472
+
473
+ $settings_tabs_field = new settings_tabs_field();
474
+
475
+ $input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
476
+ $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
477
+ $element_index = isset($parameters['index']) ? $parameters['index'] : '';
478
+
479
+
480
+ $color = isset($element_data['color']) ? $element_data['color'] : '';
481
+ $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
482
+ $font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
483
+ $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
484
+ $link_to = isset($element_data['link_to']) ? $element_data['link_to'] : '';
485
+ $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
486
+
487
+ $custom_css = isset($element_data['custom_css']) ? $element_data['custom_css'] : '';
488
+ $custom_css_hover = isset($element_data['custom_css_hover']) ? $element_data['custom_css_hover'] : '';
489
+
490
+
491
+
492
+ ?>
493
+ <div class="item">
494
+ <div class="element-title header ">
495
+ <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
496
+ <span class="sort"><i class="fas fa-sort"></i></span>
497
+
498
+ <span class="expand"><?php echo __('Download title','woocommerce-products-slider'); ?></span>
499
+ </div>
500
+ <div class="element-options options">
501
+
502
+ <?php
503
+
504
+ $args = array(
505
+ 'id' => 'color',
506
+ 'css_id' => $element_index.'_color',
507
+ 'parent' => $input_name.'[edd_post_title]',
508
+ 'title' => __('Color','woocommerce-products-slider'),
509
+ 'details' => __('Title text color.','woocommerce-products-slider'),
510
+ 'type' => 'colorpicker',
511
+ 'value' => $color,
512
+ 'default' => '',
513
+ );
514
+
515
+ $settings_tabs_field->generate_field($args);
516
+
517
+ $args = array(
518
+ 'id' => 'font_size',
519
+ 'css_id' => $element_index.'_font_size',
520
+ 'parent' => $input_name.'[edd_post_title]',
521
+ 'title' => __('Font size','woocommerce-products-slider'),
522
+ 'details' => __('Set font size.','woocommerce-products-slider'),
523
+ 'type' => 'text',
524
+ 'value' => $font_size,
525
+ 'default' => '',
526
+ 'placeholder' => '14px',
527
+ );
528
+
529
+ $settings_tabs_field->generate_field($args);
530
+
531
+
532
+ $args = array(
533
+ 'id' => 'font_family',
534
+ 'css_id' => $element_index.'_font_family',
535
+ 'parent' => $input_name.'[edd_post_title]',
536
+ 'title' => __('Font family','woocommerce-products-slider'),
537
+ 'details' => __('Set font family.','woocommerce-products-slider'),
538
+ 'type' => 'text',
539
+ 'value' => $font_family,
540
+ 'default' => '',
541
+ 'placeholder' => 'Open Sans',
542
+ );
543
+
544
+ $settings_tabs_field->generate_field($args);
545
+
546
+
547
+ $args = array(
548
+ 'id' => 'margin',
549
+ 'css_id' => $element_index.'_margin',
550
+ 'parent' => $input_name.'[edd_post_title]',
551
+ 'title' => __('Margin','woocommerce-products-slider'),
552
+ 'details' => __('Set margin.','woocommerce-products-slider'),
553
+ 'type' => 'text',
554
+ 'value' => $margin,
555
+ 'default' => '',
556
+ 'placeholder' => '5px 0',
557
+ );
558
+
559
+ $settings_tabs_field->generate_field($args);
560
+
561
+
562
+ $args = array(
563
+ 'id' => 'text_align',
564
+ 'css_id' => $element_index.'_text_align',
565
+ 'parent' => $input_name.'[edd_post_title]',
566
+ 'title' => __('Text align','woocommerce-products-slider'),
567
+ 'details' => __('Choose text align.','woocommerce-products-slider'),
568
+ 'type' => 'select',
569
+ 'value' => $text_align,
570
+ 'default' => 'left',
571
+ 'args' => array('left'=> __('Left', 'woocommerce-products-slider'),'right'=> __('Right', 'woocommerce-products-slider'),'center'=> __('Center', 'woocommerce-products-slider') ),
572
+ );
573
+
574
+ $settings_tabs_field->generate_field($args);
575
+
576
+
577
+ $args = array(
578
+ 'id' => 'link_to',
579
+ 'css_id' => $element_index.'_link_to',
580
+ 'parent' => $input_name.'[edd_post_title]',
581
+ 'title' => __('Link to','woocommerce-products-slider'),
582
+ 'details' => __('Choose option to link product.','woocommerce-products-slider'),
583
+ 'type' => 'select',
584
+ 'value' => $link_to,
585
+ 'default' => 'product_link',
586
+ 'args' => array(
587
+ 'none'=> __('None', 'woocommerce-products-slider'),
588
+ 'post_link'=> __('Download link', 'woocommerce-products-slider'),
589
+ ),
590
+ );
591
+
592
+ $settings_tabs_field->generate_field($args);
593
+
594
+
595
+
596
+
597
+ ob_start();
598
+ ?>
599
+ <textarea readonly type="text" onclick="this.select();">.element-<?php echo $element_index?>{}</textarea>
600
+ <?php
601
+
602
+ $html = ob_get_clean();
603
+
604
+ $args = array(
605
+ 'id' => 'use_css',
606
+ 'title' => __('Use of CSS','woocommerce-products-slider'),
607
+ 'details' => __('Use following class selector to add custom CSS for this element.','woocommerce-products-slider'),
608
+ 'type' => 'custom_html',
609
+ 'html' => $html,
610
+
611
+ );
612
+
613
+ $settings_tabs_field->generate_field($args);
614
+
615
+ ?>
616
+
617
+ </div>
618
+ </div>
619
+ <?php
620
+
621
+ }
622
+
623
+
624
+
625
+
626
+
627
+ add_action('wcps_layout_elements_option_edd_price','wcps_layout_elements_option_edd_price');
628
+
629
+
630
+ function wcps_layout_elements_option_edd_price($parameters){
631
+
632
+ $settings_tabs_field = new settings_tabs_field();
633
+
634
+ $input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
635
+ $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
636
+ $element_index = isset($parameters['index']) ? $parameters['index'] : '';
637
+
638
+ $wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
639
+
640
+ $color = isset($element_data['color']) ? $element_data['color'] : '';
641
+ $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
642
+ $font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
643
+ $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
644
+ $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
645
+
646
+ $custom_css = isset($element_data['custom_css']) ? $element_data['custom_css'] : '';
647
+ $custom_css_hover = isset($element_data['custom_css_hover']) ? $element_data['custom_css_hover'] : '';
648
+
649
+
650
+
651
+ ?>
652
+ <div class="item">
653
+ <div class="element-title header ">
654
+ <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
655
+ <span class="sort"><i class="fas fa-sort"></i></span>
656
+
657
+ <span class="expand"><?php echo __('EDD price','woocommerce-products-slider'); ?></span>
658
+ </div>
659
+ <div class="element-options options">
660
+
661
+ <?php
662
+
663
+ $args = array(
664
+ 'id' => 'wrapper_html',
665
+ 'css_id' => $element_index.'_wrapper_html',
666
+ 'parent' => $input_name.'[edd_price]',
667
+ 'title' => __('Wrapper html','woocommerce-products-slider'),
668
+ 'details' => __('Set font wrapper html. ex: Price %s','woocommerce-products-slider'),
669
+ 'type' => 'text',
670
+ 'value' => $wrapper_html,
671
+ 'default' => '',
672
+ 'placeholder' => '',
673
+ );
674
+
675
+ $settings_tabs_field->generate_field($args);
676
+
677
+ $args = array(
678
+ 'id' => 'color',
679
+ 'css_id' => $element_index.'_edd_price',
680
+ 'parent' => $input_name.'[edd_price]',
681
+ 'title' => __('Color','woocommerce-products-slider'),
682
+ 'details' => __('Title text color.','woocommerce-products-slider'),
683
+ 'type' => 'colorpicker',
684
+ 'value' => $color,
685
+ 'default' => '',
686
+ );
687
+
688
+ $settings_tabs_field->generate_field($args);
689
+
690
+ $args = array(
691
+ 'id' => 'font_size',
692
+ 'css_id' => $element_index.'_font_size',
693
+ 'parent' => $input_name.'[edd_price]',
694
+ 'title' => __('Font size','woocommerce-products-slider'),
695
+ 'details' => __('Set font size.','woocommerce-products-slider'),
696
+ 'type' => 'text',
697
+ 'value' => $font_size,
698
+ 'default' => '',
699
+ 'placeholder' => '14px',
700
+ );
701
+
702
+ $settings_tabs_field->generate_field($args);
703
+
704
+
705
+ $args = array(
706
+ 'id' => 'font_family',
707
+ 'css_id' => $element_index.'_font_family',
708
+ 'parent' => $input_name.'[edd_price]',
709
+ 'title' => __('Font family','woocommerce-products-slider'),
710
+ 'details' => __('Set font family.','woocommerce-products-slider'),
711
+ 'type' => 'text',
712
+ 'value' => $font_family,
713
+ 'default' => '',
714
+ 'placeholder' => 'Open Sans',
715
+ );
716
+
717
+ $settings_tabs_field->generate_field($args);
718
+
719
+
720
+ $args = array(
721
+ 'id' => 'margin',
722
+ 'css_id' => $element_index.'_margin',
723
+ 'parent' => $input_name.'[edd_price]',
724
+ 'title' => __('Margin','woocommerce-products-slider'),
725
+ 'details' => __('Set margin.','woocommerce-products-slider'),
726
+ 'type' => 'text',
727
+ 'value' => $margin,
728
+ 'default' => '',
729
+ 'placeholder' => '5px 0',
730
+ );
731
+
732
+ $settings_tabs_field->generate_field($args);
733
+
734
+
735
+ $args = array(
736
+ 'id' => 'text_align',
737
+ 'css_id' => $element_index.'_text_align',
738
+ 'parent' => $input_name.'[edd_price]',
739
+ 'title' => __('Text align','woocommerce-products-slider'),
740
+ 'details' => __('Choose text align.','woocommerce-products-slider'),
741
+ 'type' => 'select',
742
+ 'value' => $text_align,
743
+ 'default' => 'left',
744
+ 'args' => array('left'=> __('Left', 'woocommerce-products-slider'),'right'=> __('Right', 'woocommerce-products-slider'),'center'=> __('Center', 'woocommerce-products-slider') ),
745
+ );
746
+
747
+ $settings_tabs_field->generate_field($args);
748
+
749
+
750
+
751
+
752
+ ob_start();
753
+ ?>
754
+ <textarea readonly type="text" onclick="this.select();">.element-<?php echo $element_index?>{}</textarea>
755
+ <?php
756
+
757
+ $html = ob_get_clean();
758
+
759
+ $args = array(
760
+ 'id' => 'use_css',
761
+ 'title' => __('Use of CSS','woocommerce-products-slider'),
762
+ 'details' => __('Use following class selector to add custom CSS for this element.','woocommerce-products-slider'),
763
+ 'type' => 'custom_html',
764
+ 'html' => $html,
765
+
766
+ );
767
+
768
+ $settings_tabs_field->generate_field($args);
769
+
770
+ ?>
771
+
772
+ </div>
773
+ </div>
774
+ <?php
775
+
776
+ }
777
+
778
+
779
+ add_action('wcps_layout_elements_option_edd_variable_prices','wcps_layout_elements_option_edd_variable_prices');
780
+
781
+
782
+ function wcps_layout_elements_option_edd_variable_prices($parameters){
783
+
784
+ $settings_tabs_field = new settings_tabs_field();
785
+
786
+ $input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
787
+ $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
788
+ $element_index = isset($parameters['index']) ? $parameters['index'] : '';
789
+
790
+
791
+ $color = isset($element_data['color']) ? $element_data['color'] : '';
792
+ $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
793
+ $font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
794
+ $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
795
+ $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
796
+
797
+ $wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
798
+ $wrapper_html = !empty($wrapper_html) ? $wrapper_html : '%s';
799
+
800
+ $custom_css = isset($element_data['custom_css']) ? $element_data['custom_css'] : '';
801
+ $custom_css_hover = isset($element_data['custom_css_hover']) ? $element_data['custom_css_hover'] : '';
802
+
803
+
804
+
805
+ ?>
806
+ <div class="item">
807
+ <div class="element-title header ">
808
+ <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
809
+ <span class="sort"><i class="fas fa-sort"></i></span>
810
+
811
+ <span class="expand"><?php echo __('EDD variable prices','woocommerce-products-slider'); ?></span>
812
+ </div>
813
+ <div class="element-options options">
814
+
815
+ <?php
816
+
817
+
818
+ $args = array(
819
+ 'id' => 'wrapper_html',
820
+ 'css_id' => $element_index.'_wrapper_html',
821
+ 'parent' => $input_name.'[edd_variable_prices]',
822
+ 'title' => __('Wrapper html','woocommerce-products-slider'),
823
+ 'details' => __('Set font wrapper html.','woocommerce-products-slider'),
824
+ 'type' => 'text',
825
+ 'value' => $wrapper_html,
826
+ 'default' => '',
827
+ 'placeholder' => '',
828
+ );
829
+
830
+ $settings_tabs_field->generate_field($args);
831
+
832
+ $args = array(
833
+ 'id' => 'color',
834
+ 'css_id' => $element_index.'_edd_variable_prices',
835
+ 'parent' => $input_name.'[edd_variable_prices]',
836
+ 'title' => __('Color','woocommerce-products-slider'),
837
+ 'details' => __('Title text color.','woocommerce-products-slider'),
838
+ 'type' => 'colorpicker',
839
+ 'value' => $color,
840
+ 'default' => '',
841
+ );
842
+
843
+ $settings_tabs_field->generate_field($args);
844
+
845
+ $args = array(
846
+ 'id' => 'font_size',
847
+ 'css_id' => $element_index.'_font_size',
848
+ 'parent' => $input_name.'[edd_variable_prices]',
849
+ 'title' => __('Font size','woocommerce-products-slider'),
850
+ 'details' => __('Set font size.','woocommerce-products-slider'),
851
+ 'type' => 'text',
852
+ 'value' => $font_size,
853
+ 'default' => '',
854
+ 'placeholder' => '14px',
855
+ );
856
+
857
+ $settings_tabs_field->generate_field($args);
858
+
859
+
860
+ $args = array(
861
+ 'id' => 'font_family',
862
+ 'css_id' => $element_index.'_font_family',
863
+ 'parent' => $input_name.'[edd_variable_prices]',
864
+ 'title' => __('Font family','woocommerce-products-slider'),
865
+ 'details' => __('Set font family.','woocommerce-products-slider'),
866
+ 'type' => 'text',
867
+ 'value' => $font_family,
868
+ 'default' => '',
869
+ 'placeholder' => 'Open Sans',
870
+ );
871
+
872
+ $settings_tabs_field->generate_field($args);
873
+
874
+
875
+ $args = array(
876
+ 'id' => 'margin',
877
+ 'css_id' => $element_index.'_margin',
878
+ 'parent' => $input_name.'[edd_variable_prices]',
879
+ 'title' => __('Margin','woocommerce-products-slider'),
880
+ 'details' => __('Set margin.','woocommerce-products-slider'),
881
+ 'type' => 'text',
882
+ 'value' => $margin,
883
+ 'default' => '',
884
+ 'placeholder' => '5px 0',
885
+ );
886
+
887
+ $settings_tabs_field->generate_field($args);
888
+
889
+
890
+ $args = array(
891
+ 'id' => 'text_align',
892
+ 'css_id' => $element_index.'_text_align',
893
+ 'parent' => $input_name.'[edd_variable_prices]',
894
+ 'title' => __('Text align','woocommerce-products-slider'),
895
+ 'details' => __('Choose text align.','woocommerce-products-slider'),
896
+ 'type' => 'select',
897
+ 'value' => $text_align,
898
+ 'default' => 'left',
899
+ 'args' => array('left'=> __('Left', 'woocommerce-products-slider'),'right'=> __('Right', 'woocommerce-products-slider'),'center'=> __('Center', 'woocommerce-products-slider') ),
900
+ );
901
+
902
+ $settings_tabs_field->generate_field($args);
903
+
904
+
905
+
906
+
907
+ ob_start();
908
+ ?>
909
+ <textarea readonly type="text" onclick="this.select();">.element-<?php echo $element_index?>{}</textarea>
910
+ <?php
911
+
912
+ $html = ob_get_clean();
913
+
914
+ $args = array(
915
+ 'id' => 'use_css',
916
+ 'title' => __('Use of CSS','woocommerce-products-slider'),
917
+ 'details' => __('Use following class selector to add custom CSS for this element.','woocommerce-products-slider'),
918
+ 'type' => 'custom_html',
919
+ 'html' => $html,
920
+
921
+ );
922
+
923
+ $settings_tabs_field->generate_field($args);
924
+
925
+ ?>
926
+
927
+ </div>
928
+ </div>
929
+ <?php
930
+
931
+ }
932
+
933
+
934
+
935
+ add_action('wcps_layout_elements_option_edd_sales_stats','wcps_layout_elements_option_edd_sales_stats');
936
+
937
+
938
+ function wcps_layout_elements_option_edd_sales_stats($parameters){
939
+
940
+ $settings_tabs_field = new settings_tabs_field();
941
+
942
+ $input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
943
+ $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
944
+ $element_index = isset($parameters['index']) ? $parameters['index'] : '';
945
+
946
+
947
+ $color = isset($element_data['color']) ? $element_data['color'] : '';
948
+ $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
949
+ $font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
950
+ $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
951
+ $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
952
+
953
+ $wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
954
+ $wrapper_html = !empty($wrapper_html) ? $wrapper_html : '%s';
955
+
956
+ $custom_css = isset($element_data['custom_css']) ? $element_data['custom_css'] : '';
957
+ $custom_css_hover = isset($element_data['custom_css_hover']) ? $element_data['custom_css_hover'] : '';
958
+
959
+
960
+
961
+ ?>
962
+ <div class="item">
963
+ <div class="element-title header ">
964
+ <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
965
+ <span class="sort"><i class="fas fa-sort"></i></span>
966
+
967
+ <span class="expand"><?php echo __('EDD sales stats','woocommerce-products-slider'); ?></span>
968
+ </div>
969
+ <div class="element-options options">
970
+
971
+ <?php
972
+
973
+ $args = array(
974
+ 'id' => 'wrapper_html',
975
+ 'css_id' => $element_index.'_wrapper_html',
976
+ 'parent' => $input_name.'[edd_sales_stats]',
977
+ 'title' => __('Wrapper html','woocommerce-products-slider'),
978
+ 'details' => __('Set font wrapper html.','woocommerce-products-slider'),
979
+ 'type' => 'text',
980
+ 'value' => $wrapper_html,
981
+ 'default' => '',
982
+ 'placeholder' => '',
983
+ );
984
+
985
+ $settings_tabs_field->generate_field($args);
986
+
987
+
988
+ $args = array(
989
+ 'id' => 'color',
990
+ 'css_id' => $element_index.'_edd_variable_prices',
991
+ 'parent' => $input_name.'[edd_sales_stats]',
992
+ 'title' => __('Color','woocommerce-products-slider'),
993
+ 'details' => __('Title text color.','woocommerce-products-slider'),
994
+ 'type' => 'colorpicker',
995
+ 'value' => $color,
996
+ 'default' => '',
997
+ );
998
+
999
+ $settings_tabs_field->generate_field($args);
1000
+
1001
+ $args = array(
1002
+ 'id' => 'font_size',
1003
+ 'css_id' => $element_index.'_font_size',
1004
+ 'parent' => $input_name.'[edd_sales_stats]',
1005
+ 'title' => __('Font size','woocommerce-products-slider'),
1006
+ 'details' => __('Set font size.','woocommerce-products-slider'),
1007
+ 'type' => 'text',
1008
+ 'value' => $font_size,
1009
+ 'default' => '',
1010
+ 'placeholder' => '14px',
1011
+ );
1012
+
1013
+ $settings_tabs_field->generate_field($args);
1014
+
1015
+
1016
+ $args = array(
1017
+ 'id' => 'font_family',
1018
+ 'css_id' => $element_index.'_font_family',
1019
+ 'parent' => $input_name.'[edd_sales_stats]',
1020
+ 'title' => __('Font family','woocommerce-products-slider'),
1021
+ 'details' => __('Set font family.','woocommerce-products-slider'),
1022
+ 'type' => 'text',
1023
+ 'value' => $font_family,
1024
+ 'default' => '',
1025
+ 'placeholder' => 'Open Sans',
1026
+ );
1027
+
1028
+ $settings_tabs_field->generate_field($args);
1029
+
1030
+
1031
+ $args = array(
1032
+ 'id' => 'margin',
1033
+ 'css_id' => $element_index.'_margin',
1034
+ 'parent' => $input_name.'[edd_sales_stats]',
1035
+ 'title' => __('Margin','woocommerce-products-slider'),
1036
+ 'details' => __('Set margin.','woocommerce-products-slider'),
1037
+ 'type' => 'text',
1038
+ 'value' => $margin,
1039
+ 'default' => '',
1040
+ 'placeholder' => '5px 0',
1041
+ );
1042
+
1043
+ $settings_tabs_field->generate_field($args);
1044
+
1045
+
1046
+ $args = array(
1047
+ 'id' => 'text_align',
1048
+ 'css_id' => $element_index.'_text_align',
1049
+ 'parent' => $input_name.'[edd_sales_stats]',
1050
+ 'title' => __('Text align','woocommerce-products-slider'),
1051
+ 'details' => __('Choose text align.','woocommerce-products-slider'),
1052
+ 'type' => 'select',
1053
+ 'value' => $text_align,
1054
+ 'default' => 'left',
1055
+ 'args' => array('left'=> __('Left', 'woocommerce-products-slider'),'right'=> __('Right', 'woocommerce-products-slider'),'center'=> __('Center', 'woocommerce-products-slider') ),
1056
+ );
1057
+
1058
+ $settings_tabs_field->generate_field($args);
1059
+
1060
+
1061
+
1062
+
1063
+ ob_start();
1064
+ ?>
1065
+ <textarea readonly type="text" onclick="this.select();">.element-<?php echo $element_index?>{}</textarea>
1066
+ <?php
1067
+
1068
+ $html = ob_get_clean();
1069
+
1070
+ $args = array(
1071
+ 'id' => 'use_css',
1072
+ 'title' => __('Use of CSS','woocommerce-products-slider'),
1073
+ 'details' => __('Use following class selector to add custom CSS for this element.','woocommerce-products-slider'),
1074
+ 'type' => 'custom_html',
1075
+ 'html' => $html,
1076
+
1077
+ );
1078
+
1079
+ $settings_tabs_field->generate_field($args);
1080
+
1081
+ ?>
1082
+
1083
+ </div>
1084
+ </div>
1085
+ <?php
1086
+
1087
+ }
1088
+
1089
+
1090
+
1091
+ add_action('wcps_layout_elements_option_edd_add_to_cart','wcps_layout_elements_option_edd_add_to_cart');
1092
+
1093
+
1094
+ function wcps_layout_elements_option_edd_add_to_cart($parameters){
1095
+
1096
+ $settings_tabs_field = new settings_tabs_field();
1097
+
1098
+ $input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
1099
+ $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
1100
+ $element_index = isset($parameters['index']) ? $parameters['index'] : '';
1101
+
1102
+
1103
+ $color = isset($element_data['color']) ? $element_data['color'] : '';
1104
+ $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
1105
+ $font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
1106
+ $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
1107
+ $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
1108
+
1109
+ $custom_css = isset($element_data['custom_css']) ? $element_data['custom_css'] : '';
1110
+ $custom_css_hover = isset($element_data['custom_css_hover']) ? $element_data['custom_css_hover'] : '';
1111
+
1112
+
1113
+
1114
+ ?>
1115
+ <div class="item">
1116
+ <div class="element-title header ">
1117
+ <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
1118
+ <span class="sort"><i class="fas fa-sort"></i></span>
1119
+
1120
+ <span class="expand"><?php echo __('EDD add to cart','woocommerce-products-slider'); ?></span>
1121
+ </div>
1122
+ <div class="element-options options">
1123
+
1124
+ <?php
1125
+
1126
+ $args = array(
1127
+ 'id' => 'color',
1128
+ 'css_id' => $element_index.'_edd_add_to_cart',
1129
+ 'parent' => $input_name.'[edd_add_to_cart]',
1130
+ 'title' => __('Color','woocommerce-products-slider'),
1131
+ 'details' => __('Title text color.','woocommerce-products-slider'),
1132
+ 'type' => 'colorpicker',
1133
+ 'value' => $color,
1134
+ 'default' => '',
1135
+ );
1136
+
1137
+ $settings_tabs_field->generate_field($args);
1138
+
1139
+ $args = array(
1140
+ 'id' => 'font_size',
1141
+ 'css_id' => $element_index.'_font_size',
1142
+ 'parent' => $input_name.'[edd_add_to_cart]',
1143
+ 'title' => __('Font size','woocommerce-products-slider'),
1144
+ 'details' => __('Set font size.','woocommerce-products-slider'),
1145
+ 'type' => 'text',
1146
+ 'value' => $font_size,
1147
+ 'default' => '',
1148
+ 'placeholder' => '14px',
1149
+ );
1150
+
1151
+ $settings_tabs_field->generate_field($args);
1152
+
1153
+
1154
+ $args = array(
1155
+ 'id' => 'font_family',
1156
+ 'css_id' => $element_index.'_font_family',
1157
+ 'parent' => $input_name.'[edd_add_to_cart]',
1158
+ 'title' => __('Font family','woocommerce-products-slider'),
1159
+ 'details' => __('Set font family.','woocommerce-products-slider'),
1160
+ 'type' => 'text',
1161
+ 'value' => $font_family,
1162
+ 'default' => '',
1163
+ 'placeholder' => 'Open Sans',
1164
+ );
1165
+
1166
+ $settings_tabs_field->generate_field($args);
1167
+
1168
+
1169
+ $args = array(
1170
+ 'id' => 'margin',
1171
+ 'css_id' => $element_index.'_margin',
1172
+ 'parent' => $input_name.'[edd_add_to_cart]',
1173
+ 'title' => __('Margin','woocommerce-products-slider'),
1174
+ 'details' => __('Set margin.','woocommerce-products-slider'),
1175
+ 'type' => 'text',
1176
+ 'value' => $margin,
1177
+ 'default' => '',
1178
+ 'placeholder' => '5px 0',
1179
+ );
1180
+
1181
+ $settings_tabs_field->generate_field($args);
1182
+
1183
+
1184
+ $args = array(
1185
+ 'id' => 'text_align',
1186
+ 'css_id' => $element_index.'_text_align',
1187
+ 'parent' => $input_name.'[edd_add_to_cart]',
1188
+ 'title' => __('Text align','woocommerce-products-slider'),
1189
+ 'details' => __('Choose text align.','woocommerce-products-slider'),
1190
+ 'type' => 'select',
1191
+ 'value' => $text_align,
1192
+ 'default' => 'left',
1193
+ 'args' => array('left'=> __('Left', 'woocommerce-products-slider'),'right'=> __('Right', 'woocommerce-products-slider'),'center'=> __('Center', 'woocommerce-products-slider') ),
1194
+ );
1195
+
1196
+ $settings_tabs_field->generate_field($args);
1197
+
1198
+
1199
+
1200
+
1201
+ ob_start();
1202
+ ?>
1203
+ <textarea readonly type="text" onclick="this.select();">.element-<?php echo $element_index?>{}</textarea>
1204
+ <?php
1205
+
1206
+ $html = ob_get_clean();
1207
+
1208
+ $args = array(
1209
+ 'id' => 'use_css',
1210
+ 'title' => __('Use of CSS','woocommerce-products-slider'),
1211
+ 'details' => __('Use following class selector to add custom CSS for this element.','woocommerce-products-slider'),
1212
+ 'type' => 'custom_html',
1213
+ 'html' => $html,
1214
+
1215
+ );
1216
+
1217
+ $settings_tabs_field->generate_field($args);
1218
+
1219
+ ?>
1220
+
1221
+ </div>
1222
+ </div>
1223
+ <?php
1224
+
1225
+ }
1226
+
1227
+
1228
+
1229
+ add_action('wcps_layout_elements_option_edd_categories','wcps_layout_elements_option_edd_categories');
1230
+
1231
+
1232
+ function wcps_layout_elements_option_edd_categories($parameters){
1233
+
1234
+ $settings_tabs_field = new settings_tabs_field();
1235
+
1236
+ $input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
1237
+ $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
1238
+ $element_index = isset($parameters['index']) ? $parameters['index'] : '';
1239
+
1240
+
1241
+ $color = isset($element_data['color']) ? $element_data['color'] : '';
1242
+ $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
1243
+ $font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
1244
+ $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
1245
+ $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
1246
+
1247
+ $wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '%s';
1248
+ $wrapper_html = !empty($wrapper_html) ? $wrapper_html : '';
1249
+
1250
+ $custom_css = isset($element_data['custom_css']) ? $element_data['custom_css'] : '';
1251
+ $custom_css_hover = isset($element_data['custom_css_hover']) ? $element_data['custom_css_hover'] : '';
1252
+
1253
+
1254
+
1255
+ ?>
1256
+ <div class="item">
1257
+ <div class="element-title header ">
1258
+ <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
1259
+ <span class="sort"><i class="fas fa-sort"></i></span>
1260
+
1261
+ <span class="expand"><?php echo __('EDD categories','woocommerce-products-slider'); ?></span>
1262
+ </div>
1263
+ <div class="element-options options">
1264
+
1265
+ <?php
1266
+
1267
+ $args = array(
1268
+ 'id' => 'wrapper_html',
1269
+ 'css_id' => $element_index.'_wrapper_html',
1270
+ 'parent' => $input_name.'[edd_categories]',
1271
+ 'title' => __('Wrapper html','woocommerce-products-slider'),
1272
+ 'details' => __('Set font wrapper html.','woocommerce-products-slider'),
1273
+ 'type' => 'text',
1274
+ 'value' => $wrapper_html,
1275
+ 'default' => '',
1276
+ 'placeholder' => '',
1277
+ );
1278
+
1279
+ $settings_tabs_field->generate_field($args);
1280
+
1281
+ $args = array(
1282
+ 'id' => 'color',
1283
+ 'css_id' => $element_index.'_color',
1284
+ 'parent' => $input_name.'[edd_categories]',
1285
+ 'title' => __('Color','woocommerce-products-slider'),
1286
+ 'details' => __('Title text color.','woocommerce-products-slider'),
1287
+ 'type' => 'colorpicker',
1288
+ 'value' => $color,
1289
+ 'default' => '',
1290
+ );
1291
+
1292
+ $settings_tabs_field->generate_field($args);
1293
+
1294
+ $args = array(
1295
+ 'id' => 'font_size',
1296
+ 'css_id' => $element_index.'_font_size',
1297
+ 'parent' => $input_name.'[edd_categories]',
1298
+ 'title' => __('Font size','woocommerce-products-slider'),
1299
+ 'details' => __('Set font size.','woocommerce-products-slider'),
1300
+ 'type' => 'text',
1301
+ 'value' => $font_size,
1302
+ 'default' => '',
1303
+ 'placeholder' => '14px',
1304
+ );
1305
+
1306
+ $settings_tabs_field->generate_field($args);
1307
+
1308
+
1309
+ $args = array(
1310
+ 'id' => 'font_family',
1311
+ 'css_id' => $element_index.'_font_family',
1312
+ 'parent' => $input_name.'[edd_categories]',
1313
+ 'title' => __('Font family','woocommerce-products-slider'),
1314
+ 'details' => __('Set font family.','woocommerce-products-slider'),
1315
+ 'type' => 'text',
1316
+ 'value' => $font_family,
1317
+ 'default' => '',
1318
+ 'placeholder' => 'Open Sans',
1319
+ );
1320
+
1321
+ $settings_tabs_field->generate_field($args);
1322
+
1323
+
1324
+ $args = array(
1325
+ 'id' => 'margin',
1326
+ 'css_id' => $element_index.'_margin',
1327
+ 'parent' => $input_name.'[edd_categories]',
1328
+ 'title' => __('Margin','woocommerce-products-slider'),
1329
+ 'details' => __('Set margin.','woocommerce-products-slider'),
1330
+ 'type' => 'text',
1331
+ 'value' => $margin,
1332
+ 'default' => '',
1333
+ 'placeholder' => '5px 0',
1334
+ );
1335
+
1336
+ $settings_tabs_field->generate_field($args);
1337
+
1338
+
1339
+ $args = array(
1340
+ 'id' => 'text_align',
1341
+ 'css_id' => $element_index.'_text_align',
1342
+ 'parent' => $input_name.'[edd_categories]',
1343
+ 'title' => __('Text align','woocommerce-products-slider'),
1344
+ 'details' => __('Choose text align.','woocommerce-products-slider'),
1345
+ 'type' => 'select',
1346
+ 'value' => $text_align,
1347
+ 'default' => 'left',
1348
+ 'args' => array('left'=> __('Left', 'woocommerce-products-slider'),'right'=> __('Right', 'woocommerce-products-slider'),'center'=> __('Center', 'woocommerce-products-slider') ),
1349
+ );
1350
+
1351
+ $settings_tabs_field->generate_field($args);
1352
+
1353
+
1354
+
1355
+
1356
+ ob_start();
1357
+ ?>
1358
+ <textarea readonly type="text" onclick="this.select();">.element-<?php echo $element_index?>{}</textarea>
1359
+ <?php
1360
+
1361
+ $html = ob_get_clean();
1362
+
1363
+ $args = array(
1364
+ 'id' => 'use_css',
1365
+ 'title' => __('Use of CSS','woocommerce-products-slider'),
1366
+ 'details' => __('Use following class selector to add custom CSS for this element.','woocommerce-products-slider'),
1367
+ 'type' => 'custom_html',
1368
+ 'html' => $html,
1369
+
1370
+ );
1371
+
1372
+ $settings_tabs_field->generate_field($args);
1373
+
1374
+ ?>
1375
+
1376
+ </div>
1377
+ </div>
1378
+ <?php
1379
+
1380
+ }
1381
+
1382
+
1383
+ add_action('wcps_layout_elements_option_edd_tags','wcps_layout_elements_option_edd_tags');
1384
+
1385
+
1386
+ function wcps_layout_elements_option_edd_tags($parameters){
1387
+
1388
+ $settings_tabs_field = new settings_tabs_field();
1389
+
1390
+ $input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
1391
+ $element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
1392
+ $element_index = isset($parameters['index']) ? $parameters['index'] : '';
1393
+
1394
+
1395
+ $color = isset($element_data['color']) ? $element_data['color'] : '';
1396
+ $font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
1397
+ $font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
1398
+ $margin = isset($element_data['margin']) ? $element_data['margin'] : '';
1399
+ $text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
1400
+
1401
+ $wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
1402
+ $wrapper_html = !empty($wrapper_html) ? $wrapper_html : '%s';
1403
+
1404
+ $custom_css = isset($element_data['custom_css']) ? $element_data['custom_css'] : '';
1405
+ $custom_css_hover = isset($element_data['custom_css_hover']) ? $element_data['custom_css_hover'] : '';
1406
+
1407
+
1408
+
1409
+ ?>
1410
+ <div class="item">
1411
+ <div class="element-title header ">
1412
+ <span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
1413
+ <span class="sort"><i class="fas fa-sort"></i></span>
1414
+
1415
+ <span class="expand"><?php echo __('EDD tags','woocommerce-products-slider'); ?></span>
1416
+ </div>
1417
+ <div class="element-options options">
1418
+
1419
+ <?php
1420
+
1421
+
1422
+ $args = array(
1423
+ 'id' => 'wrapper_html',
1424
+ 'css_id' => $element_index.'_wrapper_html',
1425
+ 'parent' => $input_name.'[edd_tags]',
1426
+ 'title' => __('Wrapper html','woocommerce-products-slider'),
1427
+ 'details' => __('Set font wrapper html.','woocommerce-products-slider'),
1428
+ 'type' => 'text',
1429
+ 'value' => $wrapper_html,
1430
+ 'default' => '',
1431
+ 'placeholder' => '',
1432
+ );
1433
+
1434
+ $settings_tabs_field->generate_field($args);
1435
+
1436
+ $args = array(
1437
+ 'id' => 'color',
1438
+ 'css_id' => $element_index.'_color',
1439
+ 'parent' => $input_name.'[edd_tags]',
1440
+ 'title' => __('Color','woocommerce-products-slider'),
1441
+ 'details' => __('Title text color.','woocommerce-products-slider'),
1442
+ 'type' => 'colorpicker',
1443
+ 'value' => $color,
1444
+ 'default' => '',
1445
+ );
1446
+
1447
+ $settings_tabs_field->generate_field($args);
1448
+
1449
+ $args = array(
1450
+ 'id' => 'font_size',
1451
+ 'css_id' => $element_index.'_font_size',
1452
+ 'parent' => $input_name.'[edd_tags]',
1453
+ 'title' => __('Font size','woocommerce-products-slider'),
1454
+ 'details' => __('Set font size.','woocommerce-products-slider'),
1455
+ 'type' => 'text',
1456
+ 'value' => $font_size,
1457
+ 'default' => '',
1458
+ 'placeholder' => '14px',
1459
+ );
1460
+
1461
+ $settings_tabs_field->generate_field($args);
1462
+
1463
+
1464
+ $args = array(
1465
+ 'id' => 'font_family',
1466
+ 'css_id' => $element_index.'_font_family',
1467
+ 'parent' => $input_name.'[edd_tags]',
1468
+ 'title' => __('Font family','woocommerce-products-slider'),
1469
+ 'details' => __('Set font family.','woocommerce-products-slider'),
1470
+ 'type' => 'text',
1471
+ 'value' => $font_family,
1472
+ 'default' => '',
1473
+ 'placeholder' => 'Open Sans',
1474
+ );
1475
+
1476
+ $settings_tabs_field->generate_field($args);
1477
+
1478
+
1479
+ $args = array(
1480
+ 'id' => 'margin',
1481
+ 'css_id' => $element_index.'_margin',
1482
+ 'parent' => $input_name.'[edd_tags]',
1483
+ 'title' => __('Margin','woocommerce-products-slider'),
1484
+ 'details' => __('Set margin.','woocommerce-products-slider'),
1485
+ 'type' => 'text',
1486
+ 'value' => $margin,
1487
+ 'default' => '',
1488
+ 'placeholder' => '5px 0',
1489
+ );
1490