Version Description
- 2020-04-05 add - Customer Orders slider
- 2020-04-05 add - Categories slider
- 2020-04-05 add - Dokan vendors slider
- 2020-04-05 add - add element "Term title" under layout builder
- 2020-04-05 add - add element "Term thumbnail" under layout builder
- 2020-04-05 add - add element "Term description" under layout builder
- 2020-04-05 add - add element "Term slug" under layout builder
- 2020-04-05 add - add element "Term post count" under layout builder
- 2020-04-05 add - add element "Order date" under layout builder
- 2020-04-05 add - add element "Order customer name" under layout builder
- 2020-04-05 add - add element "Order customer thumbnail" under layout builder
- 2020-04-05 add - add element "Order country" under layout builder
- 2020-04-05 add - add element "Order payment method" under layout builder
- 2020-04-05 add - add element "Order total" under layout builder
- 2020-04-05 add - add element "Order items" under layout builder
- 2020-04-05 add - add element "Order discount total" under layout builder
- 2020-04-05 add - add element "Dokan store name" under layout builder
- 2020-04-05 add - add element "Dokan store address" under layout builder
- 2020-04-05 add - add element "Dokan store city" under layout builder
- 2020-04-05 add - add element "Dokan store country" under layout builder
- 2020-04-05 add - add element "Dokan store phone" under layout builder
- 2020-04-05 add - add element "Dokan store banner" under layout builder
- 2020-04-05 add - add element "Dokan store avatar" under layout builder
- 2020-04-05 add - add element for "Wishlist" plugin under layout builder
- 2020-04-05 add - add element for "WPC Smart Wishlist" plugin under layout builder
- 2020-04-05 add - add element for "WPC Smart Quick View" plugin under layout builder
- 2020-04-05 add - add element for "WPC Smart Compare" plugin under layout builder
- 2020-04-05 add - add element for "WPC Countdown Timer" plugin under layout builder
- 2020-04-05 add - add element for "TI WooCommerce Wishlist" plugin under layout builder
- 2020-04-05 add - compatibility check for "WooCommerce Wholesale Prices" plugin
- 2020-04-05 add - add element for "Wish List for WooCommerce" plugin under layout builder
Download this release
Release Info
Developer | pickplugins |
Plugin | Woocommerce Products Slider |
Version | 1.13.10 |
Comparing to | |
See all releases |
Code changes from version 1.13.9 to 1.13.10
- assets/settings-tabs/settings-tabs.css +1 -1
- assets/settings-tabs/settings-tabs.js +28 -0
- includes/3rd-party/3rd-party.php +53 -0
- includes/3rd-party/advanced-product-labels-for-woocommerce.php +113 -0
- includes/3rd-party/functions-layout-element-dokan.php +481 -0
- includes/3rd-party/perfect-woocommerce-brands.php +124 -0
- includes/3rd-party/ti-woocommerce-wishlist.php +117 -0
- includes/3rd-party/wish-list-for-woocommerce.php +120 -0
- includes/3rd-party/wishlist.php +220 -0
- includes/3rd-party/woo-smart-compare.php +113 -0
- includes/3rd-party/woo-smart-quick-view.php +113 -0
- includes/3rd-party/woo-smart-wishlist.php +113 -0
- includes/3rd-party/wpc-countdown-timer.php +120 -0
- includes/class-metabox-wcps-hook.php +520 -0
- includes/class-metabox-wcps-layout-hook.php +21 -8
- includes/class-metabox-wcps.php +135 -1
- includes/class-settings-tabs.php +144 -31
- includes/functions-layout-element.php +1069 -198
- includes/functions-layout-hook.php +3217 -7
- includes/functions-settings-hook.php +77 -0
- includes/functions.php +52 -0
- readme.txt +36 -3
- templates/wcps-slider/wcps-slider-hook.php +434 -5
- woocommerce-products-slider.php +8 -14
assets/settings-tabs/settings-tabs.css
CHANGED
@@ -195,7 +195,7 @@
|
|
195 |
padding: 15px;
|
196 |
}
|
197 |
.settings-tabs .setting-field:last-child{
|
198 |
-
|
199 |
}
|
200 |
|
201 |
|
195 |
padding: 15px;
|
196 |
}
|
197 |
.settings-tabs .setting-field:last-child{
|
198 |
+
|
199 |
}
|
200 |
|
201 |
|
assets/settings-tabs/settings-tabs.js
CHANGED
@@ -10,6 +10,9 @@ jQuery(document).ready(function($){
|
|
10 |
collapsible: true,
|
11 |
});
|
12 |
|
|
|
|
|
|
|
13 |
$( ".settings-tabs .accordion[sortable='true']").sortable({
|
14 |
axis: "y",
|
15 |
handle: "h3",
|
@@ -27,6 +30,31 @@ jQuery(document).ready(function($){
|
|
27 |
|
28 |
$(".settings-tabs .sortable" ).sortable({ handle: ".sort" });
|
29 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30 |
$(document).on('click','.settings-tabs .tab-nav',function(){
|
31 |
|
32 |
$(this).parent().parent().children('.tab-navs').children('.tab-nav').removeClass('active');
|
10 |
collapsible: true,
|
11 |
});
|
12 |
|
13 |
+
$( ".settings-tabs [colorPicker]").wpColorPicker();
|
14 |
+
|
15 |
+
|
16 |
$( ".settings-tabs .accordion[sortable='true']").sortable({
|
17 |
axis: "y",
|
18 |
handle: "h3",
|
30 |
|
31 |
$(".settings-tabs .sortable" ).sortable({ handle: ".sort" });
|
32 |
|
33 |
+
$(document).on('click','.settings-tabs .textarea-editor',function(){
|
34 |
+
|
35 |
+
id = $(this).attr('id');
|
36 |
+
editor_enabled = $(this).attr('editor_enabled');
|
37 |
+
|
38 |
+
|
39 |
+
console.log(typeof wp.editor);
|
40 |
+
|
41 |
+
if(editor_enabled == 'no' && typeof wp.editor != 'undefined'){
|
42 |
+
wp.editor.initialize( id, {
|
43 |
+
mediaButtons: true,
|
44 |
+
tinymce: {
|
45 |
+
toolbar1: 'bold,italic,bullist,numlist,link,blockquote,alignleft,aligncenter,alignright,strikethrough,hr,forecolor,pastetext,removeformat,codeformat,undo,redo'
|
46 |
+
},
|
47 |
+
quicktags: true,
|
48 |
+
} );
|
49 |
+
|
50 |
+
$(this).attr('editor_enabled','yes');
|
51 |
+
}
|
52 |
+
|
53 |
+
|
54 |
+
|
55 |
+
|
56 |
+
})
|
57 |
+
|
58 |
$(document).on('click','.settings-tabs .tab-nav',function(){
|
59 |
|
60 |
$(this).parent().parent().children('.tab-navs').children('.tab-nav').removeClass('active');
|
includes/3rd-party/3rd-party.php
CHANGED
@@ -4,6 +4,59 @@ if ( ! defined('ABSPATH')) exit; // if direct access
|
|
4 |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
5 |
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
if ( is_plugin_active( 'yith-woocommerce-quick-view/init.php' ) ) {
|
8 |
require_once( wcps_plugin_dir . 'includes/3rd-party/yith-woocommerce-quick-view.php');
|
9 |
}
|
4 |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
|
5 |
|
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 |
+
|
16 |
+
if ( is_plugin_active( 'wishlist/wishlist.php' ) ) {
|
17 |
+
require_once( wcps_plugin_dir . 'includes/3rd-party/wishlist.php');
|
18 |
+
}
|
19 |
+
|
20 |
+
|
21 |
+
if ( is_plugin_active( 'wish-list-for-woocommerce/wish-list-for-woocommerce.php' ) ) {
|
22 |
+
require_once( wcps_plugin_dir . 'includes/3rd-party/wish-list-for-woocommerce.php');
|
23 |
+
}
|
24 |
+
|
25 |
+
|
26 |
+
//WPClever.net
|
27 |
+
if ( is_plugin_active( 'woo-smart-wishlist/index.php' ) ) {
|
28 |
+
require_once( wcps_plugin_dir . 'includes/3rd-party/woo-smart-wishlist.php');
|
29 |
+
}
|
30 |
+
|
31 |
+
if ( is_plugin_active( 'woo-smart-quick-view/index.php' ) ) {
|
32 |
+
require_once( wcps_plugin_dir . 'includes/3rd-party/woo-smart-quick-view.php');
|
33 |
+
}
|
34 |
+
|
35 |
+
if ( is_plugin_active( 'woo-smart-compare/index.php' ) ) {
|
36 |
+
require_once( wcps_plugin_dir . 'includes/3rd-party/woo-smart-compare.php');
|
37 |
+
}
|
38 |
+
|
39 |
+
if ( is_plugin_active( 'wpc-countdown-timer/wpc-countdown-timer.php' ) ) {
|
40 |
+
require_once( wcps_plugin_dir . 'includes/3rd-party/wpc-countdown-timer.php');
|
41 |
+
}
|
42 |
+
|
43 |
+
|
44 |
+
if ( is_plugin_active( 'ti-woocommerce-wishlist/ti-woocommerce-wishlist.php' ) ) {
|
45 |
+
require_once( wcps_plugin_dir . 'includes/3rd-party/ti-woocommerce-wishlist.php');
|
46 |
+
}
|
47 |
+
|
48 |
+
//if ( is_plugin_active( 'advanced-product-labels-for-woocommerce/woocommerce-advanced-products-labels.php' ) ) {
|
49 |
+
// require_once( wcps_plugin_dir . 'includes/3rd-party/advanced-product-labels-for-woocommerce.php');
|
50 |
+
//}
|
51 |
+
|
52 |
+
|
53 |
+
//if ( is_plugin_active( 'perfect-woocommerce-brands/perfect-woocommerce-brands.php' ) ) {
|
54 |
+
// require_once( wcps_plugin_dir . 'includes/3rd-party/perfect-woocommerce-brands.php');
|
55 |
+
//}
|
56 |
+
|
57 |
+
|
58 |
+
//yith
|
59 |
+
|
60 |
if ( is_plugin_active( 'yith-woocommerce-quick-view/init.php' ) ) {
|
61 |
require_once( wcps_plugin_dir . 'includes/3rd-party/yith-woocommerce-quick-view.php');
|
62 |
}
|
includes/3rd-party/advanced-product-labels-for-woocommerce.php
ADDED
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
+
|
4 |
+
add_filter('wcps_layout_elements', 'wcps_layout_elements_advanced_product_labels');
|
5 |
+
|
6 |
+
function wcps_layout_elements_advanced_product_labels($layout_elements){
|
7 |
+
|
8 |
+
|
9 |
+
$layout_elements['advanced_product_labels'] = array('name' =>__('Advanced product labels','woocommerce-products-slider'));
|
10 |
+
|
11 |
+
return $layout_elements;
|
12 |
+
|
13 |
+
}
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
+
|
18 |
+
add_action('wcps_layout_elements_option_advanced_product_labels','wcps_layout_elements_option_advanced_product_labels');
|
19 |
+
function wcps_layout_elements_option_advanced_product_labels($parameters){
|
20 |
+
|
21 |
+
$settings_tabs_field = new settings_tabs_field();
|
22 |
+
|
23 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
24 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
25 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
26 |
+
|
27 |
+
|
28 |
+
|
29 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
30 |
+
|
31 |
+
?>
|
32 |
+
<div class="item">
|
33 |
+
<div class="element-title header ">
|
34 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
35 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
36 |
+
|
37 |
+
<span class="expand"><?php echo __('Advanced product labels','woocommerce-products-slider'); ?></span>
|
38 |
+
</div>
|
39 |
+
<div class="element-options options">
|
40 |
+
|
41 |
+
<?php
|
42 |
+
|
43 |
+
$args = array(
|
44 |
+
'id' => 'margin',
|
45 |
+
'css_id' => $element_index.'_margin',
|
46 |
+
'parent' => $input_name.'[advanced_product_labels]',
|
47 |
+
'title' => __('Margin','woocommerce-products-slider'),
|
48 |
+
'details' => __('Set margin.','woocommerce-products-slider'),
|
49 |
+
'type' => 'text',
|
50 |
+
'value' => $margin,
|
51 |
+
'default' => '',
|
52 |
+
'placeholder' => '5px 0',
|
53 |
+
);
|
54 |
+
|
55 |
+
$settings_tabs_field->generate_field($args);
|
56 |
+
|
57 |
+
|
58 |
+
?>
|
59 |
+
|
60 |
+
</div>
|
61 |
+
</div>
|
62 |
+
<?php
|
63 |
+
|
64 |
+
}
|
65 |
+
|
66 |
+
|
67 |
+
|
68 |
+
|
69 |
+
add_action('wcps_layout_element_advanced_product_labels', 'wcps_layout_element_advanced_product_labels', 10);
|
70 |
+
function wcps_layout_element_advanced_product_labels($args){
|
71 |
+
|
72 |
+
//echo '<pre>'.var_export($args, true).'</pre>';
|
73 |
+
$product_id = isset($args['product_id']) ? $args['product_id'] : '';
|
74 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
75 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
76 |
+
|
77 |
+
$element_class = !empty($element_index) ? 'element-advanced_product_labels element-'.$element_index : 'element-advanced_product_labels';
|
78 |
+
|
79 |
+
?>
|
80 |
+
<div class="<?php echo $element_class; ?>"><?php echo do_shortcode('[br-wapl-label id="'.$product_id.'" ]');; ?></div>
|
81 |
+
<?php
|
82 |
+
|
83 |
+
}
|
84 |
+
|
85 |
+
|
86 |
+
|
87 |
+
|
88 |
+
add_action('wcps_layout_element_css_advanced_product_labels', 'wcps_layout_element_css_advanced_product_labels', 10);
|
89 |
+
function wcps_layout_element_css_advanced_product_labels($args){
|
90 |
+
|
91 |
+
|
92 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
93 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
94 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
95 |
+
|
96 |
+
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
97 |
+
|
98 |
+
//echo '<pre>'.var_export($layout_id, true).'</pre>';
|
99 |
+
|
100 |
+
?>
|
101 |
+
<style type="text/css">
|
102 |
+
|
103 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
104 |
+
<?php if(!empty($margin)): ?>
|
105 |
+
margin: <?php echo $margin; ?>;
|
106 |
+
<?php endif; ?>
|
107 |
+
|
108 |
+
}
|
109 |
+
|
110 |
+
</style>
|
111 |
+
<?php
|
112 |
+
}
|
113 |
+
|
includes/3rd-party/functions-layout-element-dokan.php
ADDED
@@ -0,0 +1,481 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
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 |
+
|
15 |
+
|
16 |
+
|
17 |
+
add_filter('wcps_layout_elements', 'wcps_layout_elements_dokan');
|
18 |
+
function wcps_layout_elements_dokan($layout_elements){
|
19 |
+
|
20 |
+
$layout_elements['dokan_store_name'] = array('name' =>__('Dokan store name','woocommerce-products-slider'));
|
21 |
+
$layout_elements['dokan_store_address'] = array('name' =>__('Dokan store address','woocommerce-products-slider'));
|
22 |
+
$layout_elements['dokan_store_city'] = array('name' =>__('Dokan store city','woocommerce-products-slider'));
|
23 |
+
$layout_elements['dokan_store_country'] = array('name' =>__('Dokan store country','woocommerce-products-slider'));
|
24 |
+
$layout_elements['dokan_store_phone'] = array('name' =>__('Dokan store phone','woocommerce-products-slider'));
|
25 |
+
$layout_elements['dokan_banner'] = array('name' =>__('Dokan banner','woocommerce-products-slider'));
|
26 |
+
$layout_elements['dokan_avatar'] = array('name' =>__('Dokan avatar','woocommerce-products-slider'));
|
27 |
+
|
28 |
+
return $layout_elements;
|
29 |
+
}
|
30 |
+
|
31 |
+
|
32 |
+
add_action('wcps_layout_element_dokan_store_name', 'wcps_layout_element_dokan_store_name', 10);
|
33 |
+
function wcps_layout_element_dokan_store_name($args){
|
34 |
+
|
35 |
+
$user_id = isset($args['user_id']) ? $args['user_id'] : (int) wcps_get_first_dokan_vendor_id();
|
36 |
+
|
37 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
38 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
39 |
+
|
40 |
+
$wrapper_html = isset($elementData['wrapper_html']) ? $elementData['wrapper_html'] : '';
|
41 |
+
$wrapper_html = !empty($wrapper_html) ? $wrapper_html : '%s';
|
42 |
+
|
43 |
+
$element_class = !empty($element_index) ? 'element-term_title element-'.$element_index : 'element-term_title';
|
44 |
+
|
45 |
+
$dokan_profile_settings = get_user_meta($user_id, 'dokan_profile_settings', true );
|
46 |
+
|
47 |
+
$store_name = isset($dokan_profile_settings['store_name']) ? $dokan_profile_settings['store_name'] : '';
|
48 |
+
|
49 |
+
if(!empty($store_name)):
|
50 |
+
?>
|
51 |
+
<div class="<?php echo $element_class; ?>"><?php echo sprintf($wrapper_html, $store_name); ?></div>
|
52 |
+
<?php
|
53 |
+
endif;
|
54 |
+
|
55 |
+
|
56 |
+
}
|
57 |
+
|
58 |
+
|
59 |
+
add_action('wcps_layout_element_dokan_store_address', 'wcps_layout_element_dokan_store_address', 10);
|
60 |
+
function wcps_layout_element_dokan_store_address($args){
|
61 |
+
|
62 |
+
$user_id = isset($args['user_id']) ? $args['user_id'] : (int) wcps_get_first_dokan_vendor_id();
|
63 |
+
|
64 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
65 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
66 |
+
|
67 |
+
$wrapper_html = isset($elementData['wrapper_html']) ? $elementData['wrapper_html'] : '';
|
68 |
+
$wrapper_html = !empty($wrapper_html) ? $wrapper_html : '%s';
|
69 |
+
|
70 |
+
$element_class = !empty($element_index) ? 'element-term_title element-'.$element_index : 'element-term_title';
|
71 |
+
|
72 |
+
$dokan_profile_settings = get_user_meta($user_id, 'dokan_profile_settings', true );
|
73 |
+
|
74 |
+
$address_street_1 = isset($dokan_profile_settings['address']['street_1']) ? $dokan_profile_settings['address']['street_1'] : '';
|
75 |
+
|
76 |
+
if(!empty($address_street_1)):
|
77 |
+
?>
|
78 |
+
<div class="<?php echo $element_class; ?>"><?php echo sprintf($wrapper_html, $address_street_1); ?></div>
|
79 |
+
<?php
|
80 |
+
endif;
|
81 |
+
|
82 |
+
|
83 |
+
}
|
84 |
+
|
85 |
+
|
86 |
+
|
87 |
+
add_action('wcps_layout_element_dokan_store_city', 'wcps_layout_element_dokan_store_city', 10);
|
88 |
+
function wcps_layout_element_dokan_store_city($args){
|
89 |
+
|
90 |
+
$user_id = isset($args['user_id']) ? $args['user_id'] : (int) wcps_get_first_dokan_vendor_id();
|
91 |
+
|
92 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
93 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
94 |
+
|
95 |
+
$wrapper_html = isset($elementData['wrapper_html']) ? $elementData['wrapper_html'] : '';
|
96 |
+
$wrapper_html = !empty($wrapper_html) ? $wrapper_html : '%s';
|
97 |
+
|
98 |
+
$element_class = !empty($element_index) ? 'element-term_title element-'.$element_index : 'element-term_title';
|
99 |
+
|
100 |
+
$dokan_profile_settings = get_user_meta($user_id, 'dokan_profile_settings', true );
|
101 |
+
|
102 |
+
$address_city = isset($dokan_profile_settings['address']['city']) ? $dokan_profile_settings['address']['city'] : '';
|
103 |
+
|
104 |
+
if(!empty($address_city)):
|
105 |
+
?>
|
106 |
+
<div class="<?php echo $element_class; ?>"><?php echo sprintf($wrapper_html, $address_city); ?></div>
|
107 |
+
<?php
|
108 |
+
endif;
|
109 |
+
|
110 |
+
|
111 |
+
}
|
112 |
+
|
113 |
+
|
114 |
+
|
115 |
+
add_action('wcps_layout_element_dokan_store_country', 'wcps_layout_element_dokan_store_country', 10);
|
116 |
+
function wcps_layout_element_dokan_store_country($args){
|
117 |
+
|
118 |
+
$user_id = isset($args['user_id']) ? $args['user_id'] : (int) wcps_get_first_dokan_vendor_id();
|
119 |
+
|
120 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
121 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
122 |
+
|
123 |
+
$wrapper_html = isset($elementData['wrapper_html']) ? $elementData['wrapper_html'] : '';
|
124 |
+
$wrapper_html = !empty($wrapper_html) ? $wrapper_html : '%s';
|
125 |
+
|
126 |
+
$element_class = !empty($element_index) ? 'element-term_title element-'.$element_index : 'element-term_title';
|
127 |
+
|
128 |
+
$dokan_profile_settings = get_user_meta($user_id, 'dokan_profile_settings', true );
|
129 |
+
|
130 |
+
$address_country = isset($dokan_profile_settings['address']['country']) ? $dokan_profile_settings['address']['country'] : '';
|
131 |
+
|
132 |
+
if(!empty($address_country)):
|
133 |
+
?>
|
134 |
+
<div class="<?php echo $element_class; ?>"><?php echo sprintf($wrapper_html, $address_country); ?></div>
|
135 |
+
<?php
|
136 |
+
endif;
|
137 |
+
|
138 |
+
|
139 |
+
}
|
140 |
+
|
141 |
+
|
142 |
+
|
143 |
+
add_action('wcps_layout_element_dokan_store_phone', 'wcps_layout_element_dokan_store_phone', 10);
|
144 |
+
function wcps_layout_element_dokan_store_phone($args){
|
145 |
+
|
146 |
+
$user_id = isset($args['user_id']) ? $args['user_id'] : (int) wcps_get_first_dokan_vendor_id();
|
147 |
+
|
148 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
149 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
150 |
+
|
151 |
+
$wrapper_html = isset($elementData['wrapper_html']) ? $elementData['wrapper_html'] : '';
|
152 |
+
$wrapper_html = !empty($wrapper_html) ? $wrapper_html : '%s';
|
153 |
+
|
154 |
+
$element_class = !empty($element_index) ? 'element-term_title element-'.$element_index : 'element-term_title';
|
155 |
+
|
156 |
+
$dokan_profile_settings = get_user_meta($user_id, 'dokan_profile_settings', true );
|
157 |
+
|
158 |
+
$phone = isset($dokan_profile_settings['phone']) ? $dokan_profile_settings['phone'] : '';
|
159 |
+
|
160 |
+
if(!empty($phone)):
|
161 |
+
?>
|
162 |
+
<div class="<?php echo $element_class; ?>"><?php echo sprintf($wrapper_html, $phone); ?></div>
|
163 |
+
<?php
|
164 |
+
endif;
|
165 |
+
|
166 |
+
|
167 |
+
}
|
168 |
+
|
169 |
+
add_action('wcps_layout_element_dokan_banner', 'wcps_layout_element_dokan_banner', 10);
|
170 |
+
function wcps_layout_element_dokan_banner($args){
|
171 |
+
|
172 |
+
$user_id = isset($args['user_id']) ? $args['user_id'] : (int) wcps_get_first_dokan_vendor_id();
|
173 |
+
|
174 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
175 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
176 |
+
|
177 |
+
$wrapper_html = isset($elementData['wrapper_html']) ? $elementData['wrapper_html'] : '';
|
178 |
+
$wrapper_html = !empty($wrapper_html) ? $wrapper_html : '%s';
|
179 |
+
|
180 |
+
$element_class = !empty($element_index) ? 'element-term_title element-'.$element_index : 'element-term_title';
|
181 |
+
|
182 |
+
$dokan_profile_settings = get_user_meta($user_id, 'dokan_profile_settings', true );
|
183 |
+
$banner_id = !empty($dokan_profile_settings['gravatar']) ? $dokan_profile_settings['banner'] : '';
|
184 |
+
|
185 |
+
|
186 |
+
$store_url = dokan_get_store_url($user_id);
|
187 |
+
|
188 |
+
$banner_urls = wp_get_attachment_image_src($banner_id, 'full');
|
189 |
+
$banner_image_url = isset($banner_urls[0]) ? $banner_urls[0] : '';
|
190 |
+
|
191 |
+
?>
|
192 |
+
<div class="<?php echo $element_class; ?>"><a href="<?php echo $store_url; ?>"><img src="<?php echo $banner_image_url; ?>"></a> </div>
|
193 |
+
<?php
|
194 |
+
|
195 |
+
}
|
196 |
+
|
197 |
+
|
198 |
+
add_action('wcps_layout_element_dokan_avatar', 'wcps_layout_element_dokan_avatar', 10);
|
199 |
+
function wcps_layout_element_dokan_avatar($args){
|
200 |
+
|
201 |
+
$user_id = isset($args['user_id']) ? $args['user_id'] : (int) wcps_get_first_dokan_vendor_id();
|
202 |
+
|
203 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
204 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
205 |
+
|
206 |
+
$wrapper_html = isset($elementData['wrapper_html']) ? $elementData['wrapper_html'] : '';
|
207 |
+
$wrapper_html = !empty($wrapper_html) ? $wrapper_html : '%s';
|
208 |
+
|
209 |
+
$element_class = !empty($element_index) ? 'element-term_title element-'.$element_index : 'element-term_title';
|
210 |
+
|
211 |
+
$dokan_profile_settings = get_user_meta($user_id, 'dokan_profile_settings', true );
|
212 |
+
$store_url = dokan_get_store_url($user_id);
|
213 |
+
|
214 |
+
$gravatar_id = !empty($dokan_profile_settings['gravatar']) ? $dokan_profile_settings['gravatar'] : '';
|
215 |
+
$banner_urls = wp_get_attachment_image_src($gravatar_id, 'full');
|
216 |
+
$banner_image_url = isset($banner_urls[0]) ? $banner_urls[0] : '';
|
217 |
+
|
218 |
+
?>
|
219 |
+
<div class="<?php echo $element_class; ?>"><a href="<?php echo $store_url; ?>"><img src="<?php echo $banner_image_url; ?>"></a> </div>
|
220 |
+
<?php
|
221 |
+
|
222 |
+
}
|
223 |
+
|
224 |
+
|
225 |
+
|
226 |
+
|
227 |
+
|
228 |
+
|
229 |
+
add_action('wcps_layout_element_css_dokan_store_name', 'wcps_layout_element_css_dokan_store_name', 10);
|
230 |
+
function wcps_layout_element_css_dokan_store_name($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 |
+
<style type="text/css">
|
245 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
246 |
+
<?php if(!empty($color)): ?>
|
247 |
+
color: <?php echo $color; ?>;
|
248 |
+
<?php endif; ?>
|
249 |
+
<?php if(!empty($font_size)): ?>
|
250 |
+
font-size: <?php echo $font_size; ?>;
|
251 |
+
<?php endif; ?>
|
252 |
+
<?php if(!empty($font_family)): ?>
|
253 |
+
font-family: <?php echo $font_family; ?>;
|
254 |
+
<?php endif; ?>
|
255 |
+
<?php if(!empty($margin)): ?>
|
256 |
+
margin: <?php echo $margin; ?>;
|
257 |
+
<?php endif; ?>
|
258 |
+
<?php if(!empty($text_align)): ?>
|
259 |
+
text-align: <?php echo $text_align; ?>;
|
260 |
+
<?php endif; ?>
|
261 |
+
}
|
262 |
+
</style>
|
263 |
+
<?php
|
264 |
+
}
|
265 |
+
|
266 |
+
add_action('wcps_layout_element_css_dokan_store_address', 'wcps_layout_element_css_dokan_store_address', 10);
|
267 |
+
function wcps_layout_element_css_dokan_store_address($args){
|
268 |
+
|
269 |
+
|
270 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
271 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
272 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
273 |
+
|
274 |
+
$color = isset($elementData['color']) ? $elementData['color'] : '';
|
275 |
+
$font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
|
276 |
+
$font_family = isset($elementData['font_family']) ? $elementData['font_family'] : '';
|
277 |
+
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
278 |
+
$text_align = isset($elementData['text_align']) ? $elementData['text_align'] : '';
|
279 |
+
|
280 |
+
?>
|
281 |
+
<style type="text/css">
|
282 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
283 |
+
<?php if(!empty($color)): ?>
|
284 |
+
color: <?php echo $color; ?>;
|
285 |
+
<?php endif; ?>
|
286 |
+
<?php if(!empty($font_size)): ?>
|
287 |
+
font-size: <?php echo $font_size; ?>;
|
288 |
+
<?php endif; ?>
|
289 |
+
<?php if(!empty($font_family)): ?>
|
290 |
+
font-family: <?php echo $font_family; ?>;
|
291 |
+
<?php endif; ?>
|
292 |
+
<?php if(!empty($margin)): ?>
|
293 |
+
margin: <?php echo $margin; ?>;
|
294 |
+
<?php endif; ?>
|
295 |
+
<?php if(!empty($text_align)): ?>
|
296 |
+
text-align: <?php echo $text_align; ?>;
|
297 |
+
<?php endif; ?>
|
298 |
+
}
|
299 |
+
</style>
|
300 |
+
<?php
|
301 |
+
}
|
302 |
+
|
303 |
+
|
304 |
+
|
305 |
+
add_action('wcps_layout_element_css_dokan_store_city', 'wcps_layout_element_css_dokan_store_city', 10);
|
306 |
+
function wcps_layout_element_css_dokan_store_city($args){
|
307 |
+
|
308 |
+
|
309 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
310 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
311 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
312 |
+
|
313 |
+
$color = isset($elementData['color']) ? $elementData['color'] : '';
|
314 |
+
$font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
|
315 |
+
$font_family = isset($elementData['font_family']) ? $elementData['font_family'] : '';
|
316 |
+
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
317 |
+
$text_align = isset($elementData['text_align']) ? $elementData['text_align'] : '';
|
318 |
+
|
319 |
+
?>
|
320 |
+
<style type="text/css">
|
321 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
322 |
+
<?php if(!empty($color)): ?>
|
323 |
+
color: <?php echo $color; ?>;
|
324 |
+
<?php endif; ?>
|
325 |
+
<?php if(!empty($font_size)): ?>
|
326 |
+
font-size: <?php echo $font_size; ?>;
|
327 |
+
<?php endif; ?>
|
328 |
+
<?php if(!empty($font_family)): ?>
|
329 |
+
font-family: <?php echo $font_family; ?>;
|
330 |
+
<?php endif; ?>
|
331 |
+
<?php if(!empty($margin)): ?>
|
332 |
+
margin: <?php echo $margin; ?>;
|
333 |
+
<?php endif; ?>
|
334 |
+
<?php if(!empty($text_align)): ?>
|
335 |
+
text-align: <?php echo $text_align; ?>;
|
336 |
+
<?php endif; ?>
|
337 |
+
}
|
338 |
+
</style>
|
339 |
+
<?php
|
340 |
+
}
|
341 |
+
|
342 |
+
|
343 |
+
|
344 |
+
|
345 |
+
add_action('wcps_layout_element_css_dokan_store_country', 'wcps_layout_element_css_dokan_store_country', 10);
|
346 |
+
function wcps_layout_element_css_dokan_store_country($args){
|
347 |
+
|
348 |
+
|
349 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
350 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
351 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
352 |
+
|
353 |
+
$color = isset($elementData['color']) ? $elementData['color'] : '';
|
354 |
+
$font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
|
355 |
+
$font_family = isset($elementData['font_family']) ? $elementData['font_family'] : '';
|
356 |
+
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
357 |
+
$text_align = isset($elementData['text_align']) ? $elementData['text_align'] : '';
|
358 |
+
|
359 |
+
?>
|
360 |
+
<style type="text/css">
|
361 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
362 |
+
<?php if(!empty($color)): ?>
|
363 |
+
color: <?php echo $color; ?>;
|
364 |
+
<?php endif; ?>
|
365 |
+
<?php if(!empty($font_size)): ?>
|
366 |
+
font-size: <?php echo $font_size; ?>;
|
367 |
+
<?php endif; ?>
|
368 |
+
<?php if(!empty($font_family)): ?>
|
369 |
+
font-family: <?php echo $font_family; ?>;
|
370 |
+
<?php endif; ?>
|
371 |
+
<?php if(!empty($margin)): ?>
|
372 |
+
margin: <?php echo $margin; ?>;
|
373 |
+
<?php endif; ?>
|
374 |
+
<?php if(!empty($text_align)): ?>
|
375 |
+
text-align: <?php echo $text_align; ?>;
|
376 |
+
<?php endif; ?>
|
377 |
+
}
|
378 |
+
</style>
|
379 |
+
<?php
|
380 |
+
}
|
381 |
+
|
382 |
+
|
383 |
+
add_action('wcps_layout_element_css_dokan_store_phone', 'wcps_layout_element_css_dokan_store_phone', 10);
|
384 |
+
function wcps_layout_element_css_dokan_store_phone($args){
|
385 |
+
|
386 |
+
|
387 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
388 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
389 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
390 |
+
|
391 |
+
$color = isset($elementData['color']) ? $elementData['color'] : '';
|
392 |
+
$font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
|
393 |
+
$font_family = isset($elementData['font_family']) ? $elementData['font_family'] : '';
|
394 |
+
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
395 |
+
$text_align = isset($elementData['text_align']) ? $elementData['text_align'] : '';
|
396 |
+
|
397 |
+
?>
|
398 |
+
<style type="text/css">
|
399 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
400 |
+
<?php if(!empty($color)): ?>
|
401 |
+
color: <?php echo $color; ?>;
|
402 |
+
<?php endif; ?>
|
403 |
+
<?php if(!empty($font_size)): ?>
|
404 |
+
font-size: <?php echo $font_size; ?>;
|
405 |
+
<?php endif; ?>
|
406 |
+
<?php if(!empty($font_family)): ?>
|
407 |
+
font-family: <?php echo $font_family; ?>;
|
408 |
+
<?php endif; ?>
|
409 |
+
<?php if(!empty($margin)): ?>
|
410 |
+
margin: <?php echo $margin; ?>;
|
411 |
+
<?php endif; ?>
|
412 |
+
<?php if(!empty($text_align)): ?>
|
413 |
+
text-align: <?php echo $text_align; ?>;
|
414 |
+
<?php endif; ?>
|
415 |
+
}
|
416 |
+
</style>
|
417 |
+
<?php
|
418 |
+
}
|
419 |
+
|
420 |
+
|
421 |
+
add_action('wcps_layout_element_css_dokan_banner', 'wcps_layout_element_css_dokan_banner', 10);
|
422 |
+
function wcps_layout_element_css_dokan_banner($args){
|
423 |
+
|
424 |
+
|
425 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
426 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
427 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
428 |
+
|
429 |
+
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
430 |
+
$text_align = isset($elementData['text_align']) ? $elementData['text_align'] : '';
|
431 |
+
$width = isset($elementData['width']) ? $elementData['width'] : '';
|
432 |
+
$height = isset($elementData['height']) ? $elementData['height'] : '';
|
433 |
+
|
434 |
+
?>
|
435 |
+
<style type="text/css">
|
436 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
437 |
+
<?php if(!empty($width)): ?>
|
438 |
+
width: <?php echo $width; ?>;
|
439 |
+
<?php endif; ?>
|
440 |
+
<?php if(!empty($height)): ?>
|
441 |
+
height: <?php echo $height; ?>;
|
442 |
+
<?php endif; ?>
|
443 |
+
<?php if(!empty($margin)): ?>
|
444 |
+
margin: <?php echo $margin; ?>;
|
445 |
+
<?php endif; ?>
|
446 |
+
<?php if(!empty($text_align)): ?>
|
447 |
+
text-align: <?php echo $text_align; ?>;
|
448 |
+
<?php endif; ?>
|
449 |
+
}
|
450 |
+
</style>
|
451 |
+
<?php
|
452 |
+
}
|
453 |
+
|
454 |
+
add_action('wcps_layout_element_css_dokan_avatar', 'wcps_layout_element_css_dokan_avatar', 10);
|
455 |
+
function wcps_layout_element_css_dokan_avatar($args){
|
456 |
+
|
457 |
+
|
458 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
459 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
460 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
461 |
+
|
462 |
+
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
463 |
+
$text_align = isset($elementData['text_align']) ? $elementData['text_align'] : '';
|
464 |
+
$width = isset($elementData['width']) ? $elementData['width'] : '';
|
465 |
+
|
466 |
+
?>
|
467 |
+
<style type="text/css">
|
468 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
469 |
+
<?php if(!empty($width)): ?>
|
470 |
+
width: <?php echo $width; ?>;
|
471 |
+
<?php endif; ?>
|
472 |
+
<?php if(!empty($margin)): ?>
|
473 |
+
margin: <?php echo $margin; ?>;
|
474 |
+
<?php endif; ?>
|
475 |
+
<?php if(!empty($text_align)): ?>
|
476 |
+
text-align: <?php echo $text_align; ?>;
|
477 |
+
<?php endif; ?>
|
478 |
+
}
|
479 |
+
</style>
|
480 |
+
<?php
|
481 |
+
}
|
includes/3rd-party/perfect-woocommerce-brands.php
ADDED
@@ -0,0 +1,124 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
+
|
4 |
+
add_filter('wcps_layout_elements', 'wcps_layout_elements_perfect_brands');
|
5 |
+
|
6 |
+
function wcps_layout_elements_perfect_brands($layout_elements){
|
7 |
+
|
8 |
+
|
9 |
+
$layout_elements['perfect_brands'] = array('name' =>__('Perfect brands','woocommerce-products-slider'));
|
10 |
+
|
11 |
+
return $layout_elements;
|
12 |
+
|
13 |
+
}
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
+
|
18 |
+
add_action('wcps_layout_elements_option_perfect_brands','wcps_layout_elements_option_perfect_brands');
|
19 |
+
function wcps_layout_elements_option_perfect_brands($parameters){
|
20 |
+
|
21 |
+
$settings_tabs_field = new settings_tabs_field();
|
22 |
+
|
23 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
24 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
25 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
26 |
+
|
27 |
+
|
28 |
+
|
29 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
30 |
+
|
31 |
+
?>
|
32 |
+
<div class="item">
|
33 |
+
<div class="element-title header ">
|
34 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
35 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
36 |
+
|
37 |
+
<span class="expand"><?php echo __('Perfect brands','woocommerce-products-slider'); ?></span>
|
38 |
+
</div>
|
39 |
+
<div class="element-options options">
|
40 |
+
|
41 |
+
<?php
|
42 |
+
|
43 |
+
$args = array(
|
44 |
+
'id' => 'margin',
|
45 |
+
'css_id' => $element_index.'_margin',
|
46 |
+
'parent' => $input_name.'[perfect_brands]',
|
47 |
+
'title' => __('Margin','woocommerce-products-slider'),
|
48 |
+
'details' => __('Set margin.','woocommerce-products-slider'),
|
49 |
+
'type' => 'text',
|
50 |
+
'value' => $margin,
|
51 |
+
'default' => '',
|
52 |
+
'placeholder' => '5px 0',
|
53 |
+
);
|
54 |
+
|
55 |
+
$settings_tabs_field->generate_field($args);
|
56 |
+
|
57 |
+
|
58 |
+
?>
|
59 |
+
|
60 |
+
</div>
|
61 |
+
</div>
|
62 |
+
<?php
|
63 |
+
|
64 |
+
}
|
65 |
+
|
66 |
+
|
67 |
+
|
68 |
+
|
69 |
+
add_action('wcps_layout_element_perfect_brands', 'wcps_layout_element_perfect_brands', 10);
|
70 |
+
function wcps_layout_element_perfect_brands($args){
|
71 |
+
|
72 |
+
//echo '<pre>'.var_export($args, true).'</pre>';
|
73 |
+
$product_id = isset($args['product_id']) ? $args['product_id'] : '';
|
74 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
75 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
76 |
+
|
77 |
+
$element_class = !empty($element_index) ? 'element-perfect_brands element-'.$element_index : 'element-perfect_brands';
|
78 |
+
|
79 |
+
//require PWB_PLUGIN_DIR.'classes/class-perfect-woocommerce-brands.php';
|
80 |
+
|
81 |
+
if(class_exists('Perfect_Woocommerce_Brands')){
|
82 |
+
$Perfect_Woocommerce_Brands = new Perfect_Woocommerce_Brands();
|
83 |
+
|
84 |
+
|
85 |
+
echo $Perfect_Woocommerce_Brands->show_brands_in_loop();
|
86 |
+
|
87 |
+
?>
|
88 |
+
<div class="<?php echo $element_class; ?>"><?php echo do_shortcode('[brand_shortcode id="'.$product_id.'" ]');; ?></div>
|
89 |
+
<?php
|
90 |
+
}
|
91 |
+
|
92 |
+
|
93 |
+
|
94 |
+
}
|
95 |
+
|
96 |
+
|
97 |
+
|
98 |
+
|
99 |
+
add_action('wcps_layout_element_css_perfect_brands', 'wcps_layout_element_css_perfect_brands', 10);
|
100 |
+
function wcps_layout_element_css_perfect_brands($args){
|
101 |
+
|
102 |
+
|
103 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
104 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
105 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
106 |
+
|
107 |
+
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
108 |
+
|
109 |
+
//echo '<pre>'.var_export($layout_id, true).'</pre>';
|
110 |
+
|
111 |
+
?>
|
112 |
+
<style type="text/css">
|
113 |
+
|
114 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
115 |
+
<?php if(!empty($margin)): ?>
|
116 |
+
margin: <?php echo $margin; ?>;
|
117 |
+
<?php endif; ?>
|
118 |
+
|
119 |
+
}
|
120 |
+
|
121 |
+
</style>
|
122 |
+
<?php
|
123 |
+
}
|
124 |
+
|
includes/3rd-party/ti-woocommerce-wishlist.php
ADDED
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
+
|
4 |
+
add_filter('wcps_layout_elements', 'wcps_layout_elements_ti_wishlist');
|
5 |
+
|
6 |
+
function wcps_layout_elements_ti_wishlist($layout_elements){
|
7 |
+
|
8 |
+
|
9 |
+
$layout_elements['ti_wishlist'] = array('name' =>__('TI Wishlist','woocommerce-products-slider'));
|
10 |
+
|
11 |
+
return $layout_elements;
|
12 |
+
|
13 |
+
}
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
+
|
18 |
+
add_action('wcps_layout_elements_option_ti_wishlist','wcps_layout_elements_option_ti_wishlist');
|
19 |
+
function wcps_layout_elements_option_ti_wishlist($parameters){
|
20 |
+
|
21 |
+
$settings_tabs_field = new settings_tabs_field();
|
22 |
+
|
23 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
24 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
25 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
26 |
+
|
27 |
+
|
28 |
+
|
29 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
30 |
+
|
31 |
+
?>
|
32 |
+
<div class="item">
|
33 |
+
<div class="element-title header ">
|
34 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
35 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
36 |
+
|
37 |
+
<span class="expand"><?php echo __('TI Wishlist','woocommerce-products-slider'); ?></span>
|
38 |
+
</div>
|
39 |
+
<div class="element-options options">
|
40 |
+
|
41 |
+
<?php
|
42 |
+
|
43 |
+
$args = array(
|
44 |
+
'id' => 'margin',
|
45 |
+
'css_id' => $element_index.'_margin',
|
46 |
+
'parent' => $input_name.'[ti_wishlist]',
|
47 |
+
'title' => __('Margin','woocommerce-products-slider'),
|
48 |
+
'details' => __('Set margin.','woocommerce-products-slider'),
|
49 |
+
'type' => 'text',
|
50 |
+
'value' => $margin,
|
51 |
+
'default' => '',
|
52 |
+
'placeholder' => '5px 0',
|
53 |
+
);
|
54 |
+
|
55 |
+
$settings_tabs_field->generate_field($args);
|
56 |
+
|
57 |
+
|
58 |
+
?>
|
59 |
+
|
60 |
+
</div>
|
61 |
+
</div>
|
62 |
+
<?php
|
63 |
+
|
64 |
+
}
|
65 |
+
|
66 |
+
|
67 |
+
|
68 |
+
|
69 |
+
add_action('wcps_layout_element_ti_wishlist', 'wcps_layout_element_ti_wishlist', 10);
|
70 |
+
function wcps_layout_element_ti_wishlist($args){
|
71 |
+
|
72 |
+
//echo '<pre>'.var_export($args, true).'</pre>';
|
73 |
+
$product_id = isset($args['product_id']) ? $args['product_id'] : '';
|
74 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
75 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
76 |
+
|
77 |
+
$element_class = !empty($element_index) ? 'element-ti_wishlist element-'.$element_index : 'element-ti_wishlist';
|
78 |
+
|
79 |
+
|
80 |
+
|
81 |
+
?>
|
82 |
+
<div class="<?php echo $element_class; ?>"><?php echo do_shortcode('[ti_wishlists_addtowishlist id="'.$product_id.'"]'); ?></div>
|
83 |
+
<?php
|
84 |
+
|
85 |
+
|
86 |
+
|
87 |
+
}
|
88 |
+
|
89 |
+
|
90 |
+
|
91 |
+
|
92 |
+
add_action('wcps_layout_element_css_ti_wishlist', 'wcps_layout_element_css_ti_wishlist', 10);
|
93 |
+
function wcps_layout_element_css_ti_wishlist($args){
|
94 |
+
|
95 |
+
|
96 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
97 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
98 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
99 |
+
|
100 |
+
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
101 |
+
|
102 |
+
//echo '<pre>'.var_export($layout_id, true).'</pre>';
|
103 |
+
|
104 |
+
?>
|
105 |
+
<style type="text/css">
|
106 |
+
|
107 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
108 |
+
<?php if(!empty($margin)): ?>
|
109 |
+
margin: <?php echo $margin; ?>;
|
110 |
+
<?php endif; ?>
|
111 |
+
|
112 |
+
}
|
113 |
+
|
114 |
+
</style>
|
115 |
+
<?php
|
116 |
+
}
|
117 |
+
|
includes/3rd-party/wish-list-for-woocommerce.php
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
+
|
4 |
+
add_filter('wcps_layout_elements', 'wcps_layout_elements_wishlist_for_wc');
|
5 |
+
|
6 |
+
function wcps_layout_elements_wishlist_for_wc($layout_elements){
|
7 |
+
|
8 |
+
|
9 |
+
$layout_elements['wishlist_for_wc'] = array('name' =>__('WishList for WooCommerce','woocommerce-products-slider'));
|
10 |
+
|
11 |
+
return $layout_elements;
|
12 |
+
|
13 |
+
}
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
+
|
18 |
+
add_action('wcps_layout_elements_option_wishlist_for_wc','wcps_layout_elements_option_wishlist_for_wc');
|
19 |
+
function wcps_layout_elements_option_wishlist_for_wc($parameters){
|
20 |
+
|
21 |
+
$settings_tabs_field = new settings_tabs_field();
|
22 |
+
|
23 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
24 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
25 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
26 |
+
|
27 |
+
|
28 |
+
|
29 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
30 |
+
|
31 |
+
?>
|
32 |
+
<div class="item">
|
33 |
+
<div class="element-title header ">
|
34 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
35 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
36 |
+
|
37 |
+
<span class="expand"><?php echo __('WishList for WooCommerce','woocommerce-products-slider'); ?></span>
|
38 |
+
</div>
|
39 |
+
<div class="element-options options">
|
40 |
+
|
41 |
+
<?php
|
42 |
+
|
43 |
+
$args = array(
|
44 |
+
'id' => 'margin',
|
45 |
+
'css_id' => $element_index.'_margin',
|
46 |
+
'parent' => $input_name.'[wishlist_for_wc]',
|
47 |
+
'title' => __('Margin','woocommerce-products-slider'),
|
48 |
+
'details' => __('Set margin.','woocommerce-products-slider'),
|
49 |
+
'type' => 'text',
|
50 |
+
'value' => $margin,
|
51 |
+
'default' => '',
|
52 |
+
'placeholder' => '5px 0',
|
53 |
+
);
|
54 |
+
|
55 |
+
$settings_tabs_field->generate_field($args);
|
56 |
+
|
57 |
+
|
58 |
+
?>
|
59 |
+
|
60 |
+
</div>
|
61 |
+
</div>
|
62 |
+
<?php
|
63 |
+
|
64 |
+
}
|
65 |
+
|
66 |
+
|
67 |
+
|
68 |
+
|
69 |
+
add_action('wcps_layout_element_wishlist_for_wc', 'wcps_layout_element_wishlist_for_wc', 10);
|
70 |
+
function wcps_layout_element_wishlist_for_wc($args){
|
71 |
+
|
72 |
+
//echo '<pre>'.var_export($args, true).'</pre>';
|
73 |
+
$product_id = isset($args['product_id']) ? $args['product_id'] : '';
|
74 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
75 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
76 |
+
|
77 |
+
$element_class = !empty($element_index) ? 'element-wishlist_for_wc element-'.$element_index : 'element-wishlist_for_wc';
|
78 |
+
|
79 |
+
|
80 |
+
if ( class_exists( 'Alg_WC_Wish_List_Toggle_Btn' ) ) {
|
81 |
+
$Alg_WC_Wish_List_Toggle_Btn = new Alg_WC_Wish_List_Toggle_Btn();
|
82 |
+
|
83 |
+
?>
|
84 |
+
<div class="<?php echo $element_class; ?>"><?php echo $Alg_WC_Wish_List_Toggle_Btn->show_default_btn(); ?></div>
|
85 |
+
<?php
|
86 |
+
}
|
87 |
+
|
88 |
+
|
89 |
+
|
90 |
+
}
|
91 |
+
|
92 |
+
|
93 |
+
|
94 |
+
|
95 |
+
add_action('wcps_layout_element_css_wishlist_for_wc', 'wcps_layout_element_css_wishlist_for_wc', 10);
|
96 |
+
function wcps_layout_element_css_wishlist_for_wc($args){
|
97 |
+
|
98 |
+
|
99 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
100 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
101 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
102 |
+
|
103 |
+
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
104 |
+
|
105 |
+
//echo '<pre>'.var_export($layout_id, true).'</pre>';
|
106 |
+
|
107 |
+
?>
|
108 |
+
<style type="text/css">
|
109 |
+
|
110 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
111 |
+
<?php if(!empty($margin)): ?>
|
112 |
+
margin: <?php echo $margin; ?>;
|
113 |
+
<?php endif; ?>
|
114 |
+
|
115 |
+
}
|
116 |
+
|
117 |
+
</style>
|
118 |
+
<?php
|
119 |
+
}
|
120 |
+
|
includes/3rd-party/wishlist.php
ADDED
@@ -0,0 +1,220 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
+
|
4 |
+
add_filter('wcps_layout_elements', 'wcps_layout_elements_wishlist');
|
5 |
+
|
6 |
+
function wcps_layout_elements_wishlist($layout_elements){
|
7 |
+
|
8 |
+
|
9 |
+
$layout_elements['wishlist'] = array('name' =>__('Wishlist','woocommerce-products-slider'));
|
10 |
+
|
11 |
+
return $layout_elements;
|
12 |
+
|
13 |
+
}
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
+
|
18 |
+
add_action('wcps_layout_elements_option_wishlist','wcps_layout_elements_option_wishlist');
|
19 |
+
function wcps_layout_elements_option_wishlist($parameters){
|
20 |
+
|
21 |
+
$settings_tabs_field = new settings_tabs_field();
|
22 |
+
|
23 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
24 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
25 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
26 |
+
|
27 |
+
|
28 |
+
$label_text = isset($element_data['label_text']) ? $element_data['label_text'] : '';
|
29 |
+
|
30 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
31 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
32 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
33 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
34 |
+
$background_color = isset($element_data['background_color']) ? $element_data['background_color'] : '';
|
35 |
+
$padding = isset($element_data['padding']) ? $element_data['padding'] : '';
|
36 |
+
|
37 |
+
?>
|
38 |
+
<div class="item">
|
39 |
+
<div class="element-title header ">
|
40 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
41 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
42 |
+
|
43 |
+
<span class="expand"><?php echo __('Wishlist','woocommerce-products-slider'); ?></span>
|
44 |
+
</div>
|
45 |
+
<div class="element-options options">
|
46 |
+
|
47 |
+
<?php
|
48 |
+
|
49 |
+
$args = array(
|
50 |
+
'id' => 'font_size',
|
51 |
+
'css_id' => $element_index.'_font_size',
|
52 |
+
'parent' => $input_name.'[wishlist]',
|
53 |
+
'title' => __('Font size','woocommerce-products-slider'),
|
54 |
+
'details' => __('Choose font size.','woocommerce-products-slider'),
|
55 |
+
'type' => 'text',
|
56 |
+
'value' => $font_size,
|
57 |
+
'default' => '',
|
58 |
+
'placeholder' => '16px',
|
59 |
+
|
60 |
+
);
|
61 |
+
|
62 |
+
$settings_tabs_field->generate_field($args);
|
63 |
+
|
64 |
+
|
65 |
+
$args = array(
|
66 |
+
'id' => 'font_family',
|
67 |
+
'css_id' => $element_index.'_font_family',
|
68 |
+
'parent' => $input_name.'[wishlist]',
|
69 |
+
'title' => __('Font family','woocommerce-products-slider'),
|
70 |
+
'details' => __('Set font family.','woocommerce-products-slider'),
|
71 |
+
'type' => 'text',
|
72 |
+
'value' => $font_family,
|
73 |
+
'default' => '',
|
74 |
+
'placeholder' => 'Open Sans',
|
75 |
+
);
|
76 |
+
|
77 |
+
$settings_tabs_field->generate_field($args);
|
78 |
+
|
79 |
+
|
80 |
+
$args = array(
|
81 |
+
'id' => 'color',
|
82 |
+
'css_id' => $element_index.'_content_color',
|
83 |
+
'parent' => $input_name.'[wishlist]',
|
84 |
+
'title' => __('Color','woocommerce-products-slider'),
|
85 |
+
'details' => __('Title text color.','woocommerce-products-slider'),
|
86 |
+
'type' => 'colorpicker',
|
87 |
+
'value' => $color,
|
88 |
+
'default' => '',
|
89 |
+
);
|
90 |
+
|
91 |
+
$settings_tabs_field->generate_field($args);
|
92 |
+
|
93 |
+
$args = array(
|
94 |
+
'id' => 'background_color',
|
95 |
+
'css_id' => $element_index.'_background_color',
|
96 |
+
'parent' => $input_name.'[wishlist]',
|
97 |
+
'title' => __('Background color','woocommerce-products-slider'),
|
98 |
+
'details' => __('Choose background color.','woocommerce-products-slider'),
|
99 |
+
'type' => 'colorpicker',
|
100 |
+
'value' => $background_color,
|
101 |
+
'default' => '',
|
102 |
+
);
|
103 |
+
|
104 |
+
$settings_tabs_field->generate_field($args);
|
105 |
+
|
106 |
+
|
107 |
+
$args = array(
|
108 |
+
'id' => 'margin',
|
109 |
+
'css_id' => $element_index.'_margin',
|
110 |
+
'parent' => $input_name.'[wishlist]',
|
111 |
+
'title' => __('Margin','woocommerce-products-slider'),
|
112 |
+
'details' => __('Set margin.','woocommerce-products-slider'),
|
113 |
+
'type' => 'text',
|
114 |
+
'value' => $margin,
|
115 |
+
'default' => '',
|
116 |
+
'placeholder' => '5px 0',
|
117 |
+
);
|
118 |
+
|
119 |
+
$settings_tabs_field->generate_field($args);
|
120 |
+
|
121 |
+
|
122 |
+
$args = array(
|
123 |
+
'id' => 'padding',
|
124 |
+
'css_id' => $element_index.'_padding',
|
125 |
+
'parent' => $input_name.'[wishlist]',
|
126 |
+
'title' => __('Padding','woocommerce-products-slider'),
|
127 |
+
'details' => __('Set padding.','woocommerce-products-slider'),
|
128 |
+
'type' => 'text',
|
129 |
+
'value' => $padding,
|
130 |
+
'default' => '',
|
131 |
+
'placeholder' => '5px 0',
|
132 |
+
);
|
133 |
+
|
134 |
+
$settings_tabs_field->generate_field($args);
|
135 |
+
|
136 |
+
|
137 |
+
?>
|
138 |
+
|
139 |
+
</div>
|
140 |
+
</div>
|
141 |
+
<?php
|
142 |
+
|
143 |
+
}
|
144 |
+
|
145 |
+
|
146 |
+
|
147 |
+
|
148 |
+
add_action('wcps_layout_element_wishlist', 'wcps_layout_element_wishlist', 10);
|
149 |
+
function wcps_layout_element_wishlist($args){
|
150 |
+
|
151 |
+
//echo '<pre>'.var_export($args, true).'</pre>';
|
152 |
+
$product_id = isset($args['product_id']) ? $args['product_id'] : '';
|
153 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
154 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
155 |
+
|
156 |
+
$element_class = !empty($element_index) ? 'element-wishlist element-'.$element_index : 'element-wishlist';
|
157 |
+
|
158 |
+
?>
|
159 |
+
<div class="<?php echo $element_class; ?>"><?php echo do_shortcode('[wishlist_button id="'.$product_id.'" ]');; ?></div>
|
160 |
+
<?php
|
161 |
+
|
162 |
+
}
|
163 |
+
|
164 |
+
|
165 |
+
|
166 |
+
|
167 |
+
add_action('wcps_layout_element_css_wishlist', 'wcps_layout_element_css_wishlist', 10);
|
168 |
+
function wcps_layout_element_css_wishlist($args){
|
169 |
+
|
170 |
+
|
171 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
172 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
173 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
174 |
+
|
175 |
+
$color = isset($elementData['color']) ? $elementData['color'] : '';
|
176 |
+
$background_color = isset($elementData['background_color']) ? $elementData['background_color'] : '';
|
177 |
+
|
178 |
+
$font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
|
179 |
+
$font_family = isset($elementData['font_family']) ? $elementData['font_family'] : '';
|
180 |
+
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
181 |
+
$text_align = isset($elementData['text_align']) ? $elementData['text_align'] : '';
|
182 |
+
$padding = isset($elementData['padding']) ? $elementData['padding'] : '';
|
183 |
+
|
184 |
+
|
185 |
+
//echo '<pre>'.var_export($layout_id, true).'</pre>';
|
186 |
+
|
187 |
+
?>
|
188 |
+
<style type="text/css">
|
189 |
+
|
190 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
191 |
+
<?php if(!empty($margin)): ?>
|
192 |
+
margin: <?php echo $margin; ?>;
|
193 |
+
<?php endif; ?>
|
194 |
+
|
195 |
+
}
|
196 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?> a{
|
197 |
+
<?php if(!empty($color)): ?>
|
198 |
+
color: <?php echo $color; ?>;
|
199 |
+
<?php endif; ?>
|
200 |
+
text-decoration: none;
|
201 |
+
<?php if(!empty($font_size)): ?>
|
202 |
+
font-size: <?php echo $font_size; ?>;
|
203 |
+
<?php endif; ?>
|
204 |
+
<?php if(!empty($font_family)): ?>
|
205 |
+
font-family: <?php echo $font_family; ?>;
|
206 |
+
<?php endif; ?>
|
207 |
+
<?php if(!empty($padding)): ?>
|
208 |
+
padding: <?php echo $padding; ?>;
|
209 |
+
<?php endif; ?>
|
210 |
+
<?php if(!empty($background_color)): ?>
|
211 |
+
background-color: <?php echo $background_color; ?>;
|
212 |
+
<?php endif; ?>
|
213 |
+
<?php if(!empty($text_align)): ?>
|
214 |
+
text-align: <?php echo $text_align; ?>;
|
215 |
+
<?php endif; ?>
|
216 |
+
}
|
217 |
+
</style>
|
218 |
+
<?php
|
219 |
+
}
|
220 |
+
|
includes/3rd-party/woo-smart-compare.php
ADDED
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
+
|
4 |
+
add_filter('wcps_layout_elements', 'wcps_layout_elements_woo_smart_compare');
|
5 |
+
|
6 |
+
function wcps_layout_elements_woo_smart_compare($layout_elements){
|
7 |
+
|
8 |
+
|
9 |
+
$layout_elements['woo_smart_compare'] = array('name' =>__('WPC Smart Compare','woocommerce-products-slider'));
|
10 |
+
|
11 |
+
return $layout_elements;
|
12 |
+
|
13 |
+
}
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
+
|
18 |
+
add_action('wcps_layout_elements_option_woo_smart_compare','wcps_layout_elements_option_woo_smart_compare');
|
19 |
+
function wcps_layout_elements_option_woo_smart_compare($parameters){
|
20 |
+
|
21 |
+
$settings_tabs_field = new settings_tabs_field();
|
22 |
+
|
23 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
24 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
25 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
26 |
+
|
27 |
+
|
28 |
+
|
29 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
30 |
+
|
31 |
+
?>
|
32 |
+
<div class="item">
|
33 |
+
<div class="element-title header ">
|
34 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
35 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
36 |
+
|
37 |
+
<span class="expand"><?php echo __('WPC Smart Compare','woocommerce-products-slider'); ?></span>
|
38 |
+
</div>
|
39 |
+
<div class="element-options options">
|
40 |
+
|
41 |
+
<?php
|
42 |
+
|
43 |
+
$args = array(
|
44 |
+
'id' => 'margin',
|
45 |
+
'css_id' => $element_index.'_margin',
|
46 |
+
'parent' => $input_name.'[woo_smart_compare]',
|
47 |
+
'title' => __('Margin','woocommerce-products-slider'),
|
48 |
+
'details' => __('Set margin.','woocommerce-products-slider'),
|
49 |
+
'type' => 'text',
|
50 |
+
'value' => $margin,
|
51 |
+
'default' => '',
|
52 |
+
'placeholder' => '5px 0',
|
53 |
+
);
|
54 |
+
|
55 |
+
$settings_tabs_field->generate_field($args);
|
56 |
+
|
57 |
+
|
58 |
+
?>
|
59 |
+
|
60 |
+
</div>
|
61 |
+
</div>
|
62 |
+
<?php
|
63 |
+
|
64 |
+
}
|
65 |
+
|
66 |
+
|
67 |
+
|
68 |
+
|
69 |
+
add_action('wcps_layout_element_woo_smart_compare', 'wcps_layout_element_woo_smart_compare', 10);
|
70 |
+
function wcps_layout_element_woo_smart_compare($args){
|
71 |
+
|
72 |
+
//echo '<pre>'.var_export($args, true).'</pre>';
|
73 |
+
$product_id = isset($args['product_id']) ? $args['product_id'] : '';
|
74 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
75 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
76 |
+
|
77 |
+
$element_class = !empty($element_index) ? 'element-woo_smart_compare element-'.$element_index : 'element-woo_smart_compare';
|
78 |
+
|
79 |
+
?>
|
80 |
+
<div class="<?php echo $element_class; ?>"><?php echo do_shortcode('[wooscp id="'.$product_id.'" ]');; ?></div>
|
81 |
+
<?php
|
82 |
+
|
83 |
+
}
|
84 |
+
|
85 |
+
|
86 |
+
|
87 |
+
|
88 |
+
add_action('wcps_layout_element_css_woo_smart_compare', 'wcps_layout_element_css_woo_smart_compare', 10);
|
89 |
+
function wcps_layout_element_css_woo_smart_compare($args){
|
90 |
+
|
91 |
+
|
92 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
93 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
94 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
95 |
+
|
96 |
+
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
97 |
+
|
98 |
+
//echo '<pre>'.var_export($layout_id, true).'</pre>';
|
99 |
+
|
100 |
+
?>
|
101 |
+
<style type="text/css">
|
102 |
+
|
103 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
104 |
+
<?php if(!empty($margin)): ?>
|
105 |
+
margin: <?php echo $margin; ?>;
|
106 |
+
<?php endif; ?>
|
107 |
+
|
108 |
+
}
|
109 |
+
|
110 |
+
</style>
|
111 |
+
<?php
|
112 |
+
}
|
113 |
+
|
includes/3rd-party/woo-smart-quick-view.php
ADDED
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
+
|
4 |
+
add_filter('wcps_layout_elements', 'wcps_layout_elements_woo_smart_quick_view');
|
5 |
+
|
6 |
+
function wcps_layout_elements_woo_smart_quick_view($layout_elements){
|
7 |
+
|
8 |
+
|
9 |
+
$layout_elements['woo_smart_quick_view'] = array('name' =>__('WPClever quick view','woocommerce-products-slider'));
|
10 |
+
|
11 |
+
return $layout_elements;
|
12 |
+
|
13 |
+
}
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
+
|
18 |
+
add_action('wcps_layout_elements_option_woo_smart_quick_view','wcps_layout_elements_option_woo_smart_quick_view');
|
19 |
+
function wcps_layout_elements_option_woo_smart_quick_view($parameters){
|
20 |
+
|
21 |
+
$settings_tabs_field = new settings_tabs_field();
|
22 |
+
|
23 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
24 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
25 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
26 |
+
|
27 |
+
|
28 |
+
|
29 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
30 |
+
|
31 |
+
?>
|
32 |
+
<div class="item">
|
33 |
+
<div class="element-title header ">
|
34 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
35 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
36 |
+
|
37 |
+
<span class="expand"><?php echo __('WPClever quick view','woocommerce-products-slider'); ?></span>
|
38 |
+
</div>
|
39 |
+
<div class="element-options options">
|
40 |
+
|
41 |
+
<?php
|
42 |
+
|
43 |
+
$args = array(
|
44 |
+
'id' => 'margin',
|
45 |
+
'css_id' => $element_index.'_margin',
|
46 |
+
'parent' => $input_name.'[woo_smart_quick_view]',
|
47 |
+
'title' => __('Margin','woocommerce-products-slider'),
|
48 |
+
'details' => __('Set margin.','woocommerce-products-slider'),
|
49 |
+
'type' => 'text',
|
50 |
+
'value' => $margin,
|
51 |
+
'default' => '',
|
52 |
+
'placeholder' => '5px 0',
|
53 |
+
);
|
54 |
+
|
55 |
+
$settings_tabs_field->generate_field($args);
|
56 |
+
|
57 |
+
|
58 |
+
?>
|
59 |
+
|
60 |
+
</div>
|
61 |
+
</div>
|
62 |
+
<?php
|
63 |
+
|
64 |
+
}
|
65 |
+
|
66 |
+
|
67 |
+
|
68 |
+
|
69 |
+
add_action('wcps_layout_element_woo_smart_quick_view', 'wcps_layout_element_woo_smart_quick_view', 10);
|
70 |
+
function wcps_layout_element_woo_smart_quick_view($args){
|
71 |
+
|
72 |
+
//echo '<pre>'.var_export($args, true).'</pre>';
|
73 |
+
$product_id = isset($args['product_id']) ? $args['product_id'] : '';
|
74 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
75 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
76 |
+
|
77 |
+
$element_class = !empty($element_index) ? 'element-woo_smart_quick_view element-'.$element_index : 'element-woo_smart_quick_view';
|
78 |
+
|
79 |
+
?>
|
80 |
+
<div class="<?php echo $element_class; ?>"><?php echo do_shortcode('[woosq id="'.$product_id.'" ]');; ?></div>
|
81 |
+
<?php
|
82 |
+
|
83 |
+
}
|
84 |
+
|
85 |
+
|
86 |
+
|
87 |
+
|
88 |
+
add_action('wcps_layout_element_css_woo_smart_quick_view', 'wcps_layout_element_css_woo_smart_quick_view', 10);
|
89 |
+
function wcps_layout_element_css_woo_smart_quick_view($args){
|
90 |
+
|
91 |
+
|
92 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
93 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
94 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
95 |
+
|
96 |
+
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
97 |
+
|
98 |
+
//echo '<pre>'.var_export($layout_id, true).'</pre>';
|
99 |
+
|
100 |
+
?>
|
101 |
+
<style type="text/css">
|
102 |
+
|
103 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
104 |
+
<?php if(!empty($margin)): ?>
|
105 |
+
margin: <?php echo $margin; ?>;
|
106 |
+
<?php endif; ?>
|
107 |
+
|
108 |
+
}
|
109 |
+
|
110 |
+
</style>
|
111 |
+
<?php
|
112 |
+
}
|
113 |
+
|
includes/3rd-party/woo-smart-wishlist.php
ADDED
@@ -0,0 +1,113 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
+
|
4 |
+
add_filter('wcps_layout_elements', 'wcps_layout_elements_woo_smart_wishlist');
|
5 |
+
|
6 |
+
function wcps_layout_elements_woo_smart_wishlist($layout_elements){
|
7 |
+
|
8 |
+
|
9 |
+
$layout_elements['woo_smart_wishlist'] = array('name' =>__('WPClever wishlist','woocommerce-products-slider'));
|
10 |
+
|
11 |
+
return $layout_elements;
|
12 |
+
|
13 |
+
}
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
+
|
18 |
+
add_action('wcps_layout_elements_option_woo_smart_wishlist','wcps_layout_elements_option_woo_smart_wishlist');
|
19 |
+
function wcps_layout_elements_option_woo_smart_wishlist($parameters){
|
20 |
+
|
21 |
+
$settings_tabs_field = new settings_tabs_field();
|
22 |
+
|
23 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
24 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
25 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
26 |
+
|
27 |
+
|
28 |
+
|
29 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
30 |
+
|
31 |
+
?>
|
32 |
+
<div class="item">
|
33 |
+
<div class="element-title header ">
|
34 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
35 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
36 |
+
|
37 |
+
<span class="expand"><?php echo __('WPClever wishlist','woocommerce-products-slider'); ?></span>
|
38 |
+
</div>
|
39 |
+
<div class="element-options options">
|
40 |
+
|
41 |
+
<?php
|
42 |
+
|
43 |
+
$args = array(
|
44 |
+
'id' => 'margin',
|
45 |
+
'css_id' => $element_index.'_margin',
|
46 |
+
'parent' => $input_name.'[woo_smart_wishlist]',
|
47 |
+
'title' => __('Margin','woocommerce-products-slider'),
|
48 |
+
'details' => __('Set margin.','woocommerce-products-slider'),
|
49 |
+
'type' => 'text',
|
50 |
+
'value' => $margin,
|
51 |
+
'default' => '',
|
52 |
+
'placeholder' => '5px 0',
|
53 |
+
);
|
54 |
+
|
55 |
+
$settings_tabs_field->generate_field($args);
|
56 |
+
|
57 |
+
|
58 |
+
?>
|
59 |
+
|
60 |
+
</div>
|
61 |
+
</div>
|
62 |
+
<?php
|
63 |
+
|
64 |
+
}
|
65 |
+
|
66 |
+
|
67 |
+
|
68 |
+
|
69 |
+
add_action('wcps_layout_element_woo_smart_wishlist', 'wcps_layout_element_woo_smart_wishlist', 10);
|
70 |
+
function wcps_layout_element_woo_smart_wishlist($args){
|
71 |
+
|
72 |
+
//echo '<pre>'.var_export($args, true).'</pre>';
|
73 |
+
$product_id = isset($args['product_id']) ? $args['product_id'] : '';
|
74 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
75 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
76 |
+
|
77 |
+
$element_class = !empty($element_index) ? 'element-woo_smart_wishlist element-'.$element_index : 'element-woo_smart_wishlist';
|
78 |
+
|
79 |
+
?>
|
80 |
+
<div class="<?php echo $element_class; ?>"><?php echo do_shortcode('[woosw id="'.$product_id.'" ]');; ?></div>
|
81 |
+
<?php
|
82 |
+
|
83 |
+
}
|
84 |
+
|
85 |
+
|
86 |
+
|
87 |
+
|
88 |
+
add_action('wcps_layout_element_css_woo_smart_wishlist', 'wcps_layout_element_css_woo_smart_wishlist', 10);
|
89 |
+
function wcps_layout_element_css_woo_smart_wishlist($args){
|
90 |
+
|
91 |
+
|
92 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
93 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
94 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
95 |
+
|
96 |
+
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
97 |
+
|
98 |
+
//echo '<pre>'.var_export($layout_id, true).'</pre>';
|
99 |
+
|
100 |
+
?>
|
101 |
+
<style type="text/css">
|
102 |
+
|
103 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
104 |
+
<?php if(!empty($margin)): ?>
|
105 |
+
margin: <?php echo $margin; ?>;
|
106 |
+
<?php endif; ?>
|
107 |
+
|
108 |
+
}
|
109 |
+
|
110 |
+
</style>
|
111 |
+
<?php
|
112 |
+
}
|
113 |
+
|
includes/3rd-party/wpc-countdown-timer.php
ADDED
@@ -0,0 +1,120 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
+
|
4 |
+
add_filter('wcps_layout_elements', 'wcps_layout_elements_wpc_countdown_timer');
|
5 |
+
|
6 |
+
function wcps_layout_elements_wpc_countdown_timer($layout_elements){
|
7 |
+
|
8 |
+
|
9 |
+
$layout_elements['wpc_countdown_timer'] = array('name' =>__('WPC countdown','woocommerce-products-slider'));
|
10 |
+
|
11 |
+
return $layout_elements;
|
12 |
+
|
13 |
+
}
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
+
|
18 |
+
add_action('wcps_layout_elements_option_wpc_countdown_timer','wcps_layout_elements_option_wpc_countdown_timer');
|
19 |
+
function wcps_layout_elements_option_wpc_countdown_timer($parameters){
|
20 |
+
|
21 |
+
$settings_tabs_field = new settings_tabs_field();
|
22 |
+
|
23 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
24 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
25 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
26 |
+
|
27 |
+
|
28 |
+
|
29 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
30 |
+
|
31 |
+
?>
|
32 |
+
<div class="item">
|
33 |
+
<div class="element-title header ">
|
34 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
35 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
36 |
+
|
37 |
+
<span class="expand"><?php echo __('WPC countdown','woocommerce-products-slider'); ?></span>
|
38 |
+
</div>
|
39 |
+
<div class="element-options options">
|
40 |
+
|
41 |
+
<?php
|
42 |
+
|
43 |
+
$args = array(
|
44 |
+
'id' => 'margin',
|
45 |
+
'css_id' => $element_index.'_margin',
|
46 |
+
'parent' => $input_name.'[wpc_countdown_timer]',
|
47 |
+
'title' => __('Margin','woocommerce-products-slider'),
|
48 |
+
'details' => __('Set margin.','woocommerce-products-slider'),
|
49 |
+
'type' => 'text',
|
50 |
+
'value' => $margin,
|
51 |
+
'default' => '',
|
52 |
+
'placeholder' => '5px 0',
|
53 |
+
);
|
54 |
+
|
55 |
+
$settings_tabs_field->generate_field($args);
|
56 |
+
|
57 |
+
|
58 |
+
?>
|
59 |
+
|
60 |
+
</div>
|
61 |
+
</div>
|
62 |
+
<?php
|
63 |
+
|
64 |
+
}
|
65 |
+
|
66 |
+
|
67 |
+
|
68 |
+
|
69 |
+
add_action('wcps_layout_element_wpc_countdown_timer', 'wcps_layout_element_wpc_countdown_timer', 10);
|
70 |
+
function wcps_layout_element_wpc_countdown_timer($args){
|
71 |
+
|
72 |
+
//echo '<pre>'.var_export($args, true).'</pre>';
|
73 |
+
$product_id = isset($args['product_id']) ? $args['product_id'] : '';
|
74 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
75 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
76 |
+
|
77 |
+
$element_class = !empty($element_index) ? 'element-wpc_countdown_timer element-'.$element_index : 'element-wpc_countdown_timer';
|
78 |
+
|
79 |
+
if(class_exists( 'WPCleverWooct' )){
|
80 |
+
$WPCleverWooct = new WPCleverWooct();
|
81 |
+
$wooct_action_show_countdown = $WPCleverWooct->wooct_action_show_countdown();
|
82 |
+
|
83 |
+
|
84 |
+
?>
|
85 |
+
<div class="<?php echo $element_class; ?>"><?php echo $wooct_action_show_countdown; ?></div>
|
86 |
+
<?php
|
87 |
+
}
|
88 |
+
|
89 |
+
|
90 |
+
}
|
91 |
+
|
92 |
+
|
93 |
+
|
94 |
+
|
95 |
+
add_action('wcps_layout_element_css_wpc_countdown_timer', 'wcps_layout_element_css_wpc_countdown_timer', 10);
|
96 |
+
function wcps_layout_element_css_wpc_countdown_timer($args){
|
97 |
+
|
98 |
+
|
99 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
100 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
101 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
102 |
+
|
103 |
+
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
104 |
+
|
105 |
+
//echo '<pre>'.var_export($layout_id, true).'</pre>';
|
106 |
+
|
107 |
+
?>
|
108 |
+
<style type="text/css">
|
109 |
+
|
110 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
111 |
+
<?php if(!empty($margin)): ?>
|
112 |
+
margin: <?php echo $margin; ?>;
|
113 |
+
<?php endif; ?>
|
114 |
+
|
115 |
+
}
|
116 |
+
|
117 |
+
</style>
|
118 |
+
<?php
|
119 |
+
}
|
120 |
+
|
includes/class-metabox-wcps-hook.php
CHANGED
@@ -391,6 +391,8 @@ function wcps_metabox_content_layouts($post_id){
|
|
391 |
$wcps_options = get_post_meta($post_id,'wcps_options', true);
|
392 |
$item_layout_id = !empty($wcps_options['item_layout_id']) ? $wcps_options['item_layout_id'] : wcps_first_wcps_layout();
|
393 |
|
|
|
|
|
394 |
|
395 |
|
396 |
?>
|
@@ -410,6 +412,12 @@ function wcps_metabox_content_layouts($post_id){
|
|
410 |
<p><a target="_blank" class="button" href="<?php echo admin_url().'edit.php?post_type=wcps_layout'; ?>"><?php echo __('Manage layouts','woocommerce-products-slider'); ?></a> </p>
|
411 |
|
412 |
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
413 |
|
414 |
|
415 |
$html = ob_get_clean();
|
@@ -993,6 +1001,518 @@ if(!function_exists('wcps_metabox_content_query_product')) {
|
|
993 |
|
994 |
|
995 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
996 |
add_action('wcps_metabox_content_slider_options', 'wcps_metabox_content_slider_options');
|
997 |
|
998 |
if(!function_exists('wcps_metabox_content_slider_options')) {
|
391 |
$wcps_options = get_post_meta($post_id,'wcps_options', true);
|
392 |
$item_layout_id = !empty($wcps_options['item_layout_id']) ? $wcps_options['item_layout_id'] : wcps_first_wcps_layout();
|
393 |
|
394 |
+
$wcps_plugin_info = get_option('wcps_plugin_info');
|
395 |
+
$import_layouts = isset($wcps_plugin_info['import_layouts']) ? $wcps_plugin_info['import_layouts'] : '';
|
396 |
|
397 |
|
398 |
?>
|
412 |
<p><a target="_blank" class="button" href="<?php echo admin_url().'edit.php?post_type=wcps_layout'; ?>"><?php echo __('Manage layouts','woocommerce-products-slider'); ?></a> </p>
|
413 |
|
414 |
<?php
|
415 |
+
if($import_layouts != 'done'):
|
416 |
+
?>
|
417 |
+
<p><a target="_blank" class="button" href="<?php echo admin_url().'edit.php?post_type=wcps_layout'; ?>"><?php echo __('Import layouts','woocommerce-products-slider'); ?></a> </p>
|
418 |
+
<?php
|
419 |
+
endif;
|
420 |
+
|
421 |
|
422 |
|
423 |
$html = ob_get_clean();
|
1001 |
|
1002 |
|
1003 |
|
1004 |
+
add_action('wcps_metabox_content_query_categories', 'wcps_metabox_content_query_categories');
|
1005 |
+
|
1006 |
+
if(!function_exists('wcps_metabox_content_query_categories')) {
|
1007 |
+
function wcps_metabox_content_query_categories($post_id){
|
1008 |
+
|
1009 |
+
$settings_tabs_field = new settings_tabs_field();
|
1010 |
+
|
1011 |
+
$wcps_options = get_post_meta( $post_id, 'wcps_options', true );
|
1012 |
+
$query_categories = !empty($wcps_options['query_categories']) ? $wcps_options['query_categories'] : array();
|
1013 |
+
|
1014 |
+
$posts_per_page = isset($query_categories['posts_per_page']) ? $query_categories['posts_per_page'] : 10;
|
1015 |
+
$query_order = isset($query_categories['order']) ? $query_categories['order'] : 'DESC';
|
1016 |
+
$query_orderby = !empty($query_categories['orderby']) ? $query_categories['orderby'] : array('name');
|
1017 |
+
$hide_empty = isset($query_categories['hide_empty']) ? $query_categories['hide_empty'] : '';
|
1018 |
+
|
1019 |
+
|
1020 |
+
$taxonomies = !empty($query_categories['taxonomies']) ? $query_categories['taxonomies'] : array();
|
1021 |
+
|
1022 |
+
|
1023 |
+
//echo '<pre>'.var_export($taxonomies, true).'</pre>';
|
1024 |
+
|
1025 |
+
?>
|
1026 |
+
<div class="section">
|
1027 |
+
<div class="section-title">Query categories</div>
|
1028 |
+
<p class="description section-description">Setup categories query settings.</p>
|
1029 |
+
|
1030 |
+
|
1031 |
+
<?php
|
1032 |
+
|
1033 |
+
|
1034 |
+
|
1035 |
+
$wcps_allowed_taxonomies = apply_filters('wcps_allowed_taxonomies', array('product_cat', 'product_tag'));
|
1036 |
+
|
1037 |
+
ob_start();
|
1038 |
+
|
1039 |
+
|
1040 |
+
$post_types = array('product');
|
1041 |
+
$post_taxonomies = array();
|
1042 |
+
|
1043 |
+
$post_taxonomies = get_object_taxonomies( $post_types );
|
1044 |
+
|
1045 |
+
if(!empty($post_taxonomies)){
|
1046 |
+
|
1047 |
+
?>
|
1048 |
+
|
1049 |
+
<div class="expandable sortable">
|
1050 |
+
|
1051 |
+
<?php
|
1052 |
+
|
1053 |
+
foreach ($post_taxonomies as $taxonomy ) {
|
1054 |
+
|
1055 |
+
$terms = isset($taxonomies[$taxonomy]['terms']) ? $taxonomies[$taxonomy]['terms'] : array();
|
1056 |
+
$terms_relation = isset($taxonomies[$taxonomy]['terms_relation']) ? $taxonomies[$taxonomy]['terms_relation'] : 'IN';
|
1057 |
+
|
1058 |
+
if(!in_array($taxonomy, $wcps_allowed_taxonomies)) continue;
|
1059 |
+
//if($taxonomy != 'product_cat' && $taxonomy != 'product_tag') continue;
|
1060 |
+
|
1061 |
+
$the_taxonomy = get_taxonomy($taxonomy);
|
1062 |
+
$args=array('orderby' => 'name', 'order' => 'ASC', 'taxonomy' => $taxonomy, 'hide_empty' => false);
|
1063 |
+
$categories_all = get_categories($args);
|
1064 |
+
|
1065 |
+
|
1066 |
+
|
1067 |
+
?>
|
1068 |
+
<div class="item">
|
1069 |
+
<div class="element-title header ">
|
1070 |
+
<span class="expand"><i class="fas fa-expand"></i><i class="fas fa-compress"></i></span>
|
1071 |
+
<?php
|
1072 |
+
if(!empty($terms)):
|
1073 |
+
?><i class="fas fa-check"></i><?php
|
1074 |
+
else:
|
1075 |
+
?><i class="fas fa-times"></i><?php
|
1076 |
+
endif;?>
|
1077 |
+
<span class="expand"><?php echo $the_taxonomy->labels->name; ?> - <?php echo $taxonomy; ?></span>
|
1078 |
+
|
1079 |
+
</div>
|
1080 |
+
<div class="element-options options">
|
1081 |
+
|
1082 |
+
<?php
|
1083 |
+
$term_list = array();
|
1084 |
+
foreach($categories_all as $category_info){
|
1085 |
+
$term_list[$category_info->cat_ID] = $category_info->cat_name.'('.$category_info->count.')';
|
1086 |
+
}
|
1087 |
+
|
1088 |
+
|
1089 |
+
|
1090 |
+
|
1091 |
+
$args = array(
|
1092 |
+
'id' => 'terms',
|
1093 |
+
'parent' => 'wcps_options[query_categories][taxonomies]['.$taxonomy.']',
|
1094 |
+
'title' => __('Select terms','woocommerce-products-slider'),
|
1095 |
+
'details' => __('Choose some terms.','woocommerce-products-slider'),
|
1096 |
+
'type' => 'select',
|
1097 |
+
'multiple' => true,
|
1098 |
+
'value' => $terms,
|
1099 |
+
'args' => $term_list,
|
1100 |
+
'default' => array(),
|
1101 |
+
);
|
1102 |
+
|
1103 |
+
$settings_tabs_field->generate_field($args);
|
1104 |
+
|
1105 |
+
|
1106 |
+
?>
|
1107 |
+
|
1108 |
+
</div>
|
1109 |
+
</div>
|
1110 |
+
<?php
|
1111 |
+
|
1112 |
+
|
1113 |
+
|
1114 |
+
|
1115 |
+
|
1116 |
+
|
1117 |
+
}
|
1118 |
+
|
1119 |
+
?>
|
1120 |
+
</div>
|
1121 |
+
<?php
|
1122 |
+
|
1123 |
+
}
|
1124 |
+
else{
|
1125 |
+
echo 'No categories found.';
|
1126 |
+
}
|
1127 |
+
|
1128 |
+
|
1129 |
+
|
1130 |
+
$html = ob_get_clean();
|
1131 |
+
$args = array(
|
1132 |
+
'id' => 'wcps_categories',
|
1133 |
+
'title' => __('Product taxonomy & terms', 'woocommerce-products-slider'),
|
1134 |
+
'details' => __('Choose product taxonomy & terms. click to expand and see there is categories or terms you can select.', 'woocommerce-products-slider'),
|
1135 |
+
'type' => 'custom_html',
|
1136 |
+
'html' => $html,
|
1137 |
+
);
|
1138 |
+
$settings_tabs_field->generate_field($args);
|
1139 |
+
|
1140 |
+
|
1141 |
+
|
1142 |
+
|
1143 |
+
|
1144 |
+
|
1145 |
+
$args = array(
|
1146 |
+
'id' => 'orderby',
|
1147 |
+
'parent' => 'wcps_options[query_categories]',
|
1148 |
+
'title' => __('Query orderby','woocommerce-products-slider'),
|
1149 |
+
'details' => __('Set query orderby.','woocommerce-products-slider'),
|
1150 |
+
'type' => 'select',
|
1151 |
+
'value' => $query_order,
|
1152 |
+
'default' => 'DESC',
|
1153 |
+
'args' => array(
|
1154 |
+
'name'=>__('Name','woocommerce-products-slider'),
|
1155 |
+
'slug'=>__('Slug','woocommerce-products-slider'),
|
1156 |
+
'term_group'=>__('Term group','woocommerce-products-slider'),
|
1157 |
+
'term_id'=>__('Term id','woocommerce-products-slider'),
|
1158 |
+
'id'=>__('ID','woocommerce-products-slider'),
|
1159 |
+
'description'=>__('Description','woocommerce-products-slider'),
|
1160 |
+
'parent'=>__('Parent','woocommerce-products-slider'),
|
1161 |
+
|
1162 |
+
|
1163 |
+
|
1164 |
+
),
|
1165 |
+
);
|
1166 |
+
|
1167 |
+
$settings_tabs_field->generate_field($args);
|
1168 |
+
|
1169 |
+
|
1170 |
+
|
1171 |
+
$args = array(
|
1172 |
+
'id' => 'order',
|
1173 |
+
'parent' => 'wcps_options[query_categories]',
|
1174 |
+
'title' => __('Query order','woocommerce-products-slider'),
|
1175 |
+
'details' => __('Set query order.','woocommerce-products-slider'),
|
1176 |
+
'type' => 'select',
|
1177 |
+
'value' => $query_order,
|
1178 |
+
'default' => 'DESC',
|
1179 |
+
'args' => array(
|
1180 |
+
'DESC'=>__('Descending','woocommerce-products-slider'),
|
1181 |
+
'ASC'=>__('Ascending','woocommerce-products-slider'),
|
1182 |
+
),
|
1183 |
+
);
|
1184 |
+
|
1185 |
+
$settings_tabs_field->generate_field($args);
|
1186 |
+
|
1187 |
+
|
1188 |
+
|
1189 |
+
|
1190 |
+
|
1191 |
+
|
1192 |
+
|
1193 |
+
|
1194 |
+
|
1195 |
+
$args = array(
|
1196 |
+
'id' => 'hide_empty',
|
1197 |
+
'parent' => 'wcps_options[query_categories]',
|
1198 |
+
'title' => __('Hide empty','woocommerce-products-slider'),
|
1199 |
+
'details' => __('Choose hide empty terms.','woocommerce-products-slider'),
|
1200 |
+
'type' => 'select',
|
1201 |
+
'value' => $hide_empty,
|
1202 |
+
'default' => '1',
|
1203 |
+
'args' => array('1'=>__('True','woocommerce-products-slider'), '0'=>__('False','woocommerce-products-slider')),
|
1204 |
+
);
|
1205 |
+
|
1206 |
+
$settings_tabs_field->generate_field($args);
|
1207 |
+
|
1208 |
+
|
1209 |
+
|
1210 |
+
|
1211 |
+
|
1212 |
+
|
1213 |
+
|
1214 |
+
|
1215 |
+
|
1216 |
+
|
1217 |
+
?>
|
1218 |
+
|
1219 |
+
</div>
|
1220 |
+
|
1221 |
+
<?php
|
1222 |
+
|
1223 |
+
|
1224 |
+
|
1225 |
+
|
1226 |
+
|
1227 |
+
|
1228 |
+
}
|
1229 |
+
}
|
1230 |
+
|
1231 |
+
|
1232 |
+
|
1233 |
+
|
1234 |
+
|
1235 |
+
|
1236 |
+
add_action('wcps_metabox_content_query_orders', 'wcps_metabox_content_query_orders');
|
1237 |
+
|
1238 |
+
if(!function_exists('wcps_metabox_content_query_orders')) {
|
1239 |
+
function wcps_metabox_content_query_orders($post_id){
|
1240 |
+
|
1241 |
+
$settings_tabs_field = new settings_tabs_field();
|
1242 |
+
|
1243 |
+
$wcps_options = get_post_meta( $post_id, 'wcps_options', true );
|
1244 |
+
$query = !empty($wcps_options['query']) ? $wcps_options['query'] : array();
|
1245 |
+
|
1246 |
+
$posts_per_page = isset($query['posts_per_page']) ? $query['posts_per_page'] : 10;
|
1247 |
+
$query_order = isset($query['order']) ? $query['order'] : 'DESC';
|
1248 |
+
$query_orderby = !empty($query['orderby']) ? $query['orderby'] : array('date');
|
1249 |
+
$ordberby_meta_key = isset($query['ordberby_meta_key']) ? $query['ordberby_meta_key'] : '';
|
1250 |
+
|
1251 |
+
$hide_out_of_stock = isset($query['hide_out_of_stock']) ? $query['hide_out_of_stock'] : 'no_check';
|
1252 |
+
$product_featured = isset($query['product_featured']) ? $query['product_featured'] : 'no_check';
|
1253 |
+
$taxonomies = !empty($query['taxonomies']) ? $query['taxonomies'] : array();
|
1254 |
+
$taxonomy_relation = !empty($query['taxonomy_relation']) ? $query['taxonomy_relation'] : 'OR';
|
1255 |
+
|
1256 |
+
$query_only = isset($query['query_only']) ? $query['query_only'] : '';
|
1257 |
+
|
1258 |
+
|
1259 |
+
|
1260 |
+
$on_sale = isset($query['on_sale']) ? $query['on_sale'] : 'no';
|
1261 |
+
$product_ids = isset($query['product_ids']) ? $query['product_ids'] : '';
|
1262 |
+
|
1263 |
+
|
1264 |
+
//echo '<pre>'.var_export($taxonomies, true).'</pre>';
|
1265 |
+
|
1266 |
+
?>
|
1267 |
+
<div class="section">
|
1268 |
+
<div class="section-title">Query orders</div>
|
1269 |
+
<p class="description section-description">Setup orders query settings.</p>
|
1270 |
+
|
1271 |
+
|
1272 |
+
<?php
|
1273 |
+
|
1274 |
+
$args = array(
|
1275 |
+
'id' => 'posts_per_page',
|
1276 |
+
'parent' => 'wcps_options[query_orders]',
|
1277 |
+
'title' => __('Max number of post','woocommerce-products-slider'),
|
1278 |
+
'details' => __('Set custom number you want to display maximum number of post','woocommerce-products-slider'),
|
1279 |
+
'type' => 'text',
|
1280 |
+
'value' => $posts_per_page,
|
1281 |
+
'default' => '10',
|
1282 |
+
'placeholder' => '10',
|
1283 |
+
);
|
1284 |
+
|
1285 |
+
$settings_tabs_field->generate_field($args);
|
1286 |
+
|
1287 |
+
|
1288 |
+
$args = array(
|
1289 |
+
'id' => 'order',
|
1290 |
+
'parent' => 'wcps_options[query_orders]',
|
1291 |
+
'title' => __('Query order','woocommerce-products-slider'),
|
1292 |
+
'details' => __('Set query order.','woocommerce-products-slider'),
|
1293 |
+
'type' => 'select',
|
1294 |
+
'value' => $query_order,
|
1295 |
+
'default' => 'DESC',
|
1296 |
+
'args' => array(
|
1297 |
+
'DESC'=>__('Descending','woocommerce-products-slider'),
|
1298 |
+
'ASC'=>__('Ascending','woocommerce-products-slider'),
|
1299 |
+
),
|
1300 |
+
);
|
1301 |
+
|
1302 |
+
$settings_tabs_field->generate_field($args);
|
1303 |
+
|
1304 |
+
|
1305 |
+
$wcps_query_orderby_args = apply_filters('wcps_query_orderby_args',
|
1306 |
+
array(
|
1307 |
+
'ID'=>__('ID','woocommerce-products-slider'),
|
1308 |
+
'date'=>__('Date','woocommerce-products-slider'),
|
1309 |
+
'post_date'=>__('Post date','woocommerce-products-slider'),
|
1310 |
+
'name'=>__('Name','woocommerce-products-slider'),
|
1311 |
+
'rand'=>__('Random','woocommerce-products-slider'),
|
1312 |
+
'comment_count'=>__('Comment count','woocommerce-products-slider'),
|
1313 |
+
'author'=>__('Author','woocommerce-products-slider'),
|
1314 |
+
'title'=>__('Title','woocommerce-products-slider'),
|
1315 |
+
'type'=>__('Type','woocommerce-products-slider'),
|
1316 |
+
'menu_order'=>__('Menu order','woocommerce-products-slider'),
|
1317 |
+
'meta_value'=>__('meta_value','woocommerce-products-slider'),
|
1318 |
+
'meta_value_num'=>__('meta value number','woocommerce-products-slider'),
|
1319 |
+
'post__in'=>__('post__in','woocommerce-products-slider'),
|
1320 |
+
'post_name__in'=>__('post_name__in','woocommerce-products-slider'),
|
1321 |
+
)
|
1322 |
+
);
|
1323 |
+
|
1324 |
+
|
1325 |
+
|
1326 |
+
|
1327 |
+
|
1328 |
+
$args = array(
|
1329 |
+
'id' => 'wcps_ordeby',
|
1330 |
+
'parent' => 'wcps_options[query_orders]',
|
1331 |
+
'title' => __('Query orderby', 'woocommerce-products-slider'),
|
1332 |
+
'details' => __('Set query orderby.', 'woocommerce-products-slider'),
|
1333 |
+
'type' => 'select',
|
1334 |
+
'value' => $hide_out_of_stock,
|
1335 |
+
'default' => 'no_check',
|
1336 |
+
'args' => $wcps_query_orderby_args,
|
1337 |
+
);
|
1338 |
+
$settings_tabs_field->generate_field($args);
|
1339 |
+
|
1340 |
+
|
1341 |
+
|
1342 |
+
|
1343 |
+
|
1344 |
+
|
1345 |
+
|
1346 |
+
$args = array(
|
1347 |
+
'id' => 'post_ids',
|
1348 |
+
'parent' => 'wcps_options[query_orders]',
|
1349 |
+
'title' => __('Post ID\'s','woocommerce-products-slider'),
|
1350 |
+
'details' => __('You can display post by ids.','woocommerce-products-slider'),
|
1351 |
+
'type' => 'text',
|
1352 |
+
'value' => $product_ids,
|
1353 |
+
'default' => '',
|
1354 |
+
'placeholder' => '1,4,2',
|
1355 |
+
);
|
1356 |
+
|
1357 |
+
$settings_tabs_field->generate_field($args);
|
1358 |
+
|
1359 |
+
|
1360 |
+
|
1361 |
+
|
1362 |
+
|
1363 |
+
|
1364 |
+
|
1365 |
+
|
1366 |
+
|
1367 |
+
|
1368 |
+
?>
|
1369 |
+
|
1370 |
+
</div>
|
1371 |
+
|
1372 |
+
<?php
|
1373 |
+
|
1374 |
+
|
1375 |
+
|
1376 |
+
|
1377 |
+
|
1378 |
+
|
1379 |
+
}
|
1380 |
+
}
|
1381 |
+
|
1382 |
+
|
1383 |
+
|
1384 |
+
|
1385 |
+
|
1386 |
+
|
1387 |
+
add_action('wcps_metabox_content_query_dokan_vendors', 'wcps_metabox_content_query_dokan_vendors');
|
1388 |
+
|
1389 |
+
if(!function_exists('wcps_metabox_content_query_dokan_vendors')) {
|
1390 |
+
function wcps_metabox_content_query_dokan_vendors($post_id){
|
1391 |
+
|
1392 |
+
$settings_tabs_field = new settings_tabs_field();
|
1393 |
+
|
1394 |
+
$wcps_options = get_post_meta( $post_id, 'wcps_options', true );
|
1395 |
+
$vendors_query = !empty($wcps_options['dokan_vendors_query']) ? $wcps_options['dokan_vendors_query'] : array();
|
1396 |
+
|
1397 |
+
$posts_per_page = isset($vendors_query['posts_per_page']) ? $vendors_query['posts_per_page'] : 10;
|
1398 |
+
$query_order = isset($vendors_query['order']) ? $vendors_query['order'] : 'DESC';
|
1399 |
+
$query_orderby = isset($vendors_query['orderby']) ? $vendors_query['orderby'] : 'ID';
|
1400 |
+
|
1401 |
+
$vendors_ids = isset($vendors_query['vendors_ids']) ? $vendors_query['vendors_ids'] : '';
|
1402 |
+
|
1403 |
+
?>
|
1404 |
+
<div class="section">
|
1405 |
+
<div class="section-title">Query Vendors</div>
|
1406 |
+
<p class="description section-description">Setup vendors query settings.</p>
|
1407 |
+
|
1408 |
+
|
1409 |
+
<?php
|
1410 |
+
|
1411 |
+
$args = array(
|
1412 |
+
'id' => 'posts_per_page',
|
1413 |
+
'parent' => 'wcps_options[dokan_vendors_query]',
|
1414 |
+
'title' => __('Max number of vendors','woocommerce-products-slider'),
|
1415 |
+
'details' => __('Set custom number you want to display maximum number of vendors','woocommerce-products-slider'),
|
1416 |
+
'type' => 'text',
|
1417 |
+
'value' => $posts_per_page,
|
1418 |
+
'default' => '10',
|
1419 |
+
'placeholder' => '10',
|
1420 |
+
);
|
1421 |
+
|
1422 |
+
$settings_tabs_field->generate_field($args);
|
1423 |
+
|
1424 |
+
|
1425 |
+
|
1426 |
+
$args = array(
|
1427 |
+
'id' => 'order',
|
1428 |
+
'parent' => 'wcps_options[dokan_vendors_query]',
|
1429 |
+
'title' => __('Query order','woocommerce-products-slider'),
|
1430 |
+
'details' => __('Set query order.','woocommerce-products-slider'),
|
1431 |
+
'type' => 'select',
|
1432 |
+
'value' => $query_order,
|
1433 |
+
'default' => 'DESC',
|
1434 |
+
'args' => array(
|
1435 |
+
'DESC'=>__('Descending','woocommerce-products-slider'),
|
1436 |
+
'ASC'=>__('Ascending','woocommerce-products-slider'),
|
1437 |
+
),
|
1438 |
+
);
|
1439 |
+
|
1440 |
+
$settings_tabs_field->generate_field($args);
|
1441 |
+
|
1442 |
+
|
1443 |
+
$args = array(
|
1444 |
+
'id' => 'orderby',
|
1445 |
+
'parent' => 'wcps_options[dokan_vendors_query]',
|
1446 |
+
'title' => __('Query orderby','woocommerce-products-slider'),
|
1447 |
+
'details' => __('Set query orderby.','woocommerce-products-slider'),
|
1448 |
+
'type' => 'select',
|
1449 |
+
'value' => $query_orderby,
|
1450 |
+
'default' => 'DESC',
|
1451 |
+
'args' => array(
|
1452 |
+
'ID'=>__('ID','woocommerce-products-slider'),
|
1453 |
+
'display_name'=>__('display name','woocommerce-products-slider'),
|
1454 |
+
'user_login'=>__('user login','woocommerce-products-slider'),
|
1455 |
+
'user_nicename'=>__('user nicename','woocommerce-products-slider'),
|
1456 |
+
|
1457 |
+
|
1458 |
+
),
|
1459 |
+
);
|
1460 |
+
|
1461 |
+
$settings_tabs_field->generate_field($args);
|
1462 |
+
|
1463 |
+
|
1464 |
+
|
1465 |
+
|
1466 |
+
|
1467 |
+
|
1468 |
+
|
1469 |
+
|
1470 |
+
$args = array(
|
1471 |
+
'id' => 'vendors_ids',
|
1472 |
+
'parent' => 'wcps_options[dokan_vendors_query]',
|
1473 |
+
'title' => __('vendor ID\'s','woocommerce-products-slider'),
|
1474 |
+
'details' => __('You can display vendors by ids.','woocommerce-products-slider'),
|
1475 |
+
'type' => 'text',
|
1476 |
+
'value' => $vendors_ids,
|
1477 |
+
'default' => '',
|
1478 |
+
'placeholder' => '1,4,2',
|
1479 |
+
);
|
1480 |
+
|
1481 |
+
$settings_tabs_field->generate_field($args);
|
1482 |
+
|
1483 |
+
|
1484 |
+
|
1485 |
+
|
1486 |
+
|
1487 |
+
|
1488 |
+
|
1489 |
+
|
1490 |
+
|
1491 |
+
|
1492 |
+
?>
|
1493 |
+
|
1494 |
+
</div>
|
1495 |
+
|
1496 |
+
<?php
|
1497 |
+
|
1498 |
+
|
1499 |
+
|
1500 |
+
|
1501 |
+
|
1502 |
+
|
1503 |
+
}
|
1504 |
+
}
|
1505 |
+
|
1506 |
+
|
1507 |
+
|
1508 |
+
|
1509 |
+
|
1510 |
+
|
1511 |
+
|
1512 |
+
|
1513 |
+
|
1514 |
+
|
1515 |
+
|
1516 |
add_action('wcps_metabox_content_slider_options', 'wcps_metabox_content_slider_options');
|
1517 |
|
1518 |
if(!function_exists('wcps_metabox_content_slider_options')) {
|
includes/class-metabox-wcps-layout-hook.php
CHANGED
@@ -108,8 +108,11 @@ if(!function_exists('wcps_layout_metabox_content_layout_builder')){
|
|
108 |
<?php
|
109 |
$layout_elements['wrapper_start'] = array('name' =>__('Wrapper start','woocommerce-products-slider'));
|
110 |
$layout_elements['wrapper_end'] = array('name' =>__('Wrapper end','woocommerce-products-slider'));
|
|
|
|
|
|
|
111 |
$layout_elements['thumbnail'] = array('name' =>__('Thumbnail','woocommerce-products-slider'));
|
112 |
-
$layout_elements['post_title'] = array('name' =>__('
|
113 |
$layout_elements['content'] = array('name' =>__('Content','woocommerce-products-slider'));
|
114 |
$layout_elements['product_category'] = array('name' =>__('Product Category','woocommerce-products-slider'));
|
115 |
$layout_elements['product_tag'] = array('name' =>__('Product Tag','woocommerce-products-slider'));
|
@@ -121,6 +124,20 @@ if(!function_exists('wcps_layout_metabox_content_layout_builder')){
|
|
121 |
$layout_elements['product_price'] = array('name' =>__('Price','woocommerce-products-slider'));
|
122 |
$layout_elements['product_id'] = array('name' =>__('Product ID','woocommerce-products-slider'));
|
123 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
|
125 |
|
126 |
|
@@ -219,6 +236,8 @@ if(!function_exists('wcps_layout_metabox_content_layout_builder')){
|
|
219 |
background: #fff;
|
220 |
padding: 5px 5px;
|
221 |
border-bottom: 1px solid #ddd;
|
|
|
|
|
222 |
}
|
223 |
.layout-tags span{
|
224 |
background: #ddd;
|
@@ -317,29 +336,23 @@ if(!function_exists('wcps_layout_metabox_content_layout_builder')){
|
|
317 |
$custom_css = isset($custom_scripts['custom_css']) ? $custom_scripts['custom_css'] : '';
|
318 |
|
319 |
?>
|
320 |
-
|
321 |
<style type="text/css">
|
322 |
.layout-preview{
|
323 |
background: url(<?php echo wcps_plugin_url; ?>assets/admin/css/tile.png);
|
324 |
padding: 20px;
|
325 |
}
|
326 |
-
|
327 |
.layout-preview .elements-wrapper{
|
328 |
width: 400px;
|
329 |
overflow: hidden;
|
330 |
margin: 0 auto;
|
331 |
}
|
332 |
-
|
333 |
.layout-preview img{
|
334 |
width: 100%;
|
|
|
335 |
}
|
336 |
-
|
337 |
<?php
|
338 |
-
|
339 |
echo str_replace('__ID__', 'layout-'.$item_layout_id, $custom_css);
|
340 |
-
|
341 |
?>
|
342 |
-
|
343 |
</style>
|
344 |
<?php
|
345 |
|
108 |
<?php
|
109 |
$layout_elements['wrapper_start'] = array('name' =>__('Wrapper start','woocommerce-products-slider'));
|
110 |
$layout_elements['wrapper_end'] = array('name' =>__('Wrapper end','woocommerce-products-slider'));
|
111 |
+
$layout_elements['custom_text'] = array('name' =>__('Custom text','woocommerce-products-slider'));
|
112 |
+
|
113 |
+
|
114 |
$layout_elements['thumbnail'] = array('name' =>__('Thumbnail','woocommerce-products-slider'));
|
115 |
+
$layout_elements['post_title'] = array('name' =>__('Post Title','woocommerce-products-slider'));
|
116 |
$layout_elements['content'] = array('name' =>__('Content','woocommerce-products-slider'));
|
117 |
$layout_elements['product_category'] = array('name' =>__('Product Category','woocommerce-products-slider'));
|
118 |
$layout_elements['product_tag'] = array('name' =>__('Product Tag','woocommerce-products-slider'));
|
124 |
$layout_elements['product_price'] = array('name' =>__('Price','woocommerce-products-slider'));
|
125 |
$layout_elements['product_id'] = array('name' =>__('Product ID','woocommerce-products-slider'));
|
126 |
|
127 |
+
$layout_elements['term_title'] = array('name' =>__('Term title','woocommerce-products-slider'));
|
128 |
+
$layout_elements['term_thumb'] = array('name' =>__('Term thumbnail','woocommerce-products-slider'));
|
129 |
+
$layout_elements['term_description'] = array('name' =>__('Term description','woocommerce-products-slider'));
|
130 |
+
$layout_elements['term_slug'] = array('name' =>__('Term slug','woocommerce-products-slider'));
|
131 |
+
$layout_elements['term_post_count'] = array('name' =>__('Term post count','woocommerce-products-slider'));
|
132 |
+
|
133 |
+
$layout_elements['order_date'] = array('name' =>__('Order date','woocommerce-products-slider'));
|
134 |
+
$layout_elements['order_customer_name'] = array('name' =>__('Order customer name','woocommerce-products-slider'));
|
135 |
+
$layout_elements['order_customer_thumb'] = array('name' =>__('Order customer thumbnail','woocommerce-products-slider'));
|
136 |
+
$layout_elements['order_country'] = array('name' =>__('Order country','woocommerce-products-slider'));
|
137 |
+
$layout_elements['order_payment_method'] = array('name' =>__('Order payment method','woocommerce-products-slider'));
|
138 |
+
$layout_elements['order_total'] = array('name' =>__('Order total','woocommerce-products-slider'));
|
139 |
+
$layout_elements['order_items'] = array('name' =>__('Order items','woocommerce-products-slider'));
|
140 |
+
$layout_elements['order_discount_total'] = array('name' =>__('Order discount total','woocommerce-products-slider'));
|
141 |
|
142 |
|
143 |
|
236 |
background: #fff;
|
237 |
padding: 5px 5px;
|
238 |
border-bottom: 1px solid #ddd;
|
239 |
+
max-height: 70px;
|
240 |
+
overflow-y: scroll;
|
241 |
}
|
242 |
.layout-tags span{
|
243 |
background: #ddd;
|
336 |
$custom_css = isset($custom_scripts['custom_css']) ? $custom_scripts['custom_css'] : '';
|
337 |
|
338 |
?>
|
|
|
339 |
<style type="text/css">
|
340 |
.layout-preview{
|
341 |
background: url(<?php echo wcps_plugin_url; ?>assets/admin/css/tile.png);
|
342 |
padding: 20px;
|
343 |
}
|
|
|
344 |
.layout-preview .elements-wrapper{
|
345 |
width: 400px;
|
346 |
overflow: hidden;
|
347 |
margin: 0 auto;
|
348 |
}
|
|
|
349 |
.layout-preview img{
|
350 |
width: 100%;
|
351 |
+
height: auto;
|
352 |
}
|
|
|
353 |
<?php
|
|
|
354 |
echo str_replace('__ID__', 'layout-'.$item_layout_id, $custom_css);
|
|
|
355 |
?>
|
|
|
356 |
</style>
|
357 |
<?php
|
358 |
|
includes/class-metabox-wcps.php
CHANGED
@@ -7,7 +7,7 @@ class class_wcps_metabox{
|
|
7 |
|
8 |
//meta box action for "wcps"
|
9 |
add_action('add_meta_boxes', array($this, 'wcps_post_meta_wcps'));
|
10 |
-
add_action('save_post', array($this, 'meta_boxes_wcps_save'));
|
11 |
|
12 |
|
13 |
|
@@ -17,13 +17,65 @@ class class_wcps_metabox{
|
|
17 |
public function wcps_post_meta_wcps($post_type){
|
18 |
|
19 |
add_meta_box('metabox-wcps',__('WCPS data', 'woocommerce-products-slider'), array($this, 'meta_box_wcps_data'), 'wcps', 'normal', 'high');
|
|
|
20 |
|
21 |
}
|
22 |
|
23 |
|
24 |
|
|
|
25 |
|
|
|
|
|
|
|
26 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
27 |
|
28 |
public function meta_box_wcps_data($post) {
|
29 |
|
@@ -41,6 +93,7 @@ class class_wcps_metabox{
|
|
41 |
|
42 |
$wcps_options = get_post_meta($post_id,'wcps_options', true);
|
43 |
$current_tab = isset($wcps_options['current_tab']) ? $wcps_options['current_tab'] : 'layouts';
|
|
|
44 |
|
45 |
|
46 |
$wcps_settings_tab = array();
|
@@ -64,8 +117,38 @@ class class_wcps_metabox{
|
|
64 |
'title' => sprintf(__('%s Query product','woocommerce-products-slider'),'<i class="fas fa-qrcode"></i>'),
|
65 |
'priority' => 3,
|
66 |
'active' => ($current_tab == 'query_product') ? true : false,
|
|
|
|
|
67 |
);
|
68 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
69 |
$wcps_settings_tabs[] = array(
|
70 |
'id' => 'style',
|
71 |
'title' => sprintf(__('%s Style','woocommerce-products-slider'),'<i class="fas fa-palette"></i>'),
|
@@ -126,11 +209,62 @@ class class_wcps_metabox{
|
|
126 |
|
127 |
|
128 |
?>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
129 |
|
130 |
|
|
|
|
|
|
|
|
|
|
|
|
|
131 |
<div class="settings-tabs vertical">
|
132 |
<input class="current_tab" type="hidden" name="wcps_options[current_tab]" value="<?php echo $current_tab; ?>">
|
|
|
|
|
|
|
133 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
134 |
|
135 |
<ul class="tab-navs">
|
136 |
<?php
|
7 |
|
8 |
//meta box action for "wcps"
|
9 |
add_action('add_meta_boxes', array($this, 'wcps_post_meta_wcps'));
|
10 |
+
add_action('save_post', array($this, 'meta_boxes_wcps_save'), 99);
|
11 |
|
12 |
|
13 |
|
17 |
public function wcps_post_meta_wcps($post_type){
|
18 |
|
19 |
add_meta_box('metabox-wcps',__('WCPS data', 'woocommerce-products-slider'), array($this, 'meta_box_wcps_data'), 'wcps', 'normal', 'high');
|
20 |
+
add_meta_box('metabox-wcps-side',__('WCPS Help', 'woocommerce-products-slider'), array($this, 'meta_box_wcps_side'), 'wcps', 'side', 'low');
|
21 |
|
22 |
}
|
23 |
|
24 |
|
25 |
|
26 |
+
public function meta_box_wcps_side($post){
|
27 |
|
28 |
+
?>
|
29 |
+
<div class="plugin-help-search">
|
30 |
+
<input type="search" value="" placeholder="Start typing">
|
31 |
|
32 |
+
<ul>
|
33 |
+
<li><i class="far fa-dot-circle"></i> <a href="https://www.youtube.com/watch?v=kn3skEwh5t4&list=PL0QP7T2SN94bgierw1J8Qn3sf4mZo7F9f&index=2">Data migration</a></li>
|
34 |
+
<li><i class="far fa-dot-circle"></i> <a href="https://www.youtube.com/watch?v=_HMHaSjjHdo&list=PL0QP7T2SN94bgierw1J8Qn3sf4mZo7F9f&index=8&t=0s">Customize Layouts</a></li>
|
35 |
+
<li><i class="far fa-dot-circle"></i> <a href="https://www.youtube.com/watch?v=UVa0kfo9oI4&list=PL0QP7T2SN94bgierw1J8Qn3sf4mZo7F9f&index=3&t=4s">Query product by categories</a></li>
|
36 |
+
<li><i class="far fa-dot-circle"></i> <a href="https://www.youtube.com/watch?v=qJWCizg5res&list=PL0QP7T2SN94bgierw1J8Qn3sf4mZo7F9f&index=4&t=0s">Exclude featured products</a></li>
|
37 |
+
<li><i class="far fa-dot-circle"></i> <a href="https://www.youtube.com/watch?v=d_KZg_cghow&list=PL0QP7T2SN94bgierw1J8Qn3sf4mZo7F9f&index=5&t=0s">Exclude on sale products</a></li>
|
38 |
+
<li><i class="far fa-dot-circle"></i> <a href="https://www.youtube.com/watch?v=HbpNaqrlppk&list=PL0QP7T2SN94bgierw1J8Qn3sf4mZo7F9f&index=6&t=0s">Exclude out of stock products</a></li>
|
39 |
+
<li><i class="far fa-dot-circle"></i> <a href="https://www.youtube.com/watch?v=Ss5wkHoyzFE&list=PL0QP7T2SN94bgierw1J8Qn3sf4mZo7F9f&index=7&t=0s">Query product by tags</a></li>
|
40 |
+
<li><i class="far fa-dot-circle"></i> <a href="https://www.youtube.com/watch?v=SSIfHT2UK0Y&list=PL0QP7T2SN94bgierw1J8Qn3sf4mZo7F9f&index=9&t=0s">Display latest products</a></li>
|
41 |
+
</ul>
|
42 |
+
</div>
|
43 |
+
|
44 |
+
|
45 |
+
|
46 |
+
<style type="text/css">
|
47 |
+
.plugin-help-search{}
|
48 |
+
.plugin-help-search input[type=search]{
|
49 |
+
width: 100%;
|
50 |
+
}
|
51 |
+
</style>
|
52 |
+
|
53 |
+
<script>
|
54 |
+
jQuery(document).ready(function($){
|
55 |
+
jQuery(document).on('keyup', '.plugin-help-search input', function(){
|
56 |
+
keyword = jQuery(this).val().toLowerCase();
|
57 |
+
content_body = [];
|
58 |
+
|
59 |
+
console.log(keyword);
|
60 |
+
|
61 |
+
$('.plugin-help-search li').each(function( index ) {
|
62 |
+
$( this ).hide();
|
63 |
+
content = $( this ).text().toLowerCase();
|
64 |
+
content_body[index] = content;
|
65 |
+
n = content_body[index].indexOf(keyword);
|
66 |
+
if(n<0){
|
67 |
+
$( this ).hide();
|
68 |
+
}else{
|
69 |
+
$( this ).show();
|
70 |
+
}
|
71 |
+
});
|
72 |
+
})
|
73 |
+
})
|
74 |
+
</script>
|
75 |
+
|
76 |
+
<?php
|
77 |
+
|
78 |
+
}
|
79 |
|
80 |
public function meta_box_wcps_data($post) {
|
81 |
|
93 |
|
94 |
$wcps_options = get_post_meta($post_id,'wcps_options', true);
|
95 |
$current_tab = isset($wcps_options['current_tab']) ? $wcps_options['current_tab'] : 'layouts';
|
96 |
+
$slider_for = !empty($wcps_options['slider_for']) ? $wcps_options['slider_for'] : 'products';
|
97 |
|
98 |
|
99 |
$wcps_settings_tab = array();
|
117 |
'title' => sprintf(__('%s Query product','woocommerce-products-slider'),'<i class="fas fa-qrcode"></i>'),
|
118 |
'priority' => 3,
|
119 |
'active' => ($current_tab == 'query_product') ? true : false,
|
120 |
+
'data_visible' => 'products',
|
121 |
+
'hidden' => ($slider_for == 'categories')? true : false || ($slider_for == 'orders')? true : false || ($slider_for == 'dokan_vendors')? true : false,
|
122 |
);
|
123 |
|
124 |
+
$wcps_settings_tabs[] = array(
|
125 |
+
'id' => 'query_orders',
|
126 |
+
'title' => sprintf(__('%s Query orders','woocommerce-products-slider'),'<i class="fas fa-qrcode"></i>'),
|
127 |
+
'priority' => 3,
|
128 |
+
'active' => ($current_tab == 'query_orders') ? true : false,
|
129 |
+
'data_visible' => 'orders',
|
130 |
+
'hidden' => ($slider_for == 'products')? true : false || ($slider_for == 'categories')? true : false || ($slider_for == 'dokan_vendors')? true : false,
|
131 |
+
);
|
132 |
+
|
133 |
+
$wcps_settings_tabs[] = array(
|
134 |
+
'id' => 'query_categories',
|
135 |
+
'title' => sprintf(__('%s Query categories','woocommerce-products-slider'),'<i class="fas fa-qrcode"></i>'),
|
136 |
+
'priority' => 3,
|
137 |
+
'active' => ($current_tab == 'query_categories') ? true : false,
|
138 |
+
'data_visible' => 'categories',
|
139 |
+
'hidden' => ($slider_for == 'products')? true : false || ($slider_for == 'orders')? true : false || ($slider_for == 'dokan_vendors')? true : false,
|
140 |
+
);
|
141 |
+
|
142 |
+
$wcps_settings_tabs[] = array(
|
143 |
+
'id' => 'query_dokan_vendors',
|
144 |
+
'title' => sprintf(__('%s Query dokan vendors','woocommerce-products-slider'),'<i class="fas fa-qrcode"></i>'),
|
145 |
+
'priority' => 3,
|
146 |
+
'active' => ($current_tab == 'query_dokan_vendors') ? true : false,
|
147 |
+
'data_visible' => 'dokan_vendors',
|
148 |
+
'hidden' => ($slider_for == 'products')? true : false || ($slider_for == 'orders')? true : false || ($slider_for == 'categories')? true : false,
|
149 |
+
);
|
150 |
+
|
151 |
+
|
152 |
$wcps_settings_tabs[] = array(
|
153 |
'id' => 'style',
|
154 |
'title' => sprintf(__('%s Style','woocommerce-products-slider'),'<i class="fas fa-palette"></i>'),
|
209 |
|
210 |
|
211 |
?>
|
212 |
+
<script>
|
213 |
+
jQuery(document).ready(function($){
|
214 |
+
$(document).on('click', '.settings-tabs input[name="wcps_options[slider_for]"]', function(){
|
215 |
+
var val = $(this).val();
|
216 |
+
|
217 |
+
console.log( val );
|
218 |
+
|
219 |
+
$('.settings-tabs .tab-navs li').each(function( index ) {
|
220 |
+
data_visible = $( this ).attr('data_visible');
|
221 |
+
|
222 |
+
if(typeof data_visible != 'undefined'){
|
223 |
+
//console.log('undefined '+ data_visible );
|
224 |
+
|
225 |
+
n = data_visible.indexOf(val);
|
226 |
+
if(n<0){
|
227 |
+
$( this ).hide();
|
228 |
+
}else{
|
229 |
+
$( this ).show();
|
230 |
+
}
|
231 |
+
}else{
|
232 |
+
console.log('Not matched: '+ data_visible );
|
233 |
+
|
234 |
+
|
235 |
+
}
|
236 |
+
});
|
237 |
|
238 |
|
239 |
+
})
|
240 |
+
})
|
241 |
+
|
242 |
+
|
243 |
+
</script>
|
244 |
+
|
245 |
<div class="settings-tabs vertical">
|
246 |
<input class="current_tab" type="hidden" name="wcps_options[current_tab]" value="<?php echo $current_tab; ?>">
|
247 |
+
<div class="view-types">
|
248 |
+
|
249 |
+
<?php
|
250 |
|
251 |
+
$team_view_types = apply_filters('team_view_types', array('grid'=>'Grid'));
|
252 |
+
|
253 |
+
$args = array(
|
254 |
+
'id' => 'slider_for',
|
255 |
+
'parent' => 'wcps_options',
|
256 |
+
'title' => __('Slider for','team'),
|
257 |
+
'details' => '',
|
258 |
+
'type' => 'radio',
|
259 |
+
'value' => $slider_for,
|
260 |
+
'default' => '',
|
261 |
+
'args' => apply_filters('wcps_slider_for_args', array('products' => 'Products','orders' => 'Orders', 'categories' => 'Categories' )),
|
262 |
+
);
|
263 |
+
|
264 |
+
$settings_tabs_field->generate_field($args);
|
265 |
+
|
266 |
+
?>
|
267 |
+
</div>
|
268 |
|
269 |
<ul class="tab-navs">
|
270 |
<?php
|
includes/class-settings-tabs.php
CHANGED
@@ -4,12 +4,40 @@ if ( ! defined('ABSPATH')) exit; // if direct access
|
|
4 |
if( ! class_exists( 'settings_tabs_field' ) ) {
|
5 |
class settings_tabs_field{
|
6 |
|
|
|
|
|
|
|
7 |
public function __construct(){
|
8 |
-
|
9 |
-
|
|
|
|
|
10 |
}
|
11 |
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
function field_template($option){
|
15 |
|
@@ -38,11 +66,8 @@ class settings_tabs_field{
|
|
38 |
|
39 |
|
40 |
|
41 |
-
function _admin_scripts(){
|
42 |
|
43 |
|
44 |
-
}
|
45 |
-
|
46 |
|
47 |
function generate_field($option){
|
48 |
|
@@ -85,6 +110,8 @@ class settings_tabs_field{
|
|
85 |
|
86 |
elseif( isset($option['type']) && $option['type'] === 'option_group') $this->field_option_group( $option );
|
87 |
elseif( isset($option['type']) && $option['type'] === 'option_group_accordion') $this->field_option_group_accordion( $option );
|
|
|
|
|
88 |
|
89 |
|
90 |
|
@@ -314,7 +341,7 @@ class settings_tabs_field{
|
|
314 |
|
315 |
$media_url = wp_get_attachment_url( $value );
|
316 |
$media_type = get_post_mime_type( $value );
|
317 |
-
$media_title = !empty($value) ? get_the_title( $value ) : __('Placeholder.jpg',
|
318 |
|
319 |
|
320 |
$media_url = !empty($media_url) ? $media_url : $default;
|
@@ -370,8 +397,8 @@ class settings_tabs_field{
|
|
370 |
?>
|
371 |
</div>
|
372 |
<input class="media-input-value" type="hidden" name="<?php echo $field_name; ?>" id="media_input_<?php echo $css_id; ?>" value="<?php echo $value; ?>" />
|
373 |
-
<div class="media-upload button" id="media_upload_<?php echo $css_id; ?>"><?php echo __('Upload',
|
374 |
-
<div placeholder="<?php echo $placeholder; ?>" class="clear button" id="media_clear_<?php echo $css_id; ?>"><?php echo __('Clear',
|
375 |
<div class="error-mgs"></div>
|
376 |
</div>
|
377 |
|
@@ -451,8 +478,8 @@ class settings_tabs_field{
|
|
451 |
?>
|
452 |
</div>
|
453 |
<input type="text" placeholder="<?php echo $placeholder; ?>" name="<?php echo $field_name; ?>" id="media_input_<?php echo $css_id; ?>" value="<?php echo $value; ?>" />
|
454 |
-
<div class="media-upload button" id="media_upload_<?php echo $css_id; ?>"><?php echo __('Upload',
|
455 |
-
<div class="clear button" id="media_clear_<?php echo $css_id; ?>"><?php echo __('Clear','
|
456 |
<div class="error-mgs"></div>
|
457 |
</div>
|
458 |
|
@@ -498,10 +525,6 @@ class settings_tabs_field{
|
|
498 |
?>
|
499 |
<script>
|
500 |
jQuery(document).ready(function($) {
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
jQuery(document).on("click", ".field-repeatable-wrapper-<?php echo $css_id; ?> .add-repeat-field", function() {
|
506 |
|
507 |
|
@@ -562,15 +585,18 @@ class settings_tabs_field{
|
|
562 |
</script>
|
563 |
<div id="input-wrapper-<?php echo $css_id; ?>" class=" input-wrapper field-repeatable-wrapper
|
564 |
field-repeatable-wrapper-<?php echo $css_id; ?>">
|
565 |
-
<div class="add-repeat-field"><i class="far fa-plus-square"></i> <?php _e('Add','
|
566 |
<div class="repeatable-field-list sortable" id="<?php echo $css_id; ?>">
|
567 |
<?php
|
568 |
if(!empty($values)):
|
569 |
$count = 1;
|
570 |
foreach ($values as $index=>$val):
|
571 |
$title_field_val = !empty($val[$title_field]) ? $val[$title_field] : '#'.$count;
|
|
|
|
|
|
|
572 |
?>
|
573 |
-
<div class="item-wrap <?php if($collapsible) echo 'collapsible'; ?>">
|
574 |
<?php if($collapsible):?>
|
575 |
<div class="header">
|
576 |
<?php endif; ?>
|
@@ -589,6 +615,9 @@ class settings_tabs_field{
|
|
589 |
|
590 |
foreach ($fields as $field_index => $field):
|
591 |
$fieldId = $field['id'];
|
|
|
|
|
|
|
592 |
|
593 |
$title_field_class = ($title_field == $field_index) ? 'title-field':'';
|
594 |
?>
|
@@ -599,6 +628,8 @@ class settings_tabs_field{
|
|
599 |
|
600 |
<?php
|
601 |
$field['parent'] = $field_name.'['.$index.']';
|
|
|
|
|
602 |
$field['value'] = isset($val[$fieldId]) ? $val[$fieldId] : '';
|
603 |
|
604 |
$settings_tabs_field->generate_field($field);
|
@@ -825,7 +856,7 @@ class settings_tabs_field{
|
|
825 |
?>
|
826 |
<div id="input-wrapper-<?php echo $id; ?>" class="input-wrapper input-text-multi-wrapper
|
827 |
input-text-multi-wrapper-<?php echo $css_id; ?>">
|
828 |
-
<span data-placeholder="<?php echo esc_attr($placeholder); ?>" data-sort="<?php echo $sortable; ?>" data-clone="<?php echo $allow_clone; ?>" data-name="<?php echo $field_name; ?>[]" class="button add-item"><?php echo __('Add',
|
829 |
<div class="field-list <?php if($sortable){ echo 'sortable'; }?>" id="<?php echo $css_id; ?>">
|
830 |
<?php
|
831 |
if(!empty($values)):
|
@@ -960,6 +991,57 @@ class settings_tabs_field{
|
|
960 |
|
961 |
|
962 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
963 |
|
964 |
|
965 |
|
@@ -990,7 +1072,7 @@ class settings_tabs_field{
|
|
990 |
ob_start();
|
991 |
?>
|
992 |
<div class="text-icon">
|
993 |
-
<span class="icon"
|
994 |
</div>
|
995 |
<style type="text/css">
|
996 |
.text-icon{}
|
@@ -1011,7 +1093,7 @@ class settings_tabs_field{
|
|
1011 |
$(document).on("keyup", ".text-icon input", function () {
|
1012 |
val = $(this).val();
|
1013 |
if(val){
|
1014 |
-
$(this).parent().children(".icon").html(
|
1015 |
}
|
1016 |
})
|
1017 |
})
|
@@ -1120,10 +1202,42 @@ class settings_tabs_field{
|
|
1120 |
|
1121 |
echo sprintf($field_template, $title, $input_html, $details);
|
1122 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1123 |
|
1124 |
|
|
|
|
|
|
|
|
|
1125 |
|
|
|
1126 |
|
|
|
1127 |
|
1128 |
}
|
1129 |
|
@@ -1148,7 +1262,8 @@ class settings_tabs_field{
|
|
1148 |
|
1149 |
$field_name = !empty($parent) ? $parent.'['.$id.']' : $id;
|
1150 |
|
1151 |
-
|
|
|
1152 |
|
1153 |
|
1154 |
ob_start();
|
@@ -1157,10 +1272,7 @@ class settings_tabs_field{
|
|
1157 |
|
1158 |
<script>
|
1159 |
jQuery(document).ready(function($){
|
1160 |
-
|
1161 |
-
wp.codeEditor.initialize($('#<?php echo $css_id; ?>'), cm_settings);
|
1162 |
-
|
1163 |
-
|
1164 |
})
|
1165 |
</script>
|
1166 |
<?php
|
@@ -1193,7 +1305,8 @@ class settings_tabs_field{
|
|
1193 |
$title = isset( $option['title'] ) ? $option['title'] : "";
|
1194 |
$details = isset( $option['details'] ) ? $option['details'] : "";
|
1195 |
|
1196 |
-
|
|
|
1197 |
|
1198 |
$field_name = !empty($parent) ? $parent.'['.$id.']' : $id;
|
1199 |
?>
|
@@ -1208,7 +1321,7 @@ class settings_tabs_field{
|
|
1208 |
|
1209 |
jQuery(document).ready(function($){
|
1210 |
|
1211 |
-
wp.codeEditor.initialize($('#<?php echo $css_id; ?>'),
|
1212 |
|
1213 |
|
1214 |
})
|
@@ -1385,6 +1498,7 @@ class settings_tabs_field{
|
|
1385 |
if(!empty($thumb)):
|
1386 |
?>
|
1387 |
<img style="width: <?php echo $width; ?>;" alt="<?php echo $name; ?>" src="<?php echo $thumb; ?>">
|
|
|
1388 |
|
1389 |
<?php
|
1390 |
else:
|
@@ -1456,13 +1570,13 @@ class settings_tabs_field{
|
|
1456 |
.radio-img label .link{
|
1457 |
background: hsl(200, 7%, 42%);
|
1458 |
position: absolute;
|
1459 |
-
top:
|
1460 |
-
|
1461 |
-
transform: translate(-50%,-50%);
|
1462 |
padding: 3px 14px;
|
1463 |
text-decoration: none;
|
1464 |
font-size: 14px;
|
1465 |
color: #fff;
|
|
|
1466 |
|
1467 |
}
|
1468 |
|
@@ -1545,8 +1659,7 @@ class settings_tabs_field{
|
|
1545 |
|
1546 |
ob_start();
|
1547 |
?>
|
1548 |
-
<input name="<?php echo $field_name; ?>" id="<?php echo $css_id; ?>" placeholder="<?php echo $placeholder; ?>" value="<?php echo $value; ?>" />
|
1549 |
-
<script>jQuery(document).ready(function($) { $("#<?php echo $css_id; ?>").wpColorPicker();});</script>
|
1550 |
<?php
|
1551 |
|
1552 |
$input_html = ob_get_clean();
|
4 |
if( ! class_exists( 'settings_tabs_field' ) ) {
|
5 |
class settings_tabs_field{
|
6 |
|
7 |
+
// public $asset_dir_url = '';
|
8 |
+
public $textdomain = 'settings-tabs';
|
9 |
+
|
10 |
public function __construct(){
|
11 |
+
|
12 |
+
// $this->asset_dir_url = isset($args['asset_dir_url']) ? $args['asset_dir_url'] : '';
|
13 |
+
// $this->textdomain = isset($args['textdomain']) ? $args['textdomain'] : '';
|
14 |
+
|
15 |
}
|
16 |
|
17 |
|
18 |
+
function admin_scripts(){
|
19 |
+
|
20 |
+
|
21 |
+
wp_enqueue_script('jquery');
|
22 |
+
wp_enqueue_script('jquery-ui-sortable');
|
23 |
+
wp_enqueue_script( 'jquery-ui-core' );
|
24 |
+
wp_enqueue_script('jquery-ui-accordion');
|
25 |
+
wp_enqueue_style( 'jquery-ui');
|
26 |
+
|
27 |
+
wp_enqueue_script('wp-color-picker');
|
28 |
+
wp_enqueue_style( 'wp-color-picker' );
|
29 |
+
|
30 |
+
|
31 |
+
wp_enqueue_style( 'font-awesome-5' );
|
32 |
+
|
33 |
+
wp_enqueue_style( 'settings-tabs' );
|
34 |
+
wp_enqueue_script( 'settings-tabs' );
|
35 |
+
|
36 |
+
wp_enqueue_script( 'code-editor' );
|
37 |
+
wp_enqueue_style( 'code-editor' );
|
38 |
+
|
39 |
+
wp_enqueue_editor();
|
40 |
+
}
|
41 |
|
42 |
function field_template($option){
|
43 |
|
66 |
|
67 |
|
68 |
|
|
|
69 |
|
70 |
|
|
|
|
|
71 |
|
72 |
function generate_field($option){
|
73 |
|
110 |
|
111 |
elseif( isset($option['type']) && $option['type'] === 'option_group') $this->field_option_group( $option );
|
112 |
elseif( isset($option['type']) && $option['type'] === 'option_group_accordion') $this->field_option_group_accordion( $option );
|
113 |
+
elseif( isset($option['type']) && $option['type'] === 'wp_editor') $this->field_wp_editor( $option );
|
114 |
+
elseif( isset($option['type']) && $option['type'] === 'textarea_editor') $this->field_textarea_editor( $option );
|
115 |
|
116 |
|
117 |
|
341 |
|
342 |
$media_url = wp_get_attachment_url( $value );
|
343 |
$media_type = get_post_mime_type( $value );
|
344 |
+
$media_title = !empty($value) ? get_the_title( $value ) : __('Placeholder.jpg', $this->textdomain);
|
345 |
|
346 |
|
347 |
$media_url = !empty($media_url) ? $media_url : $default;
|
397 |
?>
|
398 |
</div>
|
399 |
<input class="media-input-value" type="hidden" name="<?php echo $field_name; ?>" id="media_input_<?php echo $css_id; ?>" value="<?php echo $value; ?>" />
|
400 |
+
<div class="media-upload button" id="media_upload_<?php echo $css_id; ?>"><?php echo __('Upload', $this->textdomain);?></div>
|
401 |
+
<div placeholder="<?php echo $placeholder; ?>" class="clear button" id="media_clear_<?php echo $css_id; ?>"><?php echo __('Clear', $this->textdomain);?></div>
|
402 |
<div class="error-mgs"></div>
|
403 |
</div>
|
404 |
|
478 |
?>
|
479 |
</div>
|
480 |
<input type="text" placeholder="<?php echo $placeholder; ?>" name="<?php echo $field_name; ?>" id="media_input_<?php echo $css_id; ?>" value="<?php echo $value; ?>" />
|
481 |
+
<div class="media-upload button" id="media_upload_<?php echo $css_id; ?>"><?php echo __('Upload', $this->textdomain);?></div>
|
482 |
+
<div class="clear button" id="media_clear_<?php echo $css_id; ?>"><?php echo __('Clear','accordions');?></div>
|
483 |
<div class="error-mgs"></div>
|
484 |
</div>
|
485 |
|
525 |
?>
|
526 |
<script>
|
527 |
jQuery(document).ready(function($) {
|
|
|
|
|
|
|
|
|
528 |
jQuery(document).on("click", ".field-repeatable-wrapper-<?php echo $css_id; ?> .add-repeat-field", function() {
|
529 |
|
530 |
|
585 |
</script>
|
586 |
<div id="input-wrapper-<?php echo $css_id; ?>" class=" input-wrapper field-repeatable-wrapper
|
587 |
field-repeatable-wrapper-<?php echo $css_id; ?>">
|
588 |
+
<div class="add-repeat-field"><i class="far fa-plus-square"></i> <?php _e('Add','accordions'); ?></div>
|
589 |
<div class="repeatable-field-list sortable" id="<?php echo $css_id; ?>">
|
590 |
<?php
|
591 |
if(!empty($values)):
|
592 |
$count = 1;
|
593 |
foreach ($values as $index=>$val):
|
594 |
$title_field_val = !empty($val[$title_field]) ? $val[$title_field] : '#'.$count;
|
595 |
+
|
596 |
+
//var_dump($index);
|
597 |
+
|
598 |
?>
|
599 |
+
<div class="item-wrap <?php if($collapsible) echo 'collapsible'; ?>" index="<?php echo $index; ?>">
|
600 |
<?php if($collapsible):?>
|
601 |
<div class="header">
|
602 |
<?php endif; ?>
|
615 |
|
616 |
foreach ($fields as $field_index => $field):
|
617 |
$fieldId = $field['id'];
|
618 |
+
$field_css_id = isset($field['css_id']) ? str_replace('TIMEINDEX', $index, $field['css_id']) : '';
|
619 |
+
|
620 |
+
//var_dump($field_css_id);
|
621 |
|
622 |
$title_field_class = ($title_field == $field_index) ? 'title-field':'';
|
623 |
?>
|
628 |
|
629 |
<?php
|
630 |
$field['parent'] = $field_name.'['.$index.']';
|
631 |
+
$field['css_id'] = $field_css_id;
|
632 |
+
|
633 |
$field['value'] = isset($val[$fieldId]) ? $val[$fieldId] : '';
|
634 |
|
635 |
$settings_tabs_field->generate_field($field);
|
856 |
?>
|
857 |
<div id="input-wrapper-<?php echo $id; ?>" class="input-wrapper input-text-multi-wrapper
|
858 |
input-text-multi-wrapper-<?php echo $css_id; ?>">
|
859 |
+
<span data-placeholder="<?php echo esc_attr($placeholder); ?>" data-sort="<?php echo $sortable; ?>" data-clone="<?php echo $allow_clone; ?>" data-name="<?php echo $field_name; ?>[]" class="button add-item"><?php echo __('Add', $this->textdomain); ?></span>
|
860 |
<div class="field-list <?php if($sortable){ echo 'sortable'; }?>" id="<?php echo $css_id; ?>">
|
861 |
<?php
|
862 |
if(!empty($values)):
|
991 |
|
992 |
|
993 |
|
994 |
+
public function field_wp_editor( $option ){
|
995 |
+
|
996 |
+
$id = isset( $option['id'] ) ? $option['id'] : "";
|
997 |
+
$css_id = isset( $option['css_id'] ) ? $option['css_id'] : $id;
|
998 |
+
$parent = isset( $option['parent'] ) ? $option['parent'] : "";
|
999 |
+
$placeholder = isset( $option['placeholder'] ) ? $option['placeholder'] : "";
|
1000 |
+
$value = isset( $option['value'] ) ? $option['value'] : '';
|
1001 |
+
$default = isset( $option['default'] ) ? $option['default'] : '';
|
1002 |
+
$field_template = isset( $option['field_template'] ) ? $option['field_template'] : $this->field_template($option);
|
1003 |
+
|
1004 |
+
|
1005 |
+
|
1006 |
+
$is_pro = isset( $option['is_pro'] ) ? $option['is_pro'] : false;
|
1007 |
+
$pro_text = isset( $option['pro_text'] ) ? $option['pro_text'] : '';
|
1008 |
+
|
1009 |
+
$value = !empty($value) ? $value : $default;
|
1010 |
+
|
1011 |
+
$title = isset( $option['title'] ) ? $option['title'] : "";
|
1012 |
+
$details = isset( $option['details'] ) ? $option['details'] : "";
|
1013 |
+
|
1014 |
+
if($is_pro == true){
|
1015 |
+
$details = '<span class="pro-feature">'.$pro_text.'</span> '.$details;
|
1016 |
+
}
|
1017 |
+
|
1018 |
+
$field_name = !empty($parent) ? $parent.'['.$id.']' : $id;
|
1019 |
+
|
1020 |
+
$editor_settings= isset( $option['editor_settings'] ) ? $option['editor_settings'] : array('textarea_name'=>$field_name, 'teeny' => true, 'textarea_rows' => 15, );
|
1021 |
+
|
1022 |
+
ob_start();
|
1023 |
+
|
1024 |
+
?>
|
1025 |
+
<div id="field-wrapper-<?php echo $id; ?>" class="<?php if(!empty($depends)) echo 'dependency-field'; ?> field-wrapper field-wp_editor-wrapper
|
1026 |
+
field-wp_editor-wrapper-<?php echo $id; ?>">
|
1027 |
+
<?php
|
1028 |
+
wp_editor( $value, $css_id, $editor_settings);
|
1029 |
+
?>
|
1030 |
+
<div class="error-mgs"></div>
|
1031 |
+
</div>
|
1032 |
+
|
1033 |
+
<?php
|
1034 |
+
|
1035 |
+
|
1036 |
+
|
1037 |
+
|
1038 |
+
$input_html = ob_get_clean();
|
1039 |
+
|
1040 |
+
echo sprintf($field_template, $title, $input_html, $details);
|
1041 |
+
|
1042 |
+
}
|
1043 |
+
|
1044 |
+
|
1045 |
|
1046 |
|
1047 |
|
1072 |
ob_start();
|
1073 |
?>
|
1074 |
<div class="text-icon">
|
1075 |
+
<span class="icon"><?php echo $option_value; ?></span><input type="text" class="" name="<?php echo $field_name; ?>" id="<?php echo $css_id; ?>" placeholder="<?php echo esc_attr($placeholder); ?>" value="<?php echo esc_attr($option_value); ?>" />
|
1076 |
</div>
|
1077 |
<style type="text/css">
|
1078 |
.text-icon{}
|
1093 |
$(document).on("keyup", ".text-icon input", function () {
|
1094 |
val = $(this).val();
|
1095 |
if(val){
|
1096 |
+
$(this).parent().children(".icon").html(val);
|
1097 |
}
|
1098 |
})
|
1099 |
})
|
1202 |
|
1203 |
echo sprintf($field_template, $title, $input_html, $details);
|
1204 |
|
1205 |
+
}
|
1206 |
+
|
1207 |
+
|
1208 |
+
|
1209 |
+
public function field_textarea_editor( $option ){
|
1210 |
+
|
1211 |
+
$id = isset( $option['id'] ) ? $option['id'] : "";
|
1212 |
+
$css_id = isset( $option['css_id'] ) ? $option['css_id'] : $id;
|
1213 |
+
$parent = isset( $option['parent'] ) ? $option['parent'] : "";
|
1214 |
+
$field_template = isset( $option['field_template'] ) ? $option['field_template'] : $this->field_template($option);
|
1215 |
+
$placeholder = isset( $option['placeholder'] ) ? $option['placeholder'] : "";
|
1216 |
+
$value = isset( $option['value'] ) ? $option['value'] : '';
|
1217 |
+
$default = isset( $option['default'] ) ? $option['default'] : '';
|
1218 |
+
$value = !empty($value) ? $value : $default;
|
1219 |
+
|
1220 |
+
$is_pro = isset( $option['is_pro'] ) ? $option['is_pro'] : false;
|
1221 |
+
$pro_text = isset( $option['pro_text'] ) ? $option['pro_text'] : '';
|
1222 |
+
|
1223 |
+
$title = isset( $option['title'] ) ? $option['title'] : "";
|
1224 |
+
$details = isset( $option['details'] ) ? $option['details'] : "";
|
1225 |
+
|
1226 |
+
$field_name = !empty($parent) ? $parent.'['.$id.']' : $id;
|
1227 |
+
|
1228 |
+
if($is_pro == true){
|
1229 |
+
$details = '<span class="pro-feature">'.$pro_text.'</span> '.$details;
|
1230 |
+
}
|
1231 |
|
1232 |
|
1233 |
+
ob_start();
|
1234 |
+
?>
|
1235 |
+
<textarea editor_enabled="no" class="textarea-editor" name="<?php echo $field_name; ?>" id="<?php echo $css_id; ?>" cols="40" rows="5" placeholder="<?php echo $placeholder; ?>"><?php echo $value; ?></textarea>
|
1236 |
+
<?php
|
1237 |
|
1238 |
+
$input_html = ob_get_clean();
|
1239 |
|
1240 |
+
echo sprintf($field_template, $title, $input_html, $details);
|
1241 |
|
1242 |
}
|
1243 |
|
1262 |
|
1263 |
$field_name = !empty($parent) ? $parent.'['.$id.']' : $id;
|
1264 |
|
1265 |
+
$settings = wp_enqueue_code_editor( array( 'type' => 'text/javascript' ) );
|
1266 |
+
$code_editor = wp_json_encode( $settings );
|
1267 |
|
1268 |
|
1269 |
ob_start();
|
1272 |
|
1273 |
<script>
|
1274 |
jQuery(document).ready(function($){
|
1275 |
+
wp.codeEditor.initialize($('#<?php echo $css_id; ?>'), <?php echo $code_editor; ?>);
|
|
|
|
|
|
|
1276 |
})
|
1277 |
</script>
|
1278 |
<?php
|
1305 |
$title = isset( $option['title'] ) ? $option['title'] : "";
|
1306 |
$details = isset( $option['details'] ) ? $option['details'] : "";
|
1307 |
|
1308 |
+
$settings = wp_enqueue_code_editor( array( 'type' => 'text/css' ) );
|
1309 |
+
$code_editor = wp_json_encode( $settings );
|
1310 |
|
1311 |
$field_name = !empty($parent) ? $parent.'['.$id.']' : $id;
|
1312 |
?>
|
1321 |
|
1322 |
jQuery(document).ready(function($){
|
1323 |
|
1324 |
+
wp.codeEditor.initialize($('#<?php echo $css_id; ?>'), <?php echo $code_editor; ?>);
|
1325 |
|
1326 |
|
1327 |
})
|
1498 |
if(!empty($thumb)):
|
1499 |
?>
|
1500 |
<img style="width: <?php echo $width; ?>;" alt="<?php echo $name; ?>" src="<?php echo $thumb; ?>">
|
1501 |
+
<div style="padding: 5px;" class="name"><?php echo $name; ?></div>
|
1502 |
|
1503 |
<?php
|
1504 |
else:
|
1570 |
.radio-img label .link{
|
1571 |
background: hsl(200, 7%, 42%);
|
1572 |
position: absolute;
|
1573 |
+
top: 2px;
|
1574 |
+
/* transform: translate(0%,-50%); */
|
|
|
1575 |
padding: 3px 14px;
|
1576 |
text-decoration: none;
|
1577 |
font-size: 14px;
|
1578 |
color: #fff;
|
1579 |
+
right: 2px;
|
1580 |
|
1581 |
}
|
1582 |
|
1659 |
|
1660 |
ob_start();
|
1661 |
?>
|
1662 |
+
<input colorPicker="" name="<?php echo $field_name; ?>" id="<?php echo $css_id; ?>" placeholder="<?php echo esc_attr($placeholder); ?>" value="<?php echo esc_attr($value); ?>" />
|
|
|
1663 |
<?php
|
1664 |
|
1665 |
$input_html = ob_get_clean();
|
includes/functions-layout-element.php
CHANGED
@@ -3,6 +3,25 @@ if ( ! defined('ABSPATH')) exit; // if direct access
|
|
3 |
|
4 |
|
5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
add_action('wcps_layout_element_post_title', 'wcps_layout_element_post_title', 10);
|
7 |
function wcps_layout_element_post_title($args){
|
8 |
|
@@ -611,285 +630,1135 @@ function wcps_layout_element_wrapper_end($args){
|
|
611 |
|
612 |
}
|
613 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
614 |
|
|
|
|
|
|
|
|
|
615 |
|
|
|
616 |
|
|
|
|
|
|
|
617 |
|
618 |
-
|
619 |
-
function wcps_layout_element_css_post_title($args){
|
620 |
|
621 |
|
622 |
-
|
|
|
|
|
|
|
|
|
623 |
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
624 |
-
$
|
625 |
|
626 |
-
$
|
627 |
-
$
|
628 |
-
$font_family = isset($elementData['font_family']) ? $elementData['font_family'] : '';
|
629 |
-
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
630 |
-
$text_align = isset($elementData['text_align']) ? $elementData['text_align'] : '';
|
631 |
|
632 |
|
633 |
-
|
634 |
|
635 |
-
|
636 |
-
<style type="text/css">
|
637 |
-
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
638 |
-
<?php if(!empty($color)): ?>
|
639 |
-
color: <?php echo $color; ?>;
|
640 |
-
<?php endif; ?>
|
641 |
-
<?php if(!empty($font_size)): ?>
|
642 |
-
font-size: <?php echo $font_size; ?>;
|
643 |
-
<?php endif; ?>
|
644 |
-
<?php if(!empty($font_family)): ?>
|
645 |
-
font-family: <?php echo $font_family; ?>;
|
646 |
-
<?php endif; ?>
|
647 |
-
<?php if(!empty($margin)): ?>
|
648 |
-
margin: <?php echo $margin; ?>;
|
649 |
-
<?php endif; ?>
|
650 |
-
<?php if(!empty($text_align)): ?>
|
651 |
-
text-align: <?php echo $text_align; ?>;
|
652 |
-
<?php endif; ?>
|
653 |
-
}
|
654 |
-
</style>
|
655 |
-
<?php
|
656 |
-
}
|
657 |
|
|
|
|
|
|
|
658 |
|
659 |
|
|
|
|
|
|
|
|
|
|
|
660 |
|
661 |
|
662 |
|
|
|
663 |
|
|
|
|
|
664 |
|
665 |
-
|
666 |
-
function wcps_layout_element_css_product_category($args){
|
667 |
|
668 |
-
//echo '<pre>'.var_export($args, true).'</pre>';
|
669 |
-
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
670 |
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
671 |
-
$
|
672 |
-
|
673 |
-
$link_color = isset($elementData['link_color']) ? $elementData['link_color'] : '';
|
674 |
-
$font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
|
675 |
-
$font_family = isset($elementData['font_family']) ? $elementData['font_family'] : '';
|
676 |
-
$wrapper_margin = isset($elementData['wrapper_margin']) ? $elementData['wrapper_margin'] : '';
|
677 |
-
$text_align = isset($elementData['text_align']) ? (int) $elementData['text_align'] : '';
|
678 |
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
margin: <?php echo $wrapper_margin; ?>;
|
683 |
|
684 |
-
|
685 |
|
686 |
-
|
687 |
-
|
688 |
-
color: <?php echo $link_color; ?>;
|
689 |
-
<?php endif; ?>
|
690 |
-
<?php if(!empty($font_size)): ?>
|
691 |
-
font-size: <?php echo $font_size; ?>;
|
692 |
-
<?php endif; ?>
|
693 |
-
<?php if(!empty($font_family)): ?>
|
694 |
-
font-family: <?php echo $font_family; ?>;
|
695 |
-
<?php endif; ?>
|
696 |
-
text-decoration: none;
|
697 |
-
<?php if(!empty($text_align)): ?>
|
698 |
-
text-align: <?php echo $text_align; ?>;
|
699 |
-
<?php endif; ?>
|
700 |
-
}
|
701 |
-
</style>
|
702 |
<?php
|
703 |
-
}
|
704 |
|
|
|
705 |
|
706 |
|
|
|
|
|
707 |
|
708 |
-
|
709 |
-
function wcps_layout_element_css_product_tag($args){
|
710 |
|
711 |
-
//echo '<pre>'.var_export($args, true).'</pre>';
|
712 |
-
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
713 |
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
714 |
-
$
|
715 |
|
716 |
-
$
|
717 |
-
$
|
718 |
-
|
719 |
-
$
|
|
|
|
|
720 |
|
|
|
721 |
|
722 |
?>
|
723 |
-
<
|
724 |
-
|
725 |
-
<?php if(!empty($wrapper_margin)): ?>
|
726 |
-
margin: <?php echo $wrapper_margin; ?>;
|
727 |
-
<?php endif; ?>
|
728 |
|
729 |
-
|
730 |
|
731 |
-
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?> a{
|
732 |
-
<?php if(!empty($link_color)): ?>
|
733 |
-
color: <?php echo $link_color; ?>;
|
734 |
-
<?php endif; ?>
|
735 |
-
<?php if(!empty($font_size)): ?>
|
736 |
-
font-size: <?php echo $font_size; ?>;
|
737 |
-
<?php endif; ?>
|
738 |
-
<?php if(!empty($font_family)): ?>
|
739 |
-
font-family: <?php echo $font_family; ?>;
|
740 |
-
<?php endif; ?>
|
741 |
-
text-decoration: none;
|
742 |
|
743 |
-
}
|
744 |
-
</style>
|
745 |
-
<?php
|
746 |
-
}
|
747 |
|
748 |
|
749 |
|
750 |
|
751 |
-
add_action('
|
752 |
-
function
|
753 |
|
754 |
//echo '<pre>'.var_export($args, true).'</pre>';
|
755 |
-
$
|
756 |
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
757 |
-
$
|
758 |
|
759 |
-
$
|
760 |
-
$
|
761 |
-
$font_family = isset($elementData['font_family']) ? $elementData['font_family'] : '';
|
762 |
-
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
763 |
|
764 |
|
765 |
-
?>
|
766 |
-
<style type="text/css">
|
767 |
-
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
768 |
-
<?php if(!empty($margin)): ?>
|
769 |
-
margin: <?php echo $margin; ?>;
|
770 |
-
<?php endif; ?>
|
771 |
|
772 |
-
|
773 |
|
774 |
-
|
775 |
-
<?php
|
776 |
-
}
|
777 |
|
778 |
-
|
779 |
-
|
780 |
|
781 |
-
|
782 |
-
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
783 |
-
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
784 |
-
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
785 |
|
786 |
-
|
787 |
-
$text_color = isset($elementData['text_color']) ? $elementData['text_color'] : '';
|
788 |
-
$font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
|
789 |
-
$padding = isset($elementData['padding']) ? $elementData['padding'] : '';
|
790 |
|
791 |
|
792 |
-
?>
|
793 |
-
<style type="text/css">
|
794 |
-
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
795 |
-
<?php if(!empty($background_color)): ?>
|
796 |
-
background-color: <?php echo $background_color; ?>;
|
797 |
-
<?php endif; ?>
|
798 |
-
<?php if(!empty($text_color)): ?>
|
799 |
-
color: <?php echo $text_color; ?>;
|
800 |
-
<?php endif; ?>
|
801 |
-
<?php if(!empty($font_size)): ?>
|
802 |
-
font-size: <?php echo $font_size; ?>;
|
803 |
-
<?php endif; ?>
|
804 |
-
line-height: normal;
|
805 |
-
<?php if(!empty($padding)): ?>
|
806 |
-
padding: <?php echo $padding; ?>;
|
807 |
-
<?php endif; ?>
|
808 |
-
}
|
809 |
|
810 |
-
</style>
|
811 |
-
<?php
|
812 |
-
}
|
813 |
|
814 |
-
add_action('
|
815 |
-
function
|
816 |
|
817 |
//echo '<pre>'.var_export($args, true).'</pre>';
|
818 |
-
$
|
819 |
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
820 |
-
$
|
821 |
|
822 |
-
$
|
823 |
-
$
|
824 |
-
|
825 |
-
|
|
|
|
|
|
|
|
|
|
|
826 |
|
|
|
827 |
|
828 |
?>
|
829 |
-
<
|
830 |
-
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
831 |
-
<?php if(!empty($background_color)): ?>
|
832 |
-
background-color: <?php echo $background_color; ?>;
|
833 |
-
<?php endif; ?>
|
834 |
-
<?php if(!empty($text_color)): ?>
|
835 |
-
color: <?php echo $text_color; ?>;
|
836 |
-
<?php endif; ?>
|
837 |
-
<?php if(!empty($font_size)): ?>
|
838 |
-
font-size: <?php echo $font_size; ?>;
|
839 |
-
<?php endif; ?>
|
840 |
-
line-height: normal;
|
841 |
-
<?php if(!empty($padding)): ?>
|
842 |
-
padding: <?php echo $padding; ?>;
|
843 |
-
<?php endif; ?>
|
844 |
-
}
|
845 |
-
</style>
|
846 |
<?php
|
|
|
847 |
}
|
848 |
|
849 |
|
850 |
|
851 |
-
add_action('
|
852 |
-
function
|
853 |
|
854 |
//echo '<pre>'.var_export($args, true).'</pre>';
|
855 |
-
$
|
856 |
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
857 |
-
$
|
858 |
|
859 |
-
$
|
860 |
-
$
|
861 |
-
$font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
|
862 |
-
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
863 |
|
|
|
864 |
|
865 |
-
|
866 |
-
|
867 |
-
|
868 |
-
|
869 |
-
|
870 |
-
<?php endif; ?>
|
871 |
-
<?php if(!empty($text_color)): ?>
|
872 |
-
color: <?php echo $text_color; ?>;
|
873 |
-
<?php endif; ?>
|
874 |
-
<?php if(!empty($font_size)): ?>
|
875 |
-
font-size: <?php echo $font_size; ?>;
|
876 |
-
<?php endif; ?>
|
877 |
-
line-height: normal;
|
878 |
-
<?php if(!empty($margin)): ?>
|
879 |
-
padding: <?php echo $margin; ?>;
|
880 |
-
<?php endif; ?>
|
881 |
-
}
|
882 |
-
</style>
|
883 |
-
<?php
|
884 |
-
}
|
885 |
|
|
|
|
|
|
|
|
|
|
|
886 |
|
887 |
|
|
|
888 |
|
889 |
|
890 |
|
891 |
-
add_action('
|
892 |
-
function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
893 |
|
894 |
//echo '<pre>'.var_export($args, true).'</pre>';
|
895 |
$wcps_id = isset($args['wcps_id']) ? $args['wcps_id'] : '';
|
@@ -1118,3 +1987,5 @@ function wcps_layout_element_css_thumbnail($args){
|
|
1118 |
</style>
|
1119 |
<?php
|
1120 |
}
|
|
|
|
3 |
|
4 |
|
5 |
|
6 |
+
add_action('wcps_layout_element_custom_text', 'wcps_layout_element_custom_text', 10);
|
7 |
+
function wcps_layout_element_custom_text($args){
|
8 |
+
|
9 |
+
//echo '<pre>'.var_export($args, true).'</pre>';
|
10 |
+
$product_id = isset($args['product_id']) ? $args['product_id'] : '';
|
11 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
12 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
13 |
+
$content = isset($elementData['content']) ? $elementData['content'] : '';
|
14 |
+
|
15 |
+
|
16 |
+
$element_class = !empty($element_index) ? 'element-custom_text element-'.$element_index : 'element-custom_text';
|
17 |
+
|
18 |
+
?>
|
19 |
+
<div class="<?php echo $element_class; ?>"><?php echo $content; ?></div>
|
20 |
+
<?php
|
21 |
+
|
22 |
+
}
|
23 |
+
|
24 |
+
|
25 |
add_action('wcps_layout_element_post_title', 'wcps_layout_element_post_title', 10);
|
26 |
function wcps_layout_element_post_title($args){
|
27 |
|
630 |
|
631 |
}
|
632 |
|
633 |
+
add_action('wcps_layout_element_term_title', 'wcps_layout_element_term_title', 10);
|
634 |
+
function wcps_layout_element_term_title($args){
|
635 |
+
|
636 |
+
$term_id = isset($args['term_id']) ? (int)$args['term_id'] : (int) wcps_get_first_category_id();
|
637 |
+
|
638 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
639 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
640 |
|
641 |
+
$element_class = !empty($element_index) ? 'element-term_title element-'.$element_index : 'element-term_title';
|
642 |
+
$term = get_term( $term_id );
|
643 |
+
$term_title = isset($term->name) ? $term->name : '';
|
644 |
+
$term_link = get_term_link($term_id);
|
645 |
|
646 |
+
//var_dump($term_link);
|
647 |
|
648 |
+
?>
|
649 |
+
<div class="<?php echo $element_class; ?>"><a href="<?php echo $term_link; ?>"><?php echo $term_title; ?></a> </div>
|
650 |
+
<?php
|
651 |
|
652 |
+
}
|
|
|
653 |
|
654 |
|
655 |
+
add_action('wcps_layout_element_term_thumb', 'wcps_layout_element_term_thumb', 10);
|
656 |
+
function wcps_layout_element_term_thumb($args){
|
657 |
+
|
658 |
+
$term_id = isset($args['term_id']) ? (int)$args['term_id'] : (int) wcps_get_first_category_id();
|
659 |
+
|
660 |
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
661 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
662 |
|
663 |
+
$thumb_size = isset($elementData['thumb_size']) ? $elementData['thumb_size'] : '';
|
664 |
+
$default_thumb_src = isset($elementData['default_thumb_src']) ? $elementData['default_thumb_src'] : '';
|
|
|
|
|
|
|
665 |
|
666 |
|
667 |
+
$element_class = !empty($element_index) ? 'element-term_thumb element-'.$element_index : 'element-term_thumb';
|
668 |
|
669 |
+
$thumbnail_id = get_term_meta( $term_id, 'thumbnail_id', true );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
670 |
|
671 |
+
$image_url = wp_get_attachment_url( $thumbnail_id );
|
672 |
+
$image_url = !empty($image_url) ? $image_url : $default_thumb_src;
|
673 |
+
$term_link = get_term_link($term_id);
|
674 |
|
675 |
|
676 |
+
if(!empty($image_url)):
|
677 |
+
?>
|
678 |
+
<div class="<?php echo $element_class; ?>"><a href="<?php echo $term_link; ?>"><img src="<?php echo $image_url; ?>"></a></div>
|
679 |
+
<?php
|
680 |
+
endif;
|
681 |
|
682 |
|
683 |
|
684 |
+
}
|
685 |
|
686 |
+
add_action('wcps_layout_element_term_description', 'wcps_layout_element_term_description', 10);
|
687 |
+
function wcps_layout_element_term_description($args){
|
688 |
|
689 |
+
$term_id = isset($args['term_id']) ? $args['term_id'] : (int) wcps_get_first_category_id();
|
|
|
690 |
|
|
|
|
|
691 |
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
692 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
|
|
|
|
|
|
|
|
|
|
|
|
693 |
|
694 |
+
$element_class = !empty($element_index) ? 'element-term_title element-'.$element_index : 'element-term_title';
|
695 |
+
$term = get_term( $term_id );
|
696 |
+
$term_description = isset($term->description) ? $term->description : '';
|
|
|
697 |
|
698 |
+
//var_dump($term);
|
699 |
|
700 |
+
?>
|
701 |
+
<div class="<?php echo $element_class; ?>"><?php echo $term_description; ?></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
702 |
<?php
|
|
|
703 |
|
704 |
+
}
|
705 |
|
706 |
|
707 |
+
add_action('wcps_layout_element_term_post_count', 'wcps_layout_element_term_post_count', 10);
|
708 |
+
function wcps_layout_element_term_post_count($args){
|
709 |
|
710 |
+
$term_id = isset($args['term_id']) ? $args['term_id'] : (int) wcps_get_first_category_id();
|
|
|
711 |
|
|
|
|
|
712 |
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
713 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
714 |
|
715 |
+
$wrapper_html = isset($elementData['wrapper_html']) ? $elementData['wrapper_html'] : '';
|
716 |
+
$wrapper_html = !empty($wrapper_html) ? $wrapper_html : '%s';
|
717 |
+
|
718 |
+
$element_class = !empty($element_index) ? 'element-term_title element-'.$element_index : 'element-term_title';
|
719 |
+
$term = get_term( $term_id );
|
720 |
+
$term_count = isset($term->count) ? $term->count : '';
|
721 |
|
722 |
+
//var_dump($term);
|
723 |
|
724 |
?>
|
725 |
+
<div class="<?php echo $element_class; ?>"><?php echo sprintf($wrapper_html, $term_count); ?></div>
|
726 |
+
<?php
|
|
|
|
|
|
|
727 |
|
728 |
+
}
|
729 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
730 |
|
|
|
|
|
|
|
|
|
731 |
|
732 |
|
733 |
|
734 |
|
735 |
+
add_action('wcps_layout_element_order_date', 'wcps_layout_element_order_date', 10);
|
736 |
+
function wcps_layout_element_order_date($args){
|
737 |
|
738 |
//echo '<pre>'.var_export($args, true).'</pre>';
|
739 |
+
$post_id = !empty($args['post_id']) ? $args['post_id'] : wcps_get_first_order_id();
|
740 |
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
741 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
742 |
|
743 |
+
$wrapper_html = isset($elementData['wrapper_html']) ? $elementData['wrapper_html'] : '';
|
744 |
+
$wrapper_html = !empty($wrapper_html) ? $wrapper_html : '%s';
|
|
|
|
|
745 |
|
746 |
|
|
|
|
|
|
|
|
|
|
|
|
|
747 |
|
748 |
+
$post_date = get_the_date('Y-m-d', $post_id);
|
749 |
|
750 |
+
$element_class = !empty($element_index) ? 'element-order_date element-'.$element_index : 'element-order_date';
|
|
|
|
|
751 |
|
752 |
+
?>
|
753 |
+
<div class="<?php echo $element_class; ?>"><?php echo sprintf($wrapper_html, $post_date); ?></div>
|
754 |
|
755 |
+
<?php
|
|
|
|
|
|
|
756 |
|
757 |
+
}
|
|
|
|
|
|
|
758 |
|
759 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
760 |
|
|
|
|
|
|
|
761 |
|
762 |
+
add_action('wcps_layout_element_order_customer_thumb', 'wcps_layout_element_order_customer_thumb', 10);
|
763 |
+
function wcps_layout_element_order_customer_thumb($args){
|
764 |
|
765 |
//echo '<pre>'.var_export($args, true).'</pre>';
|
766 |
+
$post_id = !empty($args['post_id']) ? $args['post_id'] : wcps_get_first_order_id();
|
767 |
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
768 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
769 |
|
770 |
+
$post_data = get_post($post_id);
|
771 |
+
$post_title = isset($post_data->post_title) ? $post_data->post_title : '';
|
772 |
+
|
773 |
+
if(empty($post_id)) return;
|
774 |
+
|
775 |
+
|
776 |
+
$element_class = !empty($element_index) ? 'element-order_customer_thumb element-'.$element_index : 'element-order_customer_thumb';
|
777 |
+
$order = wc_get_order($post_id);
|
778 |
+
$user_id = $order->get_user_id();
|
779 |
|
780 |
+
//var_dump($user_id);
|
781 |
|
782 |
?>
|
783 |
+
<div class="<?php echo $element_class; ?>"><?php echo get_avatar($user_id); ?></div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
784 |
<?php
|
785 |
+
|
786 |
}
|
787 |
|
788 |
|
789 |
|
790 |
+
add_action('wcps_layout_element_order_customer_name', 'wcps_layout_element_order_customer_name', 10);
|
791 |
+
function wcps_layout_element_order_customer_name($args){
|
792 |
|
793 |
//echo '<pre>'.var_export($args, true).'</pre>';
|
794 |
+
$post_id = !empty($args['post_id']) ? $args['post_id'] : wcps_get_first_order_id();
|
795 |
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
796 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
797 |
|
798 |
+
$wrapper_html = isset($elementData['wrapper_html']) ? $elementData['wrapper_html'] : '';
|
799 |
+
$wrapper_html = !empty($wrapper_html) ? $wrapper_html : '%s';
|
|
|
|
|
800 |
|
801 |
+
$element_class = !empty($element_index) ? 'element-order_customer_name element-'.$element_index : 'element-order_customer_name';
|
802 |
|
803 |
+
if(empty($post_id)) return;
|
804 |
+
|
805 |
+
$order = wc_get_order($post_id);
|
806 |
+
$user_id = $order->get_user_id();
|
807 |
+
$user_data = get_user_by('ID', $user_id);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
808 |
|
809 |
+
if(!empty($user_data->display_name)):
|
810 |
+
?>
|
811 |
+
<div class="<?php echo $element_class; ?>"><?php echo sprintf($wrapper_html, $user_data->display_name); ?></div>
|
812 |
+
<?php
|
813 |
+
endif;
|
814 |
|
815 |
|
816 |
+
}
|
817 |
|
818 |
|
819 |
|
820 |
+
add_action('wcps_layout_element_order_items', 'wcps_layout_element_order_items', 10);
|
821 |
+
function wcps_layout_element_order_items($args){
|
822 |
+
|
823 |
+
//echo '<pre>'.var_export($args, true).'</pre>';
|
824 |
+
$post_id = !empty($args['post_id']) ? $args['post_id'] : wcps_get_first_order_id();
|
825 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
826 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
827 |
+
|
828 |
+
$wrapper_html = isset($elementData['wrapper_html']) ? $elementData['wrapper_html'] : '';
|
829 |
+
$wrapper_html = !empty($wrapper_html) ? $wrapper_html : '%s';
|
830 |
+
|
831 |
+
$element_class = !empty($element_index) ? 'element-order_customer_name element-'.$element_index : 'element-order_customer_name';
|
832 |
+
|
833 |
+
if(empty($post_id)) return;
|
834 |
+
|
835 |
+
$order = wc_get_order($post_id);
|
836 |
+
$user_id = $order->get_user_id();
|
837 |
+
$user_data = get_user_by('ID', $user_id);
|
838 |
+
|
839 |
+
$order_data = $order->get_data(); // The Order data
|
840 |
+
$items = $order->get_items();
|
841 |
+
|
842 |
+
$product_list = '';
|
843 |
+
$i = 1;
|
844 |
+
$item_count = count($items);
|
845 |
+
|
846 |
+
foreach( $items as $product ) {
|
847 |
+
//echo '<pre>'.var_export($product, true).'</pre>';
|
848 |
+
$product_id = $product['product_id'];
|
849 |
+
$product_link = get_permalink($product_id);
|
850 |
+
|
851 |
+
$product_list .= '<a href="'.$product_link.'">'.$product['name'].'</a> X '.$product['qty'];
|
852 |
+
$product_list .= ($i < $item_count) ? ', ': '';
|
853 |
+
|
854 |
+
$i++;
|
855 |
+
}
|
856 |
+
//$product_list = implode( ',', $product_details );
|
857 |
+
//echo '<pre>'.var_export($product_list, true).'</pre>';
|
858 |
+
|
859 |
+
|
860 |
+
if(!empty($product_list)):
|
861 |
+
?>
|
862 |
+
<div class="<?php echo $element_class; ?>"><?php echo sprintf($wrapper_html, $product_list); ?></div>
|
863 |
+
<?php
|
864 |
+
endif;
|
865 |
+
|
866 |
+
|
867 |
+
}
|
868 |
+
|
869 |
+
|
870 |
+
|
871 |
+
|
872 |
+
|
873 |
+
|
874 |
+
|
875 |
+
|
876 |
+
|
877 |
+
|
878 |
+
|
879 |
+
add_action('wcps_layout_element_order_total', 'wcps_layout_element_order_total', 10);
|
880 |
+
function wcps_layout_element_order_total($args){
|
881 |
+
|
882 |
+
//echo '<pre>'.var_export($args, true).'</pre>';
|
883 |
+
$post_id = !empty($args['post_id']) ? $args['post_id'] : wcps_get_first_order_id();
|
884 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
885 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
886 |
+
|
887 |
+
$wrapper_html = isset($elementData['wrapper_html']) ? $elementData['wrapper_html'] : '';
|
888 |
+
$wrapper_html = !empty($wrapper_html) ? $wrapper_html : '%s';
|
889 |
+
|
890 |
+
$element_class = !empty($element_index) ? 'element-order_customer_name element-'.$element_index : 'element-order_customer_name';
|
891 |
+
|
892 |
+
if(empty($post_id)) return;
|
893 |
+
|
894 |
+
$order = wc_get_order($post_id);
|
895 |
+
$order_data = $order->get_data(); // The Order data
|
896 |
+
|
897 |
+
$total = !empty($order_data['total']) ? $order_data['total'] : '';
|
898 |
+
$currency = !empty($order_data['currency']) ? $order_data['currency'] : '';
|
899 |
+
|
900 |
+
|
901 |
+
if(!empty($total)):
|
902 |
+
?>
|
903 |
+
<div class="<?php echo $element_class; ?>"><?php echo sprintf($wrapper_html, $currency.$total); ?></div>
|
904 |
+
<?php
|
905 |
+
endif;
|
906 |
+
|
907 |
+
|
908 |
+
}
|
909 |
+
|
910 |
+
|
911 |
+
add_action('wcps_layout_element_order_discount_total', 'wcps_layout_element_order_discount_total', 10);
|
912 |
+
function wcps_layout_element_order_discount_total($args){
|
913 |
+
|
914 |
+
//echo '<pre>'.var_export($args, true).'</pre>';
|
915 |
+
$post_id = !empty($args['post_id']) ? $args['post_id'] : wcps_get_first_order_id();
|
916 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
917 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
918 |
+
|
919 |
+
$wrapper_html = isset($elementData['wrapper_html']) ? $elementData['wrapper_html'] : '';
|
920 |
+
$wrapper_html = !empty($wrapper_html) ? $wrapper_html : '%s';
|
921 |
+
|
922 |
+
$element_class = !empty($element_index) ? 'element-order_customer_name element-'.$element_index : 'element-order_customer_name';
|
923 |
+
|
924 |
+
if(empty($post_id)) return;
|
925 |
+
|
926 |
+
$order = wc_get_order($post_id);
|
927 |
+
$order_data = $order->get_data(); // The Order data
|
928 |
+
|
929 |
+
$discount_total = !empty($order_data['discount_total']) ? $order_data['discount_total'] : '';
|
930 |
+
$currency = !empty($order_data['currency']) ? $order_data['currency'] : '';
|
931 |
+
|
932 |
+
|
933 |
+
if(!empty($discount_total)):
|
934 |
+
?>
|
935 |
+
<div class="<?php echo $element_class; ?>"><?php echo sprintf($wrapper_html, $currency.$discount_total); ?></div>
|
936 |
+
<?php
|
937 |
+
endif;
|
938 |
+
|
939 |
+
|
940 |
+
}
|
941 |
+
|
942 |
+
|
943 |
+
add_action('wcps_layout_element_order_country', 'wcps_layout_element_order_country', 10);
|
944 |
+
function wcps_layout_element_order_country($args){
|
945 |
+
|
946 |
+
//echo '<pre>'.var_export($args, true).'</pre>';
|
947 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : wcps_get_first_order_id();
|
948 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
949 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
950 |
+
$wrapper_html = isset($elementData['wrapper_html']) ? $elementData['wrapper_html'] : '';
|
951 |
+
$wrapper_html = !empty($wrapper_html) ? $wrapper_html : '%s';
|
952 |
+
|
953 |
+
if(empty($post_id)) return;
|
954 |
+
|
955 |
+
$element_class = !empty($element_index) ? 'element-order_country element-'.$element_index : 'element-order_country';
|
956 |
+
|
957 |
+
$order = wc_get_order($post_id);
|
958 |
+
$billing_country = $order->get_billing_country();
|
959 |
+
|
960 |
+
|
961 |
+
|
962 |
+
?>
|
963 |
+
<div class="<?php echo $element_class; ?>"><?php echo sprintf($wrapper_html, $billing_country); ?></div>
|
964 |
+
<?php
|
965 |
+
|
966 |
+
}
|
967 |
+
|
968 |
+
|
969 |
+
add_action('wcps_layout_element_order_payment_method', 'wcps_layout_element_order_payment_method', 10);
|
970 |
+
function wcps_layout_element_order_payment_method($args){
|
971 |
+
|
972 |
+
//echo '<pre>'.var_export($args, true).'</pre>';
|
973 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : '';
|
974 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
975 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
976 |
+
|
977 |
+
$wrapper_html = isset($elementData['wrapper_html']) ? $elementData['wrapper_html'] : '';
|
978 |
+
$wrapper_html = !empty($wrapper_html) ? $wrapper_html : '%s';
|
979 |
+
|
980 |
+
if(empty($post_id)) return;
|
981 |
+
|
982 |
+
|
983 |
+
$order = wc_get_order($post_id);
|
984 |
+
$payment_method_title = $order->get_payment_method_title();
|
985 |
+
|
986 |
+
|
987 |
+
|
988 |
+
$element_class = !empty($element_index) ? 'element-order_payment_method element-'.$element_index : 'element-order_payment_method';
|
989 |
+
|
990 |
+
?>
|
991 |
+
<div class="<?php echo $element_class; ?>"><?php echo sprintf($wrapper_html, $payment_method_title); ?></div>
|
992 |
+
<?php
|
993 |
+
|
994 |
+
}
|
995 |
+
|
996 |
+
|
997 |
+
add_action('wcps_layout_element_css_order_date', 'wcps_layout_element_css_order_date', 10);
|
998 |
+
function wcps_layout_element_css_order_date($args){
|
999 |
+
|
1000 |
+
|
1001 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
1002 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
1003 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
1004 |
+
|
1005 |
+
$color = isset($elementData['color']) ? $elementData['color'] : '';
|
1006 |
+
$font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
|
1007 |
+
$font_family = isset($elementData['font_family']) ? $elementData['font_family'] : '';
|
1008 |
+
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
1009 |
+
$text_align = isset($elementData['text_align']) ? $elementData['text_align'] : '';
|
1010 |
+
|
1011 |
+
?>
|
1012 |
+
<style type="text/css">
|
1013 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
1014 |
+
<?php if(!empty($color)): ?>
|
1015 |
+
color: <?php echo $color; ?>;
|
1016 |
+
<?php endif; ?>
|
1017 |
+
<?php if(!empty($font_size)): ?>
|
1018 |
+
font-size: <?php echo $font_size; ?>;
|
1019 |
+
<?php endif; ?>
|
1020 |
+
<?php if(!empty($font_family)): ?>
|
1021 |
+
font-family: <?php echo $font_family; ?>;
|
1022 |
+
<?php endif; ?>
|
1023 |
+
<?php if(!empty($margin)): ?>
|
1024 |
+
margin: <?php echo $margin; ?>;
|
1025 |
+
<?php endif; ?>
|
1026 |
+
<?php if(!empty($text_align)): ?>
|
1027 |
+
text-align: <?php echo $text_align; ?>;
|
1028 |
+
<?php endif; ?>
|
1029 |
+
}
|
1030 |
+
</style>
|
1031 |
+
<?php
|
1032 |
+
}
|
1033 |
+
|
1034 |
+
|
1035 |
+
|
1036 |
+
add_action('wcps_layout_element_css_order_total', 'wcps_layout_element_css_order_total', 10);
|
1037 |
+
function wcps_layout_element_css_order_total($args){
|
1038 |
+
|
1039 |
+
|
1040 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
1041 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
1042 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
1043 |
+
|
1044 |
+
$color = isset($elementData['color']) ? $elementData['color'] : '';
|
1045 |
+
$font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
|
1046 |
+
$font_family = isset($elementData['font_family']) ? $elementData['font_family'] : '';
|
1047 |
+
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
1048 |
+
$text_align = isset($elementData['text_align']) ? $elementData['text_align'] : '';
|
1049 |
+
|
1050 |
+
?>
|
1051 |
+
<style type="text/css">
|
1052 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
1053 |
+
<?php if(!empty($color)): ?>
|
1054 |
+
color: <?php echo $color; ?>;
|
1055 |
+
<?php endif; ?>
|
1056 |
+
<?php if(!empty($font_size)): ?>
|
1057 |
+
font-size: <?php echo $font_size; ?>;
|
1058 |
+
<?php endif; ?>
|
1059 |
+
<?php if(!empty($font_family)): ?>
|
1060 |
+
font-family: <?php echo $font_family; ?>;
|
1061 |
+
<?php endif; ?>
|
1062 |
+
<?php if(!empty($margin)): ?>
|
1063 |
+
margin: <?php echo $margin; ?>;
|
1064 |
+
<?php endif; ?>
|
1065 |
+
<?php if(!empty($text_align)): ?>
|
1066 |
+
text-align: <?php echo $text_align; ?>;
|
1067 |
+
<?php endif; ?>
|
1068 |
+
}
|
1069 |
+
</style>
|
1070 |
+
<?php
|
1071 |
+
}
|
1072 |
+
|
1073 |
+
|
1074 |
+
add_action('wcps_layout_element_css_order_items', 'wcps_layout_element_css_order_items', 10);
|
1075 |
+
function wcps_layout_element_css_order_items($args){
|
1076 |
+
|
1077 |
+
|
1078 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
1079 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
1080 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
1081 |
+
|
1082 |
+
$color = isset($elementData['color']) ? $elementData['color'] : '';
|
1083 |
+
$font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
|
1084 |
+
$font_family = isset($elementData['font_family']) ? $elementData['font_family'] : '';
|
1085 |
+
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
1086 |
+
$text_align = isset($elementData['text_align']) ? $elementData['text_align'] : '';
|
1087 |
+
|
1088 |
+
?>
|
1089 |
+
<style type="text/css">
|
1090 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
1091 |
+
<?php if(!empty($color)): ?>
|
1092 |
+
color: <?php echo $color; ?>;
|
1093 |
+
<?php endif; ?>
|
1094 |
+
<?php if(!empty($font_size)): ?>
|
1095 |
+
font-size: <?php echo $font_size; ?>;
|
1096 |
+
<?php endif; ?>
|
1097 |
+
<?php if(!empty($font_family)): ?>
|
1098 |
+
font-family: <?php echo $font_family; ?>;
|
1099 |
+
<?php endif; ?>
|
1100 |
+
<?php if(!empty($margin)): ?>
|
1101 |
+
margin: <?php echo $margin; ?>;
|
1102 |
+
<?php endif; ?>
|
1103 |
+
<?php if(!empty($text_align)): ?>
|
1104 |
+
text-align: <?php echo $text_align; ?>;
|
1105 |
+
<?php endif; ?>
|
1106 |
+
}
|
1107 |
+
</style>
|
1108 |
+
<?php
|
1109 |
+
}
|
1110 |
+
|
1111 |
+
|
1112 |
+
add_action('wcps_layout_element_css_order_discount_total', 'wcps_layout_element_css_order_discount_total', 10);
|
1113 |
+
function wcps_layout_element_css_order_discount_total($args){
|
1114 |
+
|
1115 |
+
|
1116 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
1117 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
1118 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
1119 |
+
|
1120 |
+
$color = isset($elementData['color']) ? $elementData['color'] : '';
|
1121 |
+
$font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
|
1122 |
+
$font_family = isset($elementData['font_family']) ? $elementData['font_family'] : '';
|
1123 |
+
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
1124 |
+
$text_align = isset($elementData['text_align']) ? $elementData['text_align'] : '';
|
1125 |
+
|
1126 |
+
?>
|
1127 |
+
<style type="text/css">
|
1128 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
1129 |
+
<?php if(!empty($color)): ?>
|
1130 |
+
color: <?php echo $color; ?>;
|
1131 |
+
<?php endif; ?>
|
1132 |
+
<?php if(!empty($font_size)): ?>
|
1133 |
+
font-size: <?php echo $font_size; ?>;
|
1134 |
+
<?php endif; ?>
|
1135 |
+
<?php if(!empty($font_family)): ?>
|
1136 |
+
font-family: <?php echo $font_family; ?>;
|
1137 |
+
<?php endif; ?>
|
1138 |
+
<?php if(!empty($margin)): ?>
|
1139 |
+
margin: <?php echo $margin; ?>;
|
1140 |
+
<?php endif; ?>
|
1141 |
+
<?php if(!empty($text_align)): ?>
|
1142 |
+
text-align: <?php echo $text_align; ?>;
|
1143 |
+
<?php endif; ?>
|
1144 |
+
}
|
1145 |
+
</style>
|
1146 |
+
<?php
|
1147 |
+
}
|
1148 |
+
|
1149 |
+
|
1150 |
+
|
1151 |
+
|
1152 |
+
|
1153 |
+
|
1154 |
+
add_action('wcps_layout_element_css_custom_text', 'wcps_layout_element_css_custom_text', 10);
|
1155 |
+
function wcps_layout_element_css_custom_text($args){
|
1156 |
+
|
1157 |
+
|
1158 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
1159 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
1160 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
1161 |
+
|
1162 |
+
$color = isset($elementData['color']) ? $elementData['color'] : '';
|
1163 |
+
$font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
|
1164 |
+
$font_family = isset($elementData['font_family']) ? $elementData['font_family'] : '';
|
1165 |
+
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
1166 |
+
$text_align = isset($elementData['text_align']) ? $elementData['text_align'] : '';
|
1167 |
+
|
1168 |
+
?>
|
1169 |
+
<style type="text/css">
|
1170 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
1171 |
+
<?php if(!empty($color)): ?>
|
1172 |
+
color: <?php echo $color; ?>;
|
1173 |
+
<?php endif; ?>
|
1174 |
+
<?php if(!empty($font_size)): ?>
|
1175 |
+
font-size: <?php echo $font_size; ?>;
|
1176 |
+
<?php endif; ?>
|
1177 |
+
<?php if(!empty($font_family)): ?>
|
1178 |
+
font-family: <?php echo $font_family; ?>;
|
1179 |
+
<?php endif; ?>
|
1180 |
+
<?php if(!empty($margin)): ?>
|
1181 |
+
margin: <?php echo $margin; ?>;
|
1182 |
+
<?php endif; ?>
|
1183 |
+
<?php if(!empty($text_align)): ?>
|
1184 |
+
text-align: <?php echo $text_align; ?>;
|
1185 |
+
<?php endif; ?>
|
1186 |
+
}
|
1187 |
+
</style>
|
1188 |
+
<?php
|
1189 |
+
}
|
1190 |
+
add_action('wcps_layout_element_css_order_customer_name', 'wcps_layout_element_css_order_customer_name', 10);
|
1191 |
+
function wcps_layout_element_css_order_customer_name($args){
|
1192 |
+
|
1193 |
+
|
1194 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
1195 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
1196 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
1197 |
+
|
1198 |
+
$color = isset($elementData['color']) ? $elementData['color'] : '';
|
1199 |
+
$font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
|
1200 |
+
$font_family = isset($elementData['font_family']) ? $elementData['font_family'] : '';
|
1201 |
+
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
1202 |
+
$text_align = isset($elementData['text_align']) ? $elementData['text_align'] : '';
|
1203 |
+
|
1204 |
+
?>
|
1205 |
+
<style type="text/css">
|
1206 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
1207 |
+
<?php if(!empty($color)): ?>
|
1208 |
+
color: <?php echo $color; ?>;
|
1209 |
+
<?php endif; ?>
|
1210 |
+
<?php if(!empty($font_size)): ?>
|
1211 |
+
font-size: <?php echo $font_size; ?>;
|
1212 |
+
<?php endif; ?>
|
1213 |
+
<?php if(!empty($font_family)): ?>
|
1214 |
+
font-family: <?php echo $font_family; ?>;
|
1215 |
+
<?php endif; ?>
|
1216 |
+
<?php if(!empty($margin)): ?>
|
1217 |
+
margin: <?php echo $margin; ?>;
|
1218 |
+
<?php endif; ?>
|
1219 |
+
<?php if(!empty($text_align)): ?>
|
1220 |
+
text-align: <?php echo $text_align; ?>;
|
1221 |
+
<?php endif; ?>
|
1222 |
+
}
|
1223 |
+
</style>
|
1224 |
+
<?php
|
1225 |
+
}
|
1226 |
+
|
1227 |
+
|
1228 |
+
add_action('wcps_layout_element_css_order_customer_thumb', 'wcps_layout_element_css_order_customer_thumb', 10);
|
1229 |
+
function wcps_layout_element_css_order_customer_thumb($args){
|
1230 |
+
|
1231 |
+
|
1232 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
1233 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
1234 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
1235 |
+
|
1236 |
+
$width = isset($elementData['width']) ? $elementData['width'] : '';
|
1237 |
+
$font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
|
1238 |
+
$font_family = isset($elementData['font_family']) ? $elementData['font_family'] : '';
|
1239 |
+
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
1240 |
+
$text_align = isset($elementData['text_align']) ? $elementData['text_align'] : '';
|
1241 |
+
|
1242 |
+
?>
|
1243 |
+
<style type="text/css">
|
1244 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
1245 |
+
<?php if(!empty($width)): ?>
|
1246 |
+
width: <?php echo $width; ?>;
|
1247 |
+
<?php endif; ?>
|
1248 |
+
<?php if(!empty($font_size)): ?>
|
1249 |
+
font-size: <?php echo $font_size; ?>;
|
1250 |
+
<?php endif; ?>
|
1251 |
+
<?php if(!empty($font_family)): ?>
|
1252 |
+
font-family: <?php echo $font_family; ?>;
|
1253 |
+
<?php endif; ?>
|
1254 |
+
<?php if(!empty($margin)): ?>
|
1255 |
+
margin: <?php echo $margin; ?>;
|
1256 |
+
<?php endif; ?>
|
1257 |
+
<?php if(!empty($text_align)): ?>
|
1258 |
+
text-align: <?php echo $text_align; ?>;
|
1259 |
+
<?php endif; ?>
|
1260 |
+
}
|
1261 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?> img{
|
1262 |
+
height: auto;
|
1263 |
+
}
|
1264 |
+
|
1265 |
+
</style>
|
1266 |
+
<?php
|
1267 |
+
}
|
1268 |
+
|
1269 |
+
|
1270 |
+
|
1271 |
+
add_action('wcps_layout_element_css_order_country', 'wcps_layout_element_css_order_country', 10);
|
1272 |
+
function wcps_layout_element_css_order_country($args){
|
1273 |
+
|
1274 |
+
|
1275 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
1276 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
1277 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
1278 |
+
|
1279 |
+
$color = isset($elementData['color']) ? $elementData['color'] : '';
|
1280 |
+
$font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
|
1281 |
+
$font_family = isset($elementData['font_family']) ? $elementData['font_family'] : '';
|
1282 |
+
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
1283 |
+
$text_align = isset($elementData['text_align']) ? $elementData['text_align'] : '';
|
1284 |
+
|
1285 |
+
?>
|
1286 |
+
<style type="text/css">
|
1287 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
1288 |
+
<?php if(!empty($color)): ?>
|
1289 |
+
color: <?php echo $color; ?>;
|
1290 |
+
<?php endif; ?>
|
1291 |
+
<?php if(!empty($font_size)): ?>
|
1292 |
+
font-size: <?php echo $font_size; ?>;
|
1293 |
+
<?php endif; ?>
|
1294 |
+
<?php if(!empty($font_family)): ?>
|
1295 |
+
font-family: <?php echo $font_family; ?>;
|
1296 |
+
<?php endif; ?>
|
1297 |
+
<?php if(!empty($margin)): ?>
|
1298 |
+
margin: <?php echo $margin; ?>;
|
1299 |
+
<?php endif; ?>
|
1300 |
+
<?php if(!empty($text_align)): ?>
|
1301 |
+
text-align: <?php echo $text_align; ?>;
|
1302 |
+
<?php endif; ?>
|
1303 |
+
}
|
1304 |
+
</style>
|
1305 |
+
<?php
|
1306 |
+
}
|
1307 |
+
|
1308 |
+
|
1309 |
+
|
1310 |
+
|
1311 |
+
add_action('wcps_layout_element_css_order_payment_method', 'wcps_layout_element_css_order_payment_method', 10);
|
1312 |
+
function wcps_layout_element_css_order_payment_method($args){
|
1313 |
+
|
1314 |
+
|
1315 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
1316 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
1317 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
1318 |
+
|
1319 |
+
$color = isset($elementData['color']) ? $elementData['color'] : '';
|
1320 |
+
$font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
|
1321 |
+
$font_family = isset($elementData['font_family']) ? $elementData['font_family'] : '';
|
1322 |
+
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
1323 |
+
$text_align = isset($elementData['text_align']) ? $elementData['text_align'] : '';
|
1324 |
+
|
1325 |
+
?>
|
1326 |
+
<style type="text/css">
|
1327 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
1328 |
+
<?php if(!empty($color)): ?>
|
1329 |
+
color: <?php echo $color; ?>;
|
1330 |
+
<?php endif; ?>
|
1331 |
+
<?php if(!empty($font_size)): ?>
|
1332 |
+
font-size: <?php echo $font_size; ?>;
|
1333 |
+
<?php endif; ?>
|
1334 |
+
<?php if(!empty($font_family)): ?>
|
1335 |
+
font-family: <?php echo $font_family; ?>;
|
1336 |
+
<?php endif; ?>
|
1337 |
+
<?php if(!empty($margin)): ?>
|
1338 |
+
margin: <?php echo $margin; ?>;
|
1339 |
+
<?php endif; ?>
|
1340 |
+
<?php if(!empty($text_align)): ?>
|
1341 |
+
text-align: <?php echo $text_align; ?>;
|
1342 |
+
<?php endif; ?>
|
1343 |
+
}
|
1344 |
+
</style>
|
1345 |
+
<?php
|
1346 |
+
}
|
1347 |
+
|
1348 |
+
|
1349 |
+
|
1350 |
+
|
1351 |
+
|
1352 |
+
|
1353 |
+
|
1354 |
+
|
1355 |
+
|
1356 |
+
|
1357 |
+
add_action('wcps_layout_element_css_post_title', 'wcps_layout_element_css_post_title', 10);
|
1358 |
+
function wcps_layout_element_css_post_title($args){
|
1359 |
+
|
1360 |
+
|
1361 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
1362 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
1363 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
1364 |
+
|
1365 |
+
$color = isset($elementData['color']) ? $elementData['color'] : '';
|
1366 |
+
$font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
|
1367 |
+
$font_family = isset($elementData['font_family']) ? $elementData['font_family'] : '';
|
1368 |
+
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
1369 |
+
$text_align = isset($elementData['text_align']) ? $elementData['text_align'] : '';
|
1370 |
+
|
1371 |
+
|
1372 |
+
//echo '<pre>'.var_export($layout_id, true).'</pre>';
|
1373 |
+
|
1374 |
+
?>
|
1375 |
+
<style type="text/css">
|
1376 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
1377 |
+
<?php if(!empty($color)): ?>
|
1378 |
+
color: <?php echo $color; ?>;
|
1379 |
+
<?php endif; ?>
|
1380 |
+
<?php if(!empty($margin)): ?>
|
1381 |
+
margin: <?php echo $margin; ?>;
|
1382 |
+
<?php endif; ?>
|
1383 |
+
<?php if(!empty($text_align)): ?>
|
1384 |
+
text-align: <?php echo $text_align; ?>;
|
1385 |
+
<?php endif; ?>
|
1386 |
+
}
|
1387 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?> a{
|
1388 |
+
<?php if(!empty($color)): ?>
|
1389 |
+
color: <?php echo $color; ?>;
|
1390 |
+
<?php endif; ?>
|
1391 |
+
<?php if(!empty($font_size)): ?>
|
1392 |
+
font-size: <?php echo $font_size; ?>;
|
1393 |
+
<?php endif; ?>
|
1394 |
+
<?php if(!empty($font_family)): ?>
|
1395 |
+
font-family: <?php echo $font_family; ?>;
|
1396 |
+
<?php endif; ?>
|
1397 |
+
}
|
1398 |
+
|
1399 |
+
|
1400 |
+
</style>
|
1401 |
+
<?php
|
1402 |
+
}
|
1403 |
+
|
1404 |
+
|
1405 |
+
|
1406 |
+
add_action('wcps_layout_element_css_term_title', 'wcps_layout_element_css_term_title', 10);
|
1407 |
+
function wcps_layout_element_css_term_title($args){
|
1408 |
+
|
1409 |
+
|
1410 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
1411 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
1412 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
1413 |
+
|
1414 |
+
$color = isset($elementData['color']) ? $elementData['color'] : '';
|
1415 |
+
$font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
|
1416 |
+
$font_family = isset($elementData['font_family']) ? $elementData['font_family'] : '';
|
1417 |
+
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
1418 |
+
$text_align = isset($elementData['text_align']) ? $elementData['text_align'] : '';
|
1419 |
+
|
1420 |
+
?>
|
1421 |
+
<style type="text/css">
|
1422 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
1423 |
+
<?php if(!empty($margin)): ?>
|
1424 |
+
margin: <?php echo $margin; ?>;
|
1425 |
+
<?php endif; ?>
|
1426 |
+
<?php if(!empty($text_align)): ?>
|
1427 |
+
text-align: <?php echo $text_align; ?>;
|
1428 |
+
<?php endif; ?>
|
1429 |
+
}
|
1430 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?> a{
|
1431 |
+
<?php if(!empty($color)): ?>
|
1432 |
+
color: <?php echo $color; ?>;
|
1433 |
+
<?php endif; ?>
|
1434 |
+
<?php if(!empty($font_size)): ?>
|
1435 |
+
font-size: <?php echo $font_size; ?>;
|
1436 |
+
<?php endif; ?>
|
1437 |
+
<?php if(!empty($font_family)): ?>
|
1438 |
+
font-family: <?php echo $font_family; ?>;
|
1439 |
+
<?php endif; ?>
|
1440 |
+
}
|
1441 |
+
|
1442 |
+
|
1443 |
+
</style>
|
1444 |
+
<?php
|
1445 |
+
}
|
1446 |
+
|
1447 |
+
|
1448 |
+
|
1449 |
+
add_action('wcps_layout_element_css_term_description', 'wcps_layout_element_css_term_description', 10);
|
1450 |
+
function wcps_layout_element_css_term_description($args){
|
1451 |
+
|
1452 |
+
|
1453 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
1454 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
1455 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
1456 |
+
|
1457 |
+
$color = isset($elementData['color']) ? $elementData['color'] : '';
|
1458 |
+
$font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
|
1459 |
+
$font_family = isset($elementData['font_family']) ? $elementData['font_family'] : '';
|
1460 |
+
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
1461 |
+
$text_align = isset($elementData['text_align']) ? $elementData['text_align'] : '';
|
1462 |
+
|
1463 |
+
|
1464 |
+
//echo '<pre>'.var_export($layout_id, true).'</pre>';
|
1465 |
+
|
1466 |
+
?>
|
1467 |
+
<style type="text/css">
|
1468 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
1469 |
+
<?php if(!empty($color)): ?>
|
1470 |
+
color: <?php echo $color; ?>;
|
1471 |
+
<?php endif; ?>
|
1472 |
+
<?php if(!empty($font_size)): ?>
|
1473 |
+
font-size: <?php echo $font_size; ?>;
|
1474 |
+
<?php endif; ?>
|
1475 |
+
<?php if(!empty($font_family)): ?>
|
1476 |
+
font-family: <?php echo $font_family; ?>;
|
1477 |
+
<?php endif; ?>
|
1478 |
+
<?php if(!empty($margin)): ?>
|
1479 |
+
margin: <?php echo $margin; ?>;
|
1480 |
+
<?php endif; ?>
|
1481 |
+
<?php if(!empty($text_align)): ?>
|
1482 |
+
text-align: <?php echo $text_align; ?>;
|
1483 |
+
<?php endif; ?>
|
1484 |
+
}
|
1485 |
+
</style>
|
1486 |
+
<?php
|
1487 |
+
}
|
1488 |
+
|
1489 |
+
|
1490 |
+
|
1491 |
+
add_action('wcps_layout_element_css_term_post_count', 'wcps_layout_element_css_term_post_count', 10);
|
1492 |
+
function wcps_layout_element_css_term_post_count($args){
|
1493 |
+
|
1494 |
+
|
1495 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
1496 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
1497 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
1498 |
+
|
1499 |
+
$color = isset($elementData['color']) ? $elementData['color'] : '';
|
1500 |
+
$font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
|
1501 |
+
$font_family = isset($elementData['font_family']) ? $elementData['font_family'] : '';
|
1502 |
+
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
1503 |
+
$text_align = isset($elementData['text_align']) ? $elementData['text_align'] : '';
|
1504 |
+
|
1505 |
+
|
1506 |
+
//echo '<pre>'.var_export($layout_id, true).'</pre>';
|
1507 |
+
|
1508 |
+
?>
|
1509 |
+
<style type="text/css">
|
1510 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
1511 |
+
<?php if(!empty($color)): ?>
|
1512 |
+
color: <?php echo $color; ?>;
|
1513 |
+
<?php endif; ?>
|
1514 |
+
<?php if(!empty($font_size)): ?>
|
1515 |
+
font-size: <?php echo $font_size; ?>;
|
1516 |
+
<?php endif; ?>
|
1517 |
+
<?php if(!empty($font_family)): ?>
|
1518 |
+
font-family: <?php echo $font_family; ?>;
|
1519 |
+
<?php endif; ?>
|
1520 |
+
<?php if(!empty($margin)): ?>
|
1521 |
+
margin: <?php echo $margin; ?>;
|
1522 |
+
<?php endif; ?>
|
1523 |
+
<?php if(!empty($text_align)): ?>
|
1524 |
+
text-align: <?php echo $text_align; ?>;
|
1525 |
+
<?php endif; ?>
|
1526 |
+
}
|
1527 |
+
</style>
|
1528 |
+
<?php
|
1529 |
+
}
|
1530 |
+
|
1531 |
+
|
1532 |
+
|
1533 |
+
|
1534 |
+
add_action('wcps_layout_element_css_product_category', 'wcps_layout_element_css_product_category', 10);
|
1535 |
+
function wcps_layout_element_css_product_category($args){
|
1536 |
+
|
1537 |
+
//echo '<pre>'.var_export($args, true).'</pre>';
|
1538 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
1539 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
1540 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
1541 |
+
|
1542 |
+
$link_color = isset($elementData['link_color']) ? $elementData['link_color'] : '';
|
1543 |
+
$font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
|
1544 |
+
$font_family = isset($elementData['font_family']) ? $elementData['font_family'] : '';
|
1545 |
+
$wrapper_margin = isset($elementData['wrapper_margin']) ? $elementData['wrapper_margin'] : '';
|
1546 |
+
$text_align = isset($elementData['text_align']) ? (int) $elementData['text_align'] : '';
|
1547 |
+
|
1548 |
+
?>
|
1549 |
+
<style type="text/css">
|
1550 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
1551 |
+
margin: <?php echo $wrapper_margin; ?>;
|
1552 |
+
|
1553 |
+
}
|
1554 |
+
|
1555 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?> a{
|
1556 |
+
<?php if(!empty($link_color)): ?>
|
1557 |
+
color: <?php echo $link_color; ?>;
|
1558 |
+
<?php endif; ?>
|
1559 |
+
<?php if(!empty($font_size)): ?>
|
1560 |
+
font-size: <?php echo $font_size; ?>;
|
1561 |
+
<?php endif; ?>
|
1562 |
+
<?php if(!empty($font_family)): ?>
|
1563 |
+
font-family: <?php echo $font_family; ?>;
|
1564 |
+
<?php endif; ?>
|
1565 |
+
text-decoration: none;
|
1566 |
+
<?php if(!empty($text_align)): ?>
|
1567 |
+
text-align: <?php echo $text_align; ?>;
|
1568 |
+
<?php endif; ?>
|
1569 |
+
}
|
1570 |
+
</style>
|
1571 |
+
<?php
|
1572 |
+
}
|
1573 |
+
|
1574 |
+
|
1575 |
+
|
1576 |
+
|
1577 |
+
add_action('wcps_layout_element_css_product_tag', 'wcps_layout_element_css_product_tag', 10);
|
1578 |
+
function wcps_layout_element_css_product_tag($args){
|
1579 |
+
|
1580 |
+
//echo '<pre>'.var_export($args, true).'</pre>';
|
1581 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
1582 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
1583 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
1584 |
+
|
1585 |
+
$link_color = isset($elementData['link_color']) ? $elementData['link_color'] : '';
|
1586 |
+
$font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
|
1587 |
+
$font_family = isset($elementData['font_family']) ? $elementData['font_family'] : '';
|
1588 |
+
$wrapper_margin = isset($elementData['wrapper_margin']) ? $elementData['wrapper_margin'] : '';
|
1589 |
+
|
1590 |
+
|
1591 |
+
?>
|
1592 |
+
<style type="text/css">
|
1593 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
1594 |
+
<?php if(!empty($wrapper_margin)): ?>
|
1595 |
+
margin: <?php echo $wrapper_margin; ?>;
|
1596 |
+
<?php endif; ?>
|
1597 |
+
|
1598 |
+
}
|
1599 |
+
|
1600 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?> a{
|
1601 |
+
<?php if(!empty($link_color)): ?>
|
1602 |
+
color: <?php echo $link_color; ?>;
|
1603 |
+
<?php endif; ?>
|
1604 |
+
<?php if(!empty($font_size)): ?>
|
1605 |
+
font-size: <?php echo $font_size; ?>;
|
1606 |
+
<?php endif; ?>
|
1607 |
+
<?php if(!empty($font_family)): ?>
|
1608 |
+
font-family: <?php echo $font_family; ?>;
|
1609 |
+
<?php endif; ?>
|
1610 |
+
text-decoration: none;
|
1611 |
+
|
1612 |
+
}
|
1613 |
+
</style>
|
1614 |
+
<?php
|
1615 |
+
}
|
1616 |
+
|
1617 |
+
|
1618 |
+
|
1619 |
+
|
1620 |
+
add_action('wcps_layout_element_css_sale_count', 'wcps_layout_element_css_sale_count', 10);
|
1621 |
+
function wcps_layout_element_css_sale_count($args){
|
1622 |
+
|
1623 |
+
//echo '<pre>'.var_export($args, true).'</pre>';
|
1624 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
1625 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
1626 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
1627 |
+
|
1628 |
+
$link_color = isset($elementData['link_color']) ? $elementData['link_color'] : '';
|
1629 |
+
$font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
|
1630 |
+
$font_family = isset($elementData['font_family']) ? $elementData['font_family'] : '';
|
1631 |
+
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
1632 |
+
|
1633 |
+
|
1634 |
+
?>
|
1635 |
+
<style type="text/css">
|
1636 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
1637 |
+
<?php if(!empty($margin)): ?>
|
1638 |
+
margin: <?php echo $margin; ?>;
|
1639 |
+
<?php endif; ?>
|
1640 |
+
|
1641 |
+
}
|
1642 |
+
|
1643 |
+
</style>
|
1644 |
+
<?php
|
1645 |
+
}
|
1646 |
+
|
1647 |
+
add_action('wcps_layout_element_css_on_sale_mark', 'wcps_layout_element_css_on_sale_mark', 10);
|
1648 |
+
function wcps_layout_element_css_on_sale_mark($args){
|
1649 |
+
|
1650 |
+
//echo '<pre>'.var_export($args, true).'</pre>';
|
1651 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
1652 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
1653 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
1654 |
+
|
1655 |
+
$background_color = isset($elementData['background_color']) ? $elementData['background_color'] : '';
|
1656 |
+
$text_color = isset($elementData['text_color']) ? $elementData['text_color'] : '';
|
1657 |
+
$font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
|
1658 |
+
$padding = isset($elementData['padding']) ? $elementData['padding'] : '';
|
1659 |
+
|
1660 |
+
|
1661 |
+
?>
|
1662 |
+
<style type="text/css">
|
1663 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
1664 |
+
<?php if(!empty($background_color)): ?>
|
1665 |
+
background-color: <?php echo $background_color; ?>;
|
1666 |
+
<?php endif; ?>
|
1667 |
+
<?php if(!empty($text_color)): ?>
|
1668 |
+
color: <?php echo $text_color; ?>;
|
1669 |
+
<?php endif; ?>
|
1670 |
+
<?php if(!empty($font_size)): ?>
|
1671 |
+
font-size: <?php echo $font_size; ?>;
|
1672 |
+
<?php endif; ?>
|
1673 |
+
line-height: normal;
|
1674 |
+
<?php if(!empty($padding)): ?>
|
1675 |
+
padding: <?php echo $padding; ?>;
|
1676 |
+
<?php endif; ?>
|
1677 |
+
}
|
1678 |
+
|
1679 |
+
</style>
|
1680 |
+
<?php
|
1681 |
+
}
|
1682 |
+
|
1683 |
+
add_action('wcps_layout_element_css_featured_mark', 'wcps_layout_element_css_featured_mark', 10);
|
1684 |
+
function wcps_layout_element_css_featured_mark($args){
|
1685 |
+
|
1686 |
+
//echo '<pre>'.var_export($args, true).'</pre>';
|
1687 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
1688 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
1689 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
1690 |
+
|
1691 |
+
$background_color = isset($elementData['background_color']) ? $elementData['background_color'] : '';
|
1692 |
+
$text_color = isset($elementData['text_color']) ? $elementData['text_color'] : '';
|
1693 |
+
$font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
|
1694 |
+
$padding = isset($elementData['padding']) ? $elementData['padding'] : '';
|
1695 |
+
|
1696 |
+
|
1697 |
+
?>
|
1698 |
+
<style type="text/css">
|
1699 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
1700 |
+
<?php if(!empty($background_color)): ?>
|
1701 |
+
background-color: <?php echo $background_color; ?>;
|
1702 |
+
<?php endif; ?>
|
1703 |
+
<?php if(!empty($text_color)): ?>
|
1704 |
+
color: <?php echo $text_color; ?>;
|
1705 |
+
<?php endif; ?>
|
1706 |
+
<?php if(!empty($font_size)): ?>
|
1707 |
+
font-size: <?php echo $font_size; ?>;
|
1708 |
+
<?php endif; ?>
|
1709 |
+
line-height: normal;
|
1710 |
+
<?php if(!empty($padding)): ?>
|
1711 |
+
padding: <?php echo $padding; ?>;
|
1712 |
+
<?php endif; ?>
|
1713 |
+
}
|
1714 |
+
</style>
|
1715 |
+
<?php
|
1716 |
+
}
|
1717 |
+
|
1718 |
+
|
1719 |
+
|
1720 |
+
add_action('wcps_layout_element_css_product_id', 'wcps_layout_element_css_product_id', 10);
|
1721 |
+
function wcps_layout_element_css_product_id($args){
|
1722 |
+
|
1723 |
+
//echo '<pre>'.var_export($args, true).'</pre>';
|
1724 |
+
$element_index = isset($args['element_index']) ? $args['element_index'] : '';
|
1725 |
+
$elementData = isset($args['elementData']) ? $args['elementData'] : array();
|
1726 |
+
$layout_id = isset($args['layout_id']) ? $args['layout_id'] : '';
|
1727 |
+
|
1728 |
+
$background_color = isset($elementData['background_color']) ? $elementData['background_color'] : '';
|
1729 |
+
$text_color = isset($elementData['text_color']) ? $elementData['text_color'] : '';
|
1730 |
+
$font_size = isset($elementData['font_size']) ? $elementData['font_size'] : '';
|
1731 |
+
$margin = isset($elementData['margin']) ? $elementData['margin'] : '';
|
1732 |
+
|
1733 |
+
|
1734 |
+
?>
|
1735 |
+
<style type="text/css">
|
1736 |
+
.layout-<?php echo $layout_id; ?> .element-<?php echo $element_index; ?>{
|
1737 |
+
<?php if(!empty($background_color)): ?>
|
1738 |
+
background-color: <?php echo $background_color; ?>;
|
1739 |
+
<?php endif; ?>
|
1740 |
+
<?php if(!empty($text_color)): ?>
|
1741 |
+
color: <?php echo $text_color; ?>;
|
1742 |
+
<?php endif; ?>
|
1743 |
+
<?php if(!empty($font_size)): ?>
|
1744 |
+
font-size: <?php echo $font_size; ?>;
|
1745 |
+
<?php endif; ?>
|
1746 |
+
line-height: normal;
|
1747 |
+
<?php if(!empty($margin)): ?>
|
1748 |
+
padding: <?php echo $margin; ?>;
|
1749 |
+
<?php endif; ?>
|
1750 |
+
}
|
1751 |
+
</style>
|
1752 |
+
<?php
|
1753 |
+
}
|
1754 |
+
|
1755 |
+
|
1756 |
+
|
1757 |
+
|
1758 |
+
|
1759 |
+
|
1760 |
+
add_action('wcps_layout_element_css_add_to_cart', 'wcps_layout_element_css_add_to_cart', 10);
|
1761 |
+
function wcps_layout_element_css_add_to_cart($args){
|
1762 |
|
1763 |
//echo '<pre>'.var_export($args, true).'</pre>';
|
1764 |
$wcps_id = isset($args['wcps_id']) ? $args['wcps_id'] : '';
|
1987 |
</style>
|
1988 |
<?php
|
1989 |
}
|
1990 |
+
|
1991 |
+
|
includes/functions-layout-hook.php
CHANGED
@@ -1,6 +1,157 @@
|
|
1 |
<?php
|
2 |
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
|
6 |
add_action('wcps_layout_elements_option_post_title','wcps_layout_elements_option_post_title');
|
@@ -33,7 +184,7 @@ function wcps_layout_elements_option_post_title($parameters){
|
|
33 |
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
34 |
<span class="sort"><i class="fas fa-sort"></i></span>
|
35 |
|
36 |
-
<span class="expand"><?php echo __('
|
37 |
</div>
|
38 |
<div class="element-options options">
|
39 |
|
@@ -41,7 +192,7 @@ function wcps_layout_elements_option_post_title($parameters){
|
|
41 |
|
42 |
$args = array(
|
43 |
'id' => 'color',
|
44 |
-
'css_id' => $element_index.'
|
45 |
'parent' => $input_name.'[post_title]',
|
46 |
'title' => __('Color','woocommerce-products-slider'),
|
47 |
'details' => __('Title text color.','woocommerce-products-slider'),
|
@@ -1189,7 +1340,7 @@ function wcps_layout_elements_option_featured_mark($parameters){
|
|
1189 |
|
1190 |
$args = array(
|
1191 |
'id' => 'background_color',
|
1192 |
-
'css_id' => $element_index.'
|
1193 |
'parent' => $input_name.'[featured_mark]',
|
1194 |
'title' => __('Background color','woocommerce-products-slider'),
|
1195 |
'details' => __('Choose background color.','woocommerce-products-slider'),
|
@@ -1331,7 +1482,7 @@ function wcps_layout_elements_option_on_sale_mark($parameters){
|
|
1331 |
|
1332 |
$args = array(
|
1333 |
'id' => 'background_color',
|
1334 |
-
'css_id' => $element_index.'
|
1335 |
'parent' => $input_name.'[on_sale_mark]',
|
1336 |
'title' => __('Background color','woocommerce-products-slider'),
|
1337 |
'details' => __('Choose background color.','woocommerce-products-slider'),
|
@@ -1440,7 +1591,7 @@ function wcps_layout_elements_option_product_id($parameters){
|
|
1440 |
|
1441 |
$args = array(
|
1442 |
'id' => 'background_color',
|
1443 |
-
'css_id' => $element_index.'
|
1444 |
'parent' => $input_name.'[product_id]',
|
1445 |
'title' => __('Background color','woocommerce-products-slider'),
|
1446 |
'details' => __('Choose background color.','woocommerce-products-slider'),
|
@@ -1539,7 +1690,7 @@ function wcps_layout_elements_option_add_to_cart($parameters){
|
|
1539 |
|
1540 |
$args = array(
|
1541 |
'id' => 'background_color',
|
1542 |
-
'css_id' => $element_index.'
|
1543 |
'parent' => $input_name.'[add_to_cart]',
|
1544 |
'title' => __('Background color','woocommerce-products-slider'),
|
1545 |
'details' => __('Choose background color.','woocommerce-products-slider'),
|
@@ -1657,7 +1808,7 @@ function wcps_layout_elements_option_rating($parameters){
|
|
1657 |
'type' => 'text',
|
1658 |
'value' => $wrapper_html,
|
1659 |
'default' => '',
|
1660 |
-
'placeholder' => '
|
1661 |
);
|
1662 |
|
1663 |
$settings_tabs_field->generate_field($args);
|
@@ -1855,3 +2006,3062 @@ function wcps_layout_elements_option_product_price($parameters){
|
|
1855 |
}
|
1856 |
|
1857 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
<?php
|
2 |
if ( ! defined('ABSPATH')) exit; // if direct access
|
3 |
|
4 |
+
add_action('wcps_layout_elements_option_custom_text','wcps_layout_elements_option_custom_text');
|
5 |
+
|
6 |
+
|
7 |
+
function wcps_layout_elements_option_custom_text($parameters){
|
8 |
+
|
9 |
+
$settings_tabs_field = new settings_tabs_field();
|
10 |
+
|
11 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
12 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
13 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
14 |
+
|
15 |
+
$content = isset($element_data['content']) ? $element_data['content'] : '';
|
16 |
+
|
17 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
18 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
19 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
20 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
21 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
22 |
+
|
23 |
+
$custom_css = isset($element_data['custom_css']) ? $element_data['custom_css'] : '';
|
24 |
+
$custom_css_hover = isset($element_data['custom_css_hover']) ? $element_data['custom_css_hover'] : '';
|
25 |
+
|
26 |
+
|
27 |
+
|
28 |
+
?>
|
29 |
+
<div class="item">
|
30 |
+
<div class="element-title header ">
|
31 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
32 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
33 |
+
|
34 |
+
<span class="expand"><?php echo __('Custom text','woocommerce-products-slider'); ?></span>
|
35 |
+
</div>
|
36 |
+
<div class="element-options options">
|
37 |
+
|
38 |
+
<?php
|
39 |
+
|
40 |
+
$args = array(
|
41 |
+
'id' => 'content',
|
42 |
+
'css_id' => $element_index.'_font_size',
|
43 |
+
'parent' => $input_name.'[custom_text]',
|
44 |
+
'title' => __('Custom text','woocommerce-products-slider'),
|
45 |
+
'details' => __('Write custom text.','woocommerce-products-slider'),
|
46 |
+
'type' => 'textarea',
|
47 |
+
'value' => $content,
|
48 |
+
'default' => '',
|
49 |
+
'placeholder' => '',
|
50 |
+
);
|
51 |
+
|
52 |
+
$settings_tabs_field->generate_field($args);
|
53 |
+
|
54 |
+
$args = array(
|
55 |
+
'id' => 'color',
|
56 |
+
'css_id' => $element_index.'_custom_text',
|
57 |
+
'parent' => $input_name.'[custom_text]',
|
58 |
+
'title' => __('Color','woocommerce-products-slider'),
|
59 |
+
'details' => __('Title text color.','woocommerce-products-slider'),
|
60 |
+
'type' => 'colorpicker',
|
61 |
+
'value' => $color,
|
62 |
+
'default' => '',
|
63 |
+
);
|
64 |
+
|
65 |
+
$settings_tabs_field->generate_field($args);
|
66 |
+
|
67 |
+
$args = array(
|
68 |
+
'id' => 'font_size',
|
69 |
+
'css_id' => $element_index.'_font_size',
|
70 |
+
'parent' => $input_name.'[custom_text]',
|
71 |
+
'title' => __('Font size','woocommerce-products-slider'),
|
72 |
+
'details' => __('Set font size.','woocommerce-products-slider'),
|
73 |
+
'type' => 'text',
|
74 |
+
'value' => $font_size,
|
75 |
+
'default' => '',
|
76 |
+
'placeholder' => '14px',
|
77 |
+
);
|
78 |
+
|
79 |
+
$settings_tabs_field->generate_field($args);
|
80 |
+
|
81 |
+
|
82 |
+
$args = array(
|
83 |
+
'id' => 'font_family',
|
84 |
+
'css_id' => $element_index.'_font_family',
|
85 |
+
'parent' => $input_name.'[custom_text]',
|
86 |
+
'title' => __('Font family','woocommerce-products-slider'),
|
87 |
+
'details' => __('Set font family.','woocommerce-products-slider'),
|
88 |
+
'type' => 'text',
|
89 |
+
'value' => $font_family,
|
90 |
+
'default' => '',
|
91 |
+
'placeholder' => 'Open Sans',
|
92 |
+
);
|
93 |
+
|
94 |
+
$settings_tabs_field->generate_field($args);
|
95 |
+
|
96 |
+
|
97 |
+
$args = array(
|
98 |
+
'id' => 'margin',
|
99 |
+
'css_id' => $element_index.'_margin',
|
100 |
+
'parent' => $input_name.'[custom_text]',
|
101 |
+
'title' => __('Margin','woocommerce-products-slider'),
|
102 |
+
'details' => __('Set margin.','woocommerce-products-slider'),
|
103 |
+
'type' => 'text',
|
104 |
+
'value' => $margin,
|
105 |
+
'default' => '',
|
106 |
+
'placeholder' => '5px 0',
|
107 |
+
);
|
108 |
+
|
109 |
+
$settings_tabs_field->generate_field($args);
|
110 |
+
|
111 |
+
|
112 |
+
$args = array(
|
113 |
+
'id' => 'text_align',
|
114 |
+
'css_id' => $element_index.'_text_align',
|
115 |
+
'parent' => $input_name.'[custom_text]',
|
116 |
+
'title' => __('Text align','woocommerce-products-slider'),
|
117 |
+
'details' => __('Choose text align.','woocommerce-products-slider'),
|
118 |
+
'type' => 'select',
|
119 |
+
'value' => $text_align,
|
120 |
+
'default' => 'left',
|
121 |
+
'args' => array('left'=> __('Left', 'woocommerce-products-slider'),'right'=> __('Right', 'woocommerce-products-slider'),'center'=> __('Center', 'woocommerce-products-slider') ),
|
122 |
+
);
|
123 |
+
|
124 |
+
$settings_tabs_field->generate_field($args);
|
125 |
+
|
126 |
+
|
127 |
+
|
128 |
+
|
129 |
+
|
130 |
+
ob_start();
|
131 |
+
?>
|
132 |
+
<textarea readonly type="text" onclick="this.select();">.element-<?php echo $element_index?>{}</textarea>
|
133 |
+
<?php
|
134 |
+
|
135 |
+
$html = ob_get_clean();
|
136 |
+
|
137 |
+
$args = array(
|
138 |
+
'id' => 'use_css',
|
139 |
+
'title' => __('Use of CSS','woocommerce-products-slider'),
|
140 |
+
'details' => __('Use following class selector to add custom CSS for this element.','woocommerce-products-slider'),
|
141 |
+
'type' => 'custom_html',
|
142 |
+
'html' => $html,
|
143 |
+
|
144 |
+
);
|
145 |
+
|
146 |
+
$settings_tabs_field->generate_field($args);
|
147 |
+
|
148 |
+
?>
|
149 |
+
|
150 |
+
</div>
|
151 |
+
</div>
|
152 |
+
<?php
|
153 |
+
|
154 |
+
}
|
155 |
|
156 |
|
157 |
add_action('wcps_layout_elements_option_post_title','wcps_layout_elements_option_post_title');
|
184 |
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
185 |
<span class="sort"><i class="fas fa-sort"></i></span>
|
186 |
|
187 |
+
<span class="expand"><?php echo __('Post title','woocommerce-products-slider'); ?></span>
|
188 |
</div>
|
189 |
<div class="element-options options">
|
190 |
|
192 |
|
193 |
$args = array(
|
194 |
'id' => 'color',
|
195 |
+
'css_id' => $element_index.'_post_title_color',
|
196 |
'parent' => $input_name.'[post_title]',
|
197 |
'title' => __('Color','woocommerce-products-slider'),
|
198 |
'details' => __('Title text color.','woocommerce-products-slider'),
|
1340 |
|
1341 |
$args = array(
|
1342 |
'id' => 'background_color',
|
1343 |
+
'css_id' => $element_index.'_background_coloradd_to_cart',
|
1344 |
'parent' => $input_name.'[featured_mark]',
|
1345 |
'title' => __('Background color','woocommerce-products-slider'),
|
1346 |
'details' => __('Choose background color.','woocommerce-products-slider'),
|
1482 |
|
1483 |
$args = array(
|
1484 |
'id' => 'background_color',
|
1485 |
+
'css_id' => $element_index.'_background_coloradd_to_cart',
|
1486 |
'parent' => $input_name.'[on_sale_mark]',
|
1487 |
'title' => __('Background color','woocommerce-products-slider'),
|
1488 |
'details' => __('Choose background color.','woocommerce-products-slider'),
|
1591 |
|
1592 |
$args = array(
|
1593 |
'id' => 'background_color',
|
1594 |
+
'css_id' => $element_index.'_background_coloradd_to_cart',
|
1595 |
'parent' => $input_name.'[product_id]',
|
1596 |
'title' => __('Background color','woocommerce-products-slider'),
|
1597 |
'details' => __('Choose background color.','woocommerce-products-slider'),
|
1690 |
|
1691 |
$args = array(
|
1692 |
'id' => 'background_color',
|
1693 |
+
'css_id' => $element_index.'_background_coloradd_to_cart',
|
1694 |
'parent' => $input_name.'[add_to_cart]',
|
1695 |
'title' => __('Background color','woocommerce-products-slider'),
|
1696 |
'details' => __('Choose background color.','woocommerce-products-slider'),
|
1808 |
'type' => 'text',
|
1809 |
'value' => $wrapper_html,
|
1810 |
'default' => '',
|
1811 |
+
'placeholder' => 'Rating: %s',
|
1812 |
);
|
1813 |
|
1814 |
$settings_tabs_field->generate_field($args);
|
2006 |
}
|
2007 |
|
2008 |
|
2009 |
+
|
2010 |
+
add_action('wcps_layout_elements_option_term_title','wcps_layout_elements_option_term_title');
|
2011 |
+
|
2012 |
+
|
2013 |
+
function wcps_layout_elements_option_term_title($parameters){
|
2014 |
+
|
2015 |
+
$settings_tabs_field = new settings_tabs_field();
|
2016 |
+
|
2017 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
2018 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
2019 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
2020 |
+
|
2021 |
+
|
2022 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
2023 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
2024 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
2025 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
2026 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
2027 |
+
|
2028 |
+
$custom_css = isset($element_data['custom_css']) ? $element_data['custom_css'] : '';
|
2029 |
+
$custom_css_hover = isset($element_data['custom_css_hover']) ? $element_data['custom_css_hover'] : '';
|
2030 |
+
|
2031 |
+
|
2032 |
+
|
2033 |
+
?>
|
2034 |
+
<div class="item">
|
2035 |
+
<div class="element-title header ">
|
2036 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
2037 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
2038 |
+
|
2039 |
+
<span class="expand"><?php echo __('Term title','woocommerce-products-slider'); ?></span>
|
2040 |
+
</div>
|
2041 |
+
<div class="element-options options">
|
2042 |
+
|
2043 |
+
<?php
|
2044 |
+
|
2045 |
+
$args = array(
|
2046 |
+
'id' => 'color',
|
2047 |
+
'css_id' => $element_index.'_term_title',
|
2048 |
+
'parent' => $input_name.'[term_title]',
|
2049 |
+
'title' => __('Color','woocommerce-products-slider'),
|
2050 |
+
'details' => __('Title text color.','woocommerce-products-slider'),
|
2051 |
+
'type' => 'colorpicker',
|
2052 |
+
'value' => $color,
|
2053 |
+
'default' => '',
|
2054 |
+
);
|
2055 |
+
|
2056 |
+
$settings_tabs_field->generate_field($args);
|
2057 |
+
|
2058 |
+
$args = array(
|
2059 |
+
'id' => 'font_size',
|
2060 |
+
'css_id' => $element_index.'_font_size',
|
2061 |
+
'parent' => $input_name.'[term_title]',
|
2062 |
+
'title' => __('Font size','woocommerce-products-slider'),
|
2063 |
+
'details' => __('Set font size.','woocommerce-products-slider'),
|
2064 |
+
'type' => 'text',
|
2065 |
+
'value' => $font_size,
|
2066 |
+
'default' => '',
|
2067 |
+
'placeholder' => '14px',
|
2068 |
+
);
|
2069 |
+
|
2070 |
+
$settings_tabs_field->generate_field($args);
|
2071 |
+
|
2072 |
+
|
2073 |
+
$args = array(
|
2074 |
+
'id' => 'font_family',
|
2075 |
+
'css_id' => $element_index.'_font_family',
|
2076 |
+
'parent' => $input_name.'[term_title]',
|
2077 |
+
'title' => __('Font family','woocommerce-products-slider'),
|
2078 |
+
'details' => __('Set font family.','woocommerce-products-slider'),
|
2079 |
+
'type' => 'text',
|
2080 |
+
'value' => $font_family,
|
2081 |
+
'default' => '',
|
2082 |
+
'placeholder' => 'Open Sans',
|
2083 |
+
);
|
2084 |
+
|
2085 |
+
$settings_tabs_field->generate_field($args);
|
2086 |
+
|
2087 |
+
|
2088 |
+
$args = array(
|
2089 |
+
'id' => 'margin',
|
2090 |
+
'css_id' => $element_index.'_margin',
|
2091 |
+
'parent' => $input_name.'[term_title]',
|
2092 |
+
'title' => __('Margin','woocommerce-products-slider'),
|
2093 |
+
'details' => __('Set margin.','woocommerce-products-slider'),
|
2094 |
+
'type' => 'text',
|
2095 |
+
'value' => $margin,
|
2096 |
+
'default' => '',
|
2097 |
+
'placeholder' => '5px 0',
|
2098 |
+
);
|
2099 |
+
|
2100 |
+
$settings_tabs_field->generate_field($args);
|
2101 |
+
|
2102 |
+
|
2103 |
+
$args = array(
|
2104 |
+
'id' => 'text_align',
|
2105 |
+
'css_id' => $element_index.'_text_align',
|
2106 |
+
'parent' => $input_name.'[term_title]',
|
2107 |
+
'title' => __('Text align','woocommerce-products-slider'),
|
2108 |
+
'details' => __('Choose text align.','woocommerce-products-slider'),
|
2109 |
+
'type' => 'select',
|
2110 |
+
'value' => $text_align,
|
2111 |
+
'default' => 'left',
|
2112 |
+
'args' => array('left'=> __('Left', 'woocommerce-products-slider'),'right'=> __('Right', 'woocommerce-products-slider'),'center'=> __('Center', 'woocommerce-products-slider') ),
|
2113 |
+
);
|
2114 |
+
|
2115 |
+
$settings_tabs_field->generate_field($args);
|
2116 |
+
|
2117 |
+
|
2118 |
+
|
2119 |
+
|
2120 |
+
ob_start();
|
2121 |
+
?>
|
2122 |
+
<textarea readonly type="text" onclick="this.select();">.element-<?php echo $element_index?>{}</textarea>
|
2123 |
+
<?php
|
2124 |
+
|
2125 |
+
$html = ob_get_clean();
|
2126 |
+
|
2127 |
+
$args = array(
|
2128 |
+
'id' => 'use_css',
|
2129 |
+
'title' => __('Use of CSS','woocommerce-products-slider'),
|
2130 |
+
'details' => __('Use following class selector to add custom CSS for this element.','woocommerce-products-slider'),
|
2131 |
+
'type' => 'custom_html',
|
2132 |
+
'html' => $html,
|
2133 |
+
|
2134 |
+
);
|
2135 |
+
|
2136 |
+
$settings_tabs_field->generate_field($args);
|
2137 |
+
|
2138 |
+
?>
|
2139 |
+
|
2140 |
+
</div>
|
2141 |
+
</div>
|
2142 |
+
<?php
|
2143 |
+
|
2144 |
+
}
|
2145 |
+
|
2146 |
+
|
2147 |
+
|
2148 |
+
|
2149 |
+
add_action('wcps_layout_elements_option_term_thumb','wcps_layout_elements_option_term_thumb');
|
2150 |
+
function wcps_layout_elements_option_term_thumb($parameters){
|
2151 |
+
|
2152 |
+
$settings_tabs_field = new settings_tabs_field();
|
2153 |
+
|
2154 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
2155 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
2156 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
2157 |
+
|
2158 |
+
$thumb_size = isset($element_data['thumb_size']) ? $element_data['thumb_size'] : '';
|
2159 |
+
$default_thumb_src = isset($element_data['default_thumb_src']) ? $element_data['default_thumb_src'] : '';
|
2160 |
+
$link_to_meta_key = isset($element_data['link_to_meta_key']) ? $element_data['link_to_meta_key'] : '';
|
2161 |
+
|
2162 |
+
$thumb_height = isset($element_data['thumb_height']) ? $element_data['thumb_height'] : '';
|
2163 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
2164 |
+
|
2165 |
+
$thumb_height_large = isset($thumb_height['large']) ? $thumb_height['large'] : '';
|
2166 |
+
$thumb_height_medium = isset($thumb_height['medium']) ? $thumb_height['medium'] : '';
|
2167 |
+
$thumb_height_small = isset($thumb_height['small']) ? $thumb_height['small'] : '';
|
2168 |
+
|
2169 |
+
|
2170 |
+
?>
|
2171 |
+
<div class="item">
|
2172 |
+
<div class="element-title header ">
|
2173 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
2174 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
2175 |
+
|
2176 |
+
<span class="expand"><?php echo __('Term thumbnail','woocommerce-products-slider'); ?></span>
|
2177 |
+
</div>
|
2178 |
+
<div class="element-options options">
|
2179 |
+
|
2180 |
+
<?php
|
2181 |
+
|
2182 |
+
$thumbnail_sizes = array();
|
2183 |
+
$thumbnail_sizes['full'] = __('Full', '');
|
2184 |
+
$get_intermediate_image_sizes = get_intermediate_image_sizes();
|
2185 |
+
|
2186 |
+
if(!empty($get_intermediate_image_sizes))
|
2187 |
+
foreach($get_intermediate_image_sizes as $size_key){
|
2188 |
+
$size_name = str_replace('_', ' ',$size_key);
|
2189 |
+
$size_name = str_replace('-', ' ',$size_name);
|
2190 |
+
|
2191 |
+
$thumbnail_sizes[$size_key] = ucfirst($size_name);
|
2192 |
+
}
|
2193 |
+
//echo '<pre>'.var_export($thumbnail_sizes, true).'</pre>';
|
2194 |
+
|
2195 |
+
$args = array(
|
2196 |
+
'id' => 'thumb_size',
|
2197 |
+
'parent' => $input_name.'[term_thumb]',
|
2198 |
+
'title' => __('Thumbnail size','woocommerce-products-slider'),
|
2199 |
+
'details' => __('Choose thumbnail size.','woocommerce-products-slider'),
|
2200 |
+
'type' => 'select',
|
2201 |
+
'value' => $thumb_size,
|
2202 |
+
'default' => 'large',
|
2203 |
+
'args' => $thumbnail_sizes,
|
2204 |
+
);
|
2205 |
+
|
2206 |
+
$settings_tabs_field->generate_field($args);
|
2207 |
+
|
2208 |
+
|
2209 |
+
|
2210 |
+
|
2211 |
+
|
2212 |
+
$args = array(
|
2213 |
+
'id' => 'thumb_height',
|
2214 |
+
'title' => __('Thumbnail height','woocommerce-products-slider'),
|
2215 |
+
'details' => __('Set thumbnail height.','woocommerce-products-slider'),
|
2216 |
+
'type' => 'option_group',
|
2217 |
+
'options' => array(
|
2218 |
+
array(
|
2219 |
+
'id' => 'large',
|
2220 |
+
'parent' => $input_name.'[term_thumb][thumb_height]',
|
2221 |
+
'title' => __('In desktop','woocommerce-products-slider'),
|
2222 |
+
'details' => __('min-width: 1200px, ex: 280px','woocommerce-products-slider'),
|
2223 |
+
'type' => 'text',
|
2224 |
+
'value' => $thumb_height_large,
|
2225 |
+
'default' => '',
|
2226 |
+
'placeholder' => '280px',
|
2227 |
+
),
|
2228 |
+
array(
|
2229 |
+
'id' => 'medium',
|
2230 |
+
'parent' => $input_name.'[term_thumb][thumb_height]',
|
2231 |
+
'title' => __('In tablet & small desktop','woocommerce-products-slider'),
|
2232 |
+
'details' => __('min-width: 992px, ex: 280px','woocommerce-products-slider'),
|
2233 |
+
'type' => 'text',
|
2234 |
+
'value' => $thumb_height_medium,
|
2235 |
+
'default' => '',
|
2236 |
+
'placeholder' => '280px',
|
2237 |
+
),
|
2238 |
+
array(
|
2239 |
+
'id' => 'small',
|
2240 |
+
'parent' => $input_name.'[term_thumb][thumb_height]',
|
2241 |
+
'title' => __('In mobile','woocommerce-products-slider'),
|
2242 |
+
'details' => __('max-width: 768px, ex: 280px','woocommerce-products-slider'),
|
2243 |
+
'type' => 'text',
|
2244 |
+
'value' => $thumb_height_small,
|
2245 |
+
'default' => '',
|
2246 |
+
'placeholder' => '280px',
|
2247 |
+
),
|
2248 |
+
),
|
2249 |
+
|
2250 |
+
);
|
2251 |
+
|
2252 |
+
$settings_tabs_field->generate_field($args);
|
2253 |
+
|
2254 |
+
$args = array(
|
2255 |
+
'id' => 'default_thumb_src',
|
2256 |
+
'parent' => $input_name.'[term_thumb]',
|
2257 |
+
'title' => __('Default thumbnail','woocommerce-products-slider'),
|
2258 |
+
'details' => __('Choose default thumbnail.','woocommerce-products-slider'),
|
2259 |
+
'type' => 'media_url',
|
2260 |
+
'value' => $default_thumb_src,
|
2261 |
+
'default' => '',
|
2262 |
+
);
|
2263 |
+
|
2264 |
+
$settings_tabs_field->generate_field($args);
|
2265 |
+
|
2266 |
+
|
2267 |
+
$args = array(
|
2268 |
+
'id' => 'margin',
|
2269 |
+
'css_id' => $element_index.'_margin',
|
2270 |
+
'parent' => $input_name.'[term_thumb]',
|
2271 |
+
'title' => __('Margin','woocommerce-products-slider'),
|
2272 |
+
'details' => __('Set margin.','woocommerce-products-slider'),
|
2273 |
+
'type' => 'text',
|
2274 |
+
'value' => $margin,
|
2275 |
+
'default' => '',
|
2276 |
+
'placeholder' => '5px 0',
|
2277 |
+
);
|
2278 |
+
|
2279 |
+
$settings_tabs_field->generate_field($args);
|
2280 |
+
|
2281 |
+
ob_start();
|
2282 |
+
?>
|
2283 |
+
<code onclick="this.select()">
|
2284 |
+
.element-<?php echo $element_index?>{}
|
2285 |
+
|
2286 |
+
</code>
|
2287 |
+
<?php
|
2288 |
+
|
2289 |
+
$html = ob_get_clean();
|
2290 |
+
|
2291 |
+
$args = array(
|
2292 |
+
'id' => 'use_css',
|
2293 |
+
'title' => __('Use of CSS','woocommerce-products-slider'),
|
2294 |
+
'details' => __('Use following class selector to add custom CSS for this element.','woocommerce-products-slider'),
|
2295 |
+
'type' => 'custom_html',
|
2296 |
+
'html' => $html,
|
2297 |
+
|
2298 |
+
);
|
2299 |
+
|
2300 |
+
$settings_tabs_field->generate_field($args);
|
2301 |
+
|
2302 |
+
|
2303 |
+
|
2304 |
+
|
2305 |
+
|
2306 |
+
?>
|
2307 |
+
|
2308 |
+
</div>
|
2309 |
+
</div>
|
2310 |
+
<?php
|
2311 |
+
|
2312 |
+
}
|
2313 |
+
|
2314 |
+
|
2315 |
+
|
2316 |
+
add_action('wcps_layout_elements_option_term_description','wcps_layout_elements_option_term_description');
|
2317 |
+
|
2318 |
+
|
2319 |
+
function wcps_layout_elements_option_term_description($parameters){
|
2320 |
+
|
2321 |
+
$settings_tabs_field = new settings_tabs_field();
|
2322 |
+
|
2323 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
2324 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
2325 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
2326 |
+
|
2327 |
+
|
2328 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
2329 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
2330 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
2331 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
2332 |
+
$link_to = isset($element_data['link_to']) ? $element_data['link_to'] : '';
|
2333 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
2334 |
+
|
2335 |
+
$custom_css = isset($element_data['custom_css']) ? $element_data['custom_css'] : '';
|
2336 |
+
$custom_css_hover = isset($element_data['custom_css_hover']) ? $element_data['custom_css_hover'] : '';
|
2337 |
+
|
2338 |
+
|
2339 |
+
|
2340 |
+
?>
|
2341 |
+
<div class="item">
|
2342 |
+
<div class="element-title header ">
|
2343 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
2344 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
2345 |
+
|
2346 |
+
<span class="expand"><?php echo __('Term description','woocommerce-products-slider'); ?></span>
|
2347 |
+
</div>
|
2348 |
+
<div class="element-options options">
|
2349 |
+
|
2350 |
+
<?php
|
2351 |
+
|
2352 |
+
$args = array(
|
2353 |
+
'id' => 'color',
|
2354 |
+
'css_id' => $element_index.'_term_description',
|
2355 |
+
'parent' => $input_name.'[term_description]',
|
2356 |
+
'title' => __('Color','woocommerce-products-slider'),
|
2357 |
+
'details' => __('Title text color.','woocommerce-products-slider'),
|
2358 |
+
'type' => 'colorpicker',
|
2359 |
+
'value' => $color,
|
2360 |
+
'default' => '',
|
2361 |
+
);
|
2362 |
+
|
2363 |
+
$settings_tabs_field->generate_field($args);
|
2364 |
+
|
2365 |
+
$args = array(
|
2366 |
+
'id' => 'font_size',
|
2367 |
+
'css_id' => $element_index.'_font_size',
|
2368 |
+
'parent' => $input_name.'[term_description]',
|
2369 |
+
'title' => __('Font size','woocommerce-products-slider'),
|
2370 |
+
'details' => __('Set font size.','woocommerce-products-slider'),
|
2371 |
+
'type' => 'text',
|
2372 |
+
'value' => $font_size,
|
2373 |
+
'default' => '',
|
2374 |
+
'placeholder' => '14px',
|
2375 |
+
);
|
2376 |
+
|
2377 |
+
$settings_tabs_field->generate_field($args);
|
2378 |
+
|
2379 |
+
|
2380 |
+
$args = array(
|
2381 |
+
'id' => 'font_family',
|
2382 |
+
'css_id' => $element_index.'_font_family',
|
2383 |
+
'parent' => $input_name.'[term_description]',
|
2384 |
+
'title' => __('Font family','woocommerce-products-slider'),
|
2385 |
+
'details' => __('Set font family.','woocommerce-products-slider'),
|
2386 |
+
'type' => 'text',
|
2387 |
+
'value' => $font_family,
|
2388 |
+
'default' => '',
|
2389 |
+
'placeholder' => 'Open Sans',
|
2390 |
+
);
|
2391 |
+
|
2392 |
+
$settings_tabs_field->generate_field($args);
|
2393 |
+
|
2394 |
+
|
2395 |
+
$args = array(
|
2396 |
+
'id' => 'margin',
|
2397 |
+
'css_id' => $element_index.'_margin',
|
2398 |
+
'parent' => $input_name.'[term_description]',
|
2399 |
+
'title' => __('Margin','woocommerce-products-slider'),
|
2400 |
+
'details' => __('Set margin.','woocommerce-products-slider'),
|
2401 |
+
'type' => 'text',
|
2402 |
+
'value' => $margin,
|
2403 |
+
'default' => '',
|
2404 |
+
'placeholder' => '5px 0',
|
2405 |
+
);
|
2406 |
+
|
2407 |
+
$settings_tabs_field->generate_field($args);
|
2408 |
+
|
2409 |
+
|
2410 |
+
$args = array(
|
2411 |
+
'id' => 'text_align',
|
2412 |
+
'css_id' => $element_index.'_text_align',
|
2413 |
+
'parent' => $input_name.'[term_description]',
|
2414 |
+
'title' => __('Text align','woocommerce-products-slider'),
|
2415 |
+
'details' => __('Choose text align.','woocommerce-products-slider'),
|
2416 |
+
'type' => 'select',
|
2417 |
+
'value' => $text_align,
|
2418 |
+
'default' => 'left',
|
2419 |
+
'args' => array('left'=> __('Left', 'woocommerce-products-slider'),'right'=> __('Right', 'woocommerce-products-slider'),'center'=> __('Center', 'woocommerce-products-slider') ),
|
2420 |
+
);
|
2421 |
+
|
2422 |
+
$settings_tabs_field->generate_field($args);
|
2423 |
+
|
2424 |
+
|
2425 |
+
$args = array(
|
2426 |
+
'id' => 'link_to',
|
2427 |
+
'css_id' => $element_index.'_link_to',
|
2428 |
+
'parent' => $input_name.'[term_description]',
|
2429 |
+
'title' => __('Link to','woocommerce-products-slider'),
|
2430 |
+
'details' => __('Choose option to link product.','woocommerce-products-slider'),
|
2431 |
+
'type' => 'select',
|
2432 |
+
'value' => $link_to,
|
2433 |
+
'default' => 'product_link',
|
2434 |
+
'args' => array(
|
2435 |
+
'none'=> __('None', 'woocommerce-products-slider'),
|
2436 |
+
'product_link'=> __('product link', 'woocommerce-products-slider'),
|
2437 |
+
'external_product_url'=> __('External product', 'woocommerce-products-slider'),
|
2438 |
+
),
|
2439 |
+
);
|
2440 |
+
|
2441 |
+
$settings_tabs_field->generate_field($args);
|
2442 |
+
|
2443 |
+
|
2444 |
+
|
2445 |
+
|
2446 |
+
ob_start();
|
2447 |
+
?>
|
2448 |
+
<textarea readonly type="text" onclick="this.select();">.element-<?php echo $element_index?>{}</textarea>
|
2449 |
+
<?php
|
2450 |
+
|
2451 |
+
$html = ob_get_clean();
|
2452 |
+
|
2453 |
+
$args = array(
|
2454 |
+
'id' => 'use_css',
|
2455 |
+
'title' => __('Use of CSS','woocommerce-products-slider'),
|
2456 |
+
'details' => __('Use following class selector to add custom CSS for this element.','woocommerce-products-slider'),
|
2457 |
+
'type' => 'custom_html',
|
2458 |
+
'html' => $html,
|
2459 |
+
|
2460 |
+
);
|
2461 |
+
|
2462 |
+
$settings_tabs_field->generate_field($args);
|
2463 |
+
|
2464 |
+
?>
|
2465 |
+
|
2466 |
+
</div>
|
2467 |
+
</div>
|
2468 |
+
<?php
|
2469 |
+
|
2470 |
+
}
|
2471 |
+
|
2472 |
+
|
2473 |
+
|
2474 |
+
add_action('wcps_layout_elements_option_term_slug','wcps_layout_elements_option_term_slug');
|
2475 |
+
|
2476 |
+
|
2477 |
+
function wcps_layout_elements_option_term_slug($parameters){
|
2478 |
+
|
2479 |
+
$settings_tabs_field = new settings_tabs_field();
|
2480 |
+
|
2481 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
2482 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
2483 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
2484 |
+
|
2485 |
+
|
2486 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
2487 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
2488 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
2489 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
2490 |
+
$link_to = isset($element_data['link_to']) ? $element_data['link_to'] : '';
|
2491 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
2492 |
+
|
2493 |
+
$custom_css = isset($element_data['custom_css']) ? $element_data['custom_css'] : '';
|
2494 |
+
$custom_css_hover = isset($element_data['custom_css_hover']) ? $element_data['custom_css_hover'] : '';
|
2495 |
+
|
2496 |
+
|
2497 |
+
|
2498 |
+
?>
|
2499 |
+
<div class="item">
|
2500 |
+
<div class="element-title header ">
|
2501 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
2502 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
2503 |
+
|
2504 |
+
<span class="expand"><?php echo __('Term slug','woocommerce-products-slider'); ?></span>
|
2505 |
+
</div>
|
2506 |
+
<div class="element-options options">
|
2507 |
+
|
2508 |
+
<?php
|
2509 |
+
|
2510 |
+
$args = array(
|
2511 |
+
'id' => 'color',
|
2512 |
+
'css_id' => $element_index.'_term_description',
|
2513 |
+
'parent' => $input_name.'[term_slug]',
|
2514 |
+
'title' => __('Color','woocommerce-products-slider'),
|
2515 |
+
'details' => __('Title text color.','woocommerce-products-slider'),
|
2516 |
+
'type' => 'colorpicker',
|
2517 |
+
'value' => $color,
|
2518 |
+
'default' => '',
|
2519 |
+
);
|
2520 |
+
|
2521 |
+
$settings_tabs_field->generate_field($args);
|
2522 |
+
|
2523 |
+
$args = array(
|
2524 |
+
'id' => 'font_size',
|
2525 |
+
'css_id' => $element_index.'_font_size',
|
2526 |
+
'parent' => $input_name.'[term_slug]',
|
2527 |
+
'title' => __('Font size','woocommerce-products-slider'),
|
2528 |
+
'details' => __('Set font size.','woocommerce-products-slider'),
|
2529 |
+
'type' => 'text',
|
2530 |
+
'value' => $font_size,
|
2531 |
+
'default' => '',
|
2532 |
+
'placeholder' => '14px',
|
2533 |
+
);
|
2534 |
+
|
2535 |
+
$settings_tabs_field->generate_field($args);
|
2536 |
+
|
2537 |
+
|
2538 |
+
$args = array(
|
2539 |
+
'id' => 'font_family',
|
2540 |
+
'css_id' => $element_index.'_font_family',
|
2541 |
+
'parent' => $input_name.'[term_slug]',
|
2542 |
+
'title' => __('Font family','woocommerce-products-slider'),
|
2543 |
+
'details' => __('Set font family.','woocommerce-products-slider'),
|
2544 |
+
'type' => 'text',
|
2545 |
+
'value' => $font_family,
|
2546 |
+
'default' => '',
|
2547 |
+
'placeholder' => 'Open Sans',
|
2548 |
+
);
|
2549 |
+
|
2550 |
+
$settings_tabs_field->generate_field($args);
|
2551 |
+
|
2552 |
+
|
2553 |
+
$args = array(
|
2554 |
+
'id' => 'margin',
|
2555 |
+
'css_id' => $element_index.'_margin',
|
2556 |
+
'parent' => $input_name.'[term_slug]',
|
2557 |
+
'title' => __('Margin','woocommerce-products-slider'),
|
2558 |
+
'details' => __('Set margin.','woocommerce-products-slider'),
|
2559 |
+
'type' => 'text',
|
2560 |
+
'value' => $margin,
|
2561 |
+
'default' => '',
|
2562 |
+
'placeholder' => '5px 0',
|
2563 |
+
);
|
2564 |
+
|
2565 |
+
$settings_tabs_field->generate_field($args);
|
2566 |
+
|
2567 |
+
|
2568 |
+
$args = array(
|
2569 |
+
'id' => 'text_align',
|
2570 |
+
'css_id' => $element_index.'_text_align',
|
2571 |
+
'parent' => $input_name.'[term_slug]',
|
2572 |
+
'title' => __('Text align','woocommerce-products-slider'),
|
2573 |
+
'details' => __('Choose text align.','woocommerce-products-slider'),
|
2574 |
+
'type' => 'select',
|
2575 |
+
'value' => $text_align,
|
2576 |
+
'default' => 'left',
|
2577 |
+
'args' => array('left'=> __('Left', 'woocommerce-products-slider'),'right'=> __('Right', 'woocommerce-products-slider'),'center'=> __('Center', 'woocommerce-products-slider') ),
|
2578 |
+
);
|
2579 |
+
|
2580 |
+
$settings_tabs_field->generate_field($args);
|
2581 |
+
|
2582 |
+
|
2583 |
+
$args = array(
|
2584 |
+
'id' => 'link_to',
|
2585 |
+
'css_id' => $element_index.'_link_to',
|
2586 |
+
'parent' => $input_name.'[term_slug]',
|
2587 |
+
'title' => __('Link to','woocommerce-products-slider'),
|
2588 |
+
'details' => __('Choose option to link product.','woocommerce-products-slider'),
|
2589 |
+
'type' => 'select',
|
2590 |
+
'value' => $link_to,
|
2591 |
+
'default' => 'product_link',
|
2592 |
+
'args' => array(
|
2593 |
+
'none'=> __('None', 'woocommerce-products-slider'),
|
2594 |
+
'product_link'=> __('product link', 'woocommerce-products-slider'),
|
2595 |
+
'external_product_url'=> __('External product', 'woocommerce-products-slider'),
|
2596 |
+
),
|
2597 |
+
);
|
2598 |
+
|
2599 |
+
$settings_tabs_field->generate_field($args);
|
2600 |
+
|
2601 |
+
|
2602 |
+
|
2603 |
+
|
2604 |
+
ob_start();
|
2605 |
+
?>
|
2606 |
+
<textarea readonly type="text" onclick="this.select();">.element-<?php echo $element_index?>{}</textarea>
|
2607 |
+
<?php
|
2608 |
+
|
2609 |
+
$html = ob_get_clean();
|
2610 |
+
|
2611 |
+
$args = array(
|
2612 |
+
'id' => 'use_css',
|
2613 |
+
'title' => __('Use of CSS','woocommerce-products-slider'),
|
2614 |
+
'details' => __('Use following class selector to add custom CSS for this element.','woocommerce-products-slider'),
|
2615 |
+
'type' => 'custom_html',
|
2616 |
+
'html' => $html,
|
2617 |
+
|
2618 |
+
);
|
2619 |
+
|
2620 |
+
$settings_tabs_field->generate_field($args);
|
2621 |
+
|
2622 |
+
?>
|
2623 |
+
|
2624 |
+
</div>
|
2625 |
+
</div>
|
2626 |
+
<?php
|
2627 |
+
|
2628 |
+
}
|
2629 |
+
|
2630 |
+
|
2631 |
+
|
2632 |
+
add_action('wcps_layout_elements_option_term_post_count','wcps_layout_elements_option_term_post_count');
|
2633 |
+
|
2634 |
+
|
2635 |
+
function wcps_layout_elements_option_term_post_count($parameters){
|
2636 |
+
|
2637 |
+
$settings_tabs_field = new settings_tabs_field();
|
2638 |
+
|
2639 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
2640 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
2641 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
2642 |
+
|
2643 |
+
|
2644 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
2645 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
2646 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
2647 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
2648 |
+
$link_to = isset($element_data['link_to']) ? $element_data['link_to'] : '';
|
2649 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
2650 |
+
$wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
|
2651 |
+
|
2652 |
+
$custom_css = isset($element_data['custom_css']) ? $element_data['custom_css'] : '';
|
2653 |
+
$custom_css_hover = isset($element_data['custom_css_hover']) ? $element_data['custom_css_hover'] : '';
|
2654 |
+
|
2655 |
+
|
2656 |
+
|
2657 |
+
?>
|
2658 |
+
<div class="item">
|
2659 |
+
<div class="element-title header ">
|
2660 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
2661 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
2662 |
+
|
2663 |
+
<span class="expand"><?php echo __('Term post count','woocommerce-products-slider'); ?></span>
|
2664 |
+
</div>
|
2665 |
+
<div class="element-options options">
|
2666 |
+
|
2667 |
+
<?php
|
2668 |
+
|
2669 |
+
|
2670 |
+
$args = array(
|
2671 |
+
'id' => 'wrapper_html',
|
2672 |
+
'css_id' => $element_index.'_wrapper_html',
|
2673 |
+
'parent' => $input_name.'[term_post_count]',
|
2674 |
+
'title' => __('Wrapper html','woocommerce-products-slider'),
|
2675 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace sale count output.','woocommerce-products-slider'),
|
2676 |
+
'type' => 'text',
|
2677 |
+
'value' => $wrapper_html,
|
2678 |
+
'default' => '',
|
2679 |
+
'placeholder' => 'Total post: %s',
|
2680 |
+
);
|
2681 |
+
|
2682 |
+
$settings_tabs_field->generate_field($args);
|
2683 |
+
|
2684 |
+
$args = array(
|
2685 |
+
'id' => 'color',
|
2686 |
+
'css_id' => $element_index.'_term_description',
|
2687 |
+
'parent' => $input_name.'[term_post_count]',
|
2688 |
+
'title' => __('Color','woocommerce-products-slider'),
|
2689 |
+
'details' => __('Title text color.','woocommerce-products-slider'),
|
2690 |
+
'type' => 'colorpicker',
|
2691 |
+
'value' => $color,
|
2692 |
+
'default' => '',
|
2693 |
+
);
|
2694 |
+
|
2695 |
+
$settings_tabs_field->generate_field($args);
|
2696 |
+
|
2697 |
+
$args = array(
|
2698 |
+
'id' => 'font_size',
|
2699 |
+
'css_id' => $element_index.'_font_size',
|
2700 |
+
'parent' => $input_name.'[term_post_count]',
|
2701 |
+
'title' => __('Font size','woocommerce-products-slider'),
|
2702 |
+
'details' => __('Set font size.','woocommerce-products-slider'),
|
2703 |
+
'type' => 'text',
|
2704 |
+
'value' => $font_size,
|
2705 |
+
'default' => '',
|
2706 |
+
'placeholder' => '14px',
|
2707 |
+
);
|
2708 |
+
|
2709 |
+
$settings_tabs_field->generate_field($args);
|
2710 |
+
|
2711 |
+
|
2712 |
+
$args = array(
|
2713 |
+
'id' => 'font_family',
|
2714 |
+
'css_id' => $element_index.'_font_family',
|
2715 |
+
'parent' => $input_name.'[term_post_count]',
|
2716 |
+
'title' => __('Font family','woocommerce-products-slider'),
|
2717 |
+
'details' => __('Set font family.','woocommerce-products-slider'),
|
2718 |
+
'type' => 'text',
|
2719 |
+
'value' => $font_family,
|
2720 |
+
'default' => '',
|
2721 |
+
'placeholder' => 'Open Sans',
|
2722 |
+
);
|
2723 |
+
|
2724 |
+
$settings_tabs_field->generate_field($args);
|
2725 |
+
|
2726 |
+
|
2727 |
+
$args = array(
|
2728 |
+
'id' => 'margin',
|
2729 |
+
'css_id' => $element_index.'_margin',
|
2730 |
+
'parent' => $input_name.'[term_post_count]',
|
2731 |
+
'title' => __('Margin','woocommerce-products-slider'),
|
2732 |
+
'details' => __('Set margin.','woocommerce-products-slider'),
|
2733 |
+
'type' => 'text',
|
2734 |
+
'value' => $margin,
|
2735 |
+
'default' => '',
|
2736 |
+
'placeholder' => '5px 0',
|
2737 |
+
);
|
2738 |
+
|
2739 |
+
$settings_tabs_field->generate_field($args);
|
2740 |
+
|
2741 |
+
|
2742 |
+
$args = array(
|
2743 |
+
'id' => 'text_align',
|
2744 |
+
'css_id' => $element_index.'_text_align',
|
2745 |
+
'parent' => $input_name.'[term_post_count]',
|
2746 |
+
'title' => __('Text align','woocommerce-products-slider'),
|
2747 |
+
'details' => __('Choose text align.','woocommerce-products-slider'),
|
2748 |
+
'type' => 'select',
|
2749 |
+
'value' => $text_align,
|
2750 |
+
'default' => 'left',
|
2751 |
+
'args' => array('left'=> __('Left', 'woocommerce-products-slider'),'right'=> __('Right', 'woocommerce-products-slider'),'center'=> __('Center', 'woocommerce-products-slider') ),
|
2752 |
+
);
|
2753 |
+
|
2754 |
+
$settings_tabs_field->generate_field($args);
|
2755 |
+
|
2756 |
+
|
2757 |
+
ob_start();
|
2758 |
+
?>
|
2759 |
+
<textarea readonly type="text" onclick="this.select();">.element-<?php echo $element_index?>{}</textarea>
|
2760 |
+
<?php
|
2761 |
+
|
2762 |
+
$html = ob_get_clean();
|
2763 |
+
|
2764 |
+
$args = array(
|
2765 |
+
'id' => 'use_css',
|
2766 |
+
'title' => __('Use of CSS','woocommerce-products-slider'),
|
2767 |
+
'details' => __('Use following class selector to add custom CSS for this element.','woocommerce-products-slider'),
|
2768 |
+
'type' => 'custom_html',
|
2769 |
+
'html' => $html,
|
2770 |
+
|
2771 |
+
);
|
2772 |
+
|
2773 |
+
$settings_tabs_field->generate_field($args);
|
2774 |
+
|
2775 |
+
?>
|
2776 |
+
|
2777 |
+
</div>
|
2778 |
+
</div>
|
2779 |
+
<?php
|
2780 |
+
|
2781 |
+
}
|
2782 |
+
|
2783 |
+
|
2784 |
+
|
2785 |
+
|
2786 |
+
add_action('wcps_layout_elements_option_dokan_store_name','wcps_layout_elements_option_dokan_store_name');
|
2787 |
+
function wcps_layout_elements_option_dokan_store_name($parameters){
|
2788 |
+
|
2789 |
+
$settings_tabs_field = new settings_tabs_field();
|
2790 |
+
|
2791 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
2792 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
2793 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
2794 |
+
|
2795 |
+
|
2796 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
2797 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
2798 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
2799 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
2800 |
+
$link_to = isset($element_data['link_to']) ? $element_data['link_to'] : '';
|
2801 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
2802 |
+
$wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
|
2803 |
+
|
2804 |
+
$custom_css = isset($element_data['custom_css']) ? $element_data['custom_css'] : '';
|
2805 |
+
$custom_css_hover = isset($element_data['custom_css_hover']) ? $element_data['custom_css_hover'] : '';
|
2806 |
+
|
2807 |
+
|
2808 |
+
|
2809 |
+
?>
|
2810 |
+
<div class="item">
|
2811 |
+
<div class="element-title header ">
|
2812 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
2813 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
2814 |
+
|
2815 |
+
<span class="expand"><?php echo __('Dokan store name','woocommerce-products-slider'); ?></span>
|
2816 |
+
</div>
|
2817 |
+
<div class="element-options options">
|
2818 |
+
|
2819 |
+
<?php
|
2820 |
+
|
2821 |
+
|
2822 |
+
$args = array(
|
2823 |
+
'id' => 'wrapper_html',
|
2824 |
+
'css_id' => $element_index.'_wrapper_html',
|
2825 |
+
'parent' => $input_name.'[dokan_store_name]',
|
2826 |
+
'title' => __('Wrapper html','woocommerce-products-slider'),
|
2827 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace sale count output.','woocommerce-products-slider'),
|
2828 |
+
'type' => 'text',
|
2829 |
+
'value' => $wrapper_html,
|
2830 |
+
'default' => '',
|
2831 |
+
'placeholder' => 'Store name: %s',
|
2832 |
+
);
|
2833 |
+
|
2834 |
+
$settings_tabs_field->generate_field($args);
|
2835 |
+
|
2836 |
+
$args = array(
|
2837 |
+
'id' => 'color',
|
2838 |
+
'css_id' => $element_index.'_dokan_store_name',
|
2839 |
+
'parent' => $input_name.'[dokan_store_name]',
|
2840 |
+
'title' => __('Color','woocommerce-products-slider'),
|
2841 |
+
'details' => __('Title text color.','woocommerce-products-slider'),
|
2842 |
+
'type' => 'colorpicker',
|
2843 |
+
'value' => $color,
|
2844 |
+
'default' => '',
|
2845 |
+
);
|
2846 |
+
|
2847 |
+
$settings_tabs_field->generate_field($args);
|
2848 |
+
|
2849 |
+
$args = array(
|
2850 |
+
'id' => 'font_size',
|
2851 |
+
'css_id' => $element_index.'_font_size',
|
2852 |
+
'parent' => $input_name.'[dokan_store_name]',
|
2853 |
+
'title' => __('Font size','woocommerce-products-slider'),
|
2854 |
+
'details' => __('Set font size.','woocommerce-products-slider'),
|
2855 |
+
'type' => 'text',
|
2856 |
+
'value' => $font_size,
|
2857 |
+
'default' => '',
|
2858 |
+
'placeholder' => '14px',
|
2859 |
+
);
|
2860 |
+
|
2861 |
+
$settings_tabs_field->generate_field($args);
|
2862 |
+
|
2863 |
+
|
2864 |
+
$args = array(
|
2865 |
+
'id' => 'font_family',
|
2866 |
+
'css_id' => $element_index.'_font_family',
|
2867 |
+
'parent' => $input_name.'[dokan_store_name]',
|
2868 |
+
'title' => __('Font family','woocommerce-products-slider'),
|
2869 |
+
'details' => __('Set font family.','woocommerce-products-slider'),
|
2870 |
+
'type' => 'text',
|
2871 |
+
'value' => $font_family,
|
2872 |
+
'default' => '',
|
2873 |
+
'placeholder' => 'Open Sans',
|
2874 |
+
);
|
2875 |
+
|
2876 |
+
$settings_tabs_field->generate_field($args);
|
2877 |
+
|
2878 |
+
|
2879 |
+
$args = array(
|
2880 |
+
'id' => 'margin',
|
2881 |
+
'css_id' => $element_index.'_margin',
|
2882 |
+
'parent' => $input_name.'[dokan_store_name]',
|
2883 |
+
'title' => __('Margin','woocommerce-products-slider'),
|
2884 |
+
'details' => __('Set margin.','woocommerce-products-slider'),
|
2885 |
+
'type' => 'text',
|
2886 |
+
'value' => $margin,
|
2887 |
+
'default' => '',
|
2888 |
+
'placeholder' => '5px 0',
|
2889 |
+
);
|
2890 |
+
|
2891 |
+
$settings_tabs_field->generate_field($args);
|
2892 |
+
|
2893 |
+
|
2894 |
+
$args = array(
|
2895 |
+
'id' => 'text_align',
|
2896 |
+
'css_id' => $element_index.'_text_align',
|
2897 |
+
'parent' => $input_name.'[dokan_store_name]',
|
2898 |
+
'title' => __('Text align','woocommerce-products-slider'),
|
2899 |
+
'details' => __('Choose text align.','woocommerce-products-slider'),
|
2900 |
+
'type' => 'select',
|
2901 |
+
'value' => $text_align,
|
2902 |
+
'default' => 'left',
|
2903 |
+
'args' => array('left'=> __('Left', 'woocommerce-products-slider'),'right'=> __('Right', 'woocommerce-products-slider'),'center'=> __('Center', 'woocommerce-products-slider') ),
|
2904 |
+
);
|
2905 |
+
|
2906 |
+
$settings_tabs_field->generate_field($args);
|
2907 |
+
|
2908 |
+
|
2909 |
+
ob_start();
|
2910 |
+
?>
|
2911 |
+
<textarea readonly type="text" onclick="this.select();">.element-<?php echo $element_index?>{}</textarea>
|
2912 |
+
<?php
|
2913 |
+
|
2914 |
+
$html = ob_get_clean();
|
2915 |
+
|
2916 |
+
$args = array(
|
2917 |
+
'id' => 'use_css',
|
2918 |
+
'title' => __('Use of CSS','woocommerce-products-slider'),
|
2919 |
+
'details' => __('Use following class selector to add custom CSS for this element.','woocommerce-products-slider'),
|
2920 |
+
'type' => 'custom_html',
|
2921 |
+
'html' => $html,
|
2922 |
+
|
2923 |
+
);
|
2924 |
+
|
2925 |
+
$settings_tabs_field->generate_field($args);
|
2926 |
+
|
2927 |
+
?>
|
2928 |
+
|
2929 |
+
</div>
|
2930 |
+
</div>
|
2931 |
+
<?php
|
2932 |
+
|
2933 |
+
}
|
2934 |
+
|
2935 |
+
|
2936 |
+
|
2937 |
+
add_action('wcps_layout_elements_option_dokan_store_address','wcps_layout_elements_option_dokan_store_address');
|
2938 |
+
function wcps_layout_elements_option_dokan_store_address($parameters){
|
2939 |
+
|
2940 |
+
$settings_tabs_field = new settings_tabs_field();
|
2941 |
+
|
2942 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
2943 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
2944 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
2945 |
+
|
2946 |
+
|
2947 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
2948 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
2949 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
2950 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
2951 |
+
$link_to = isset($element_data['link_to']) ? $element_data['link_to'] : '';
|
2952 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
2953 |
+
$wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
|
2954 |
+
|
2955 |
+
$custom_css = isset($element_data['custom_css']) ? $element_data['custom_css'] : '';
|
2956 |
+
$custom_css_hover = isset($element_data['custom_css_hover']) ? $element_data['custom_css_hover'] : '';
|
2957 |
+
|
2958 |
+
|
2959 |
+
|
2960 |
+
?>
|
2961 |
+
<div class="item">
|
2962 |
+
<div class="element-title header ">
|
2963 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
2964 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
2965 |
+
|
2966 |
+
<span class="expand"><?php echo __('Dokan store address','woocommerce-products-slider'); ?></span>
|
2967 |
+
</div>
|
2968 |
+
<div class="element-options options">
|
2969 |
+
|
2970 |
+
<?php
|
2971 |
+
|
2972 |
+
|
2973 |
+
$args = array(
|
2974 |
+
'id' => 'wrapper_html',
|
2975 |
+
'css_id' => $element_index.'_wrapper_html',
|
2976 |
+
'parent' => $input_name.'[dokan_store_address]',
|
2977 |
+
'title' => __('Wrapper html','woocommerce-products-slider'),
|
2978 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace sale count output.','woocommerce-products-slider'),
|
2979 |
+
'type' => 'text',
|
2980 |
+
'value' => $wrapper_html,
|
2981 |
+
'default' => '',
|
2982 |
+
'placeholder' => 'Address: %s',
|
2983 |
+
);
|
2984 |
+
|
2985 |
+
$settings_tabs_field->generate_field($args);
|
2986 |
+
|
2987 |
+
$args = array(
|
2988 |
+
'id' => 'color',
|
2989 |
+
'css_id' => $element_index.'_dokan_store_address',
|
2990 |
+
'parent' => $input_name.'[dokan_store_address]',
|
2991 |
+
'title' => __('Color','woocommerce-products-slider'),
|
2992 |
+
'details' => __('Title text color.','woocommerce-products-slider'),
|
2993 |
+
'type' => 'colorpicker',
|
2994 |
+
'value' => $color,
|
2995 |
+
'default' => '',
|
2996 |
+
);
|
2997 |
+
|
2998 |
+
$settings_tabs_field->generate_field($args);
|
2999 |
+
|
3000 |
+
$args = array(
|
3001 |
+
'id' => 'font_size',
|
3002 |
+
'css_id' => $element_index.'_font_size',
|
3003 |
+
'parent' => $input_name.'[dokan_store_address]',
|
3004 |
+
'title' => __('Font size','woocommerce-products-slider'),
|
3005 |
+
'details' => __('Set font size.','woocommerce-products-slider'),
|
3006 |
+
'type' => 'text',
|
3007 |
+
'value' => $font_size,
|
3008 |
+
'default' => '',
|
3009 |
+
'placeholder' => '14px',
|
3010 |
+
);
|
3011 |
+
|
3012 |
+
$settings_tabs_field->generate_field($args);
|
3013 |
+
|
3014 |
+
|
3015 |
+
$args = array(
|
3016 |
+
'id' => 'font_family',
|
3017 |
+
'css_id' => $element_index.'_font_family',
|
3018 |
+
'parent' => $input_name.'[dokan_store_address]',
|
3019 |
+
'title' => __('Font family','woocommerce-products-slider'),
|
3020 |
+
'details' => __('Set font family.','woocommerce-products-slider'),
|
3021 |
+
'type' => 'text',
|
3022 |
+
'value' => $font_family,
|
3023 |
+
'default' => '',
|
3024 |
+
'placeholder' => 'Open Sans',
|
3025 |
+
);
|
3026 |
+
|
3027 |
+
$settings_tabs_field->generate_field($args);
|
3028 |
+
|
3029 |
+
|
3030 |
+
$args = array(
|
3031 |
+
'id' => 'margin',
|
3032 |
+
'css_id' => $element_index.'_margin',
|
3033 |
+
'parent' => $input_name.'[dokan_store_address]',
|
3034 |
+
'title' => __('Margin','woocommerce-products-slider'),
|
3035 |
+
'details' => __('Set margin.','woocommerce-products-slider'),
|
3036 |
+
'type' => 'text',
|
3037 |
+
'value' => $margin,
|
3038 |
+
'default' => '',
|
3039 |
+
'placeholder' => '5px 0',
|
3040 |
+
);
|
3041 |
+
|
3042 |
+
$settings_tabs_field->generate_field($args);
|
3043 |
+
|
3044 |
+
|
3045 |
+
$args = array(
|
3046 |
+
'id' => 'text_align',
|
3047 |
+
'css_id' => $element_index.'_text_align',
|
3048 |
+
'parent' => $input_name.'[dokan_store_address]',
|
3049 |
+
'title' => __('Text align','woocommerce-products-slider'),
|
3050 |
+
'details' => __('Choose text align.','woocommerce-products-slider'),
|
3051 |
+
'type' => 'select',
|
3052 |
+
'value' => $text_align,
|
3053 |
+
'default' => 'left',
|
3054 |
+
'args' => array('left'=> __('Left', 'woocommerce-products-slider'),'right'=> __('Right', 'woocommerce-products-slider'),'center'=> __('Center', 'woocommerce-products-slider') ),
|
3055 |
+
);
|
3056 |
+
|
3057 |
+
$settings_tabs_field->generate_field($args);
|
3058 |
+
|
3059 |
+
|
3060 |
+
ob_start();
|
3061 |
+
?>
|
3062 |
+
<textarea readonly type="text" onclick="this.select();">.element-<?php echo $element_index?>{}</textarea>
|
3063 |
+
<?php
|
3064 |
+
|
3065 |
+
$html = ob_get_clean();
|
3066 |
+
|
3067 |
+
$args = array(
|
3068 |
+
'id' => 'use_css',
|
3069 |
+
'title' => __('Use of CSS','woocommerce-products-slider'),
|
3070 |
+
'details' => __('Use following class selector to add custom CSS for this element.','woocommerce-products-slider'),
|
3071 |
+
'type' => 'custom_html',
|
3072 |
+
'html' => $html,
|
3073 |
+
|
3074 |
+
);
|
3075 |
+
|
3076 |
+
$settings_tabs_field->generate_field($args);
|
3077 |
+
|
3078 |
+
?>
|
3079 |
+
|
3080 |
+
</div>
|
3081 |
+
</div>
|
3082 |
+
<?php
|
3083 |
+
|
3084 |
+
}
|
3085 |
+
|
3086 |
+
|
3087 |
+
|
3088 |
+
|
3089 |
+
add_action('wcps_layout_elements_option_dokan_store_city','wcps_layout_elements_option_dokan_store_city');
|
3090 |
+
function wcps_layout_elements_option_dokan_store_city($parameters){
|
3091 |
+
|
3092 |
+
$settings_tabs_field = new settings_tabs_field();
|
3093 |
+
|
3094 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
3095 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
3096 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
3097 |
+
|
3098 |
+
|
3099 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
3100 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
3101 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
3102 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
3103 |
+
$link_to = isset($element_data['link_to']) ? $element_data['link_to'] : '';
|
3104 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
3105 |
+
$wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
|
3106 |
+
|
3107 |
+
$custom_css = isset($element_data['custom_css']) ? $element_data['custom_css'] : '';
|
3108 |
+
$custom_css_hover = isset($element_data['custom_css_hover']) ? $element_data['custom_css_hover'] : '';
|
3109 |
+
|
3110 |
+
|
3111 |
+
|
3112 |
+
?>
|
3113 |
+
<div class="item">
|
3114 |
+
<div class="element-title header ">
|
3115 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
3116 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
3117 |
+
|
3118 |
+
<span class="expand"><?php echo __('Dokan store city','woocommerce-products-slider'); ?></span>
|
3119 |
+
</div>
|
3120 |
+
<div class="element-options options">
|
3121 |
+
|
3122 |
+
<?php
|
3123 |
+
|
3124 |
+
|
3125 |
+
$args = array(
|
3126 |
+
'id' => 'wrapper_html',
|
3127 |
+
'css_id' => $element_index.'_wrapper_html',
|
3128 |
+
'parent' => $input_name.'[dokan_store_city]',
|
3129 |
+
'title' => __('Wrapper html','woocommerce-products-slider'),
|
3130 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace sale count output.','woocommerce-products-slider'),
|
3131 |
+
'type' => 'text',
|
3132 |
+
'value' => $wrapper_html,
|
3133 |
+
'default' => '',
|
3134 |
+
'placeholder' => 'City: %s',
|
3135 |
+
);
|
3136 |
+
|
3137 |
+
$settings_tabs_field->generate_field($args);
|
3138 |
+
|
3139 |
+
$args = array(
|
3140 |
+
'id' => 'color',
|
3141 |
+
'css_id' => $element_index.'_dokan_store_address',
|
3142 |
+
'parent' => $input_name.'[dokan_store_city]',
|
3143 |
+
'title' => __('Color','woocommerce-products-slider'),
|
3144 |
+
'details' => __('Title text color.','woocommerce-products-slider'),
|
3145 |
+
'type' => 'colorpicker',
|
3146 |
+
'value' => $color,
|
3147 |
+
'default' => '',
|
3148 |
+
);
|
3149 |
+
|
3150 |
+
$settings_tabs_field->generate_field($args);
|
3151 |
+
|
3152 |
+
$args = array(
|
3153 |
+
'id' => 'font_size',
|
3154 |
+
'css_id' => $element_index.'_font_size',
|
3155 |
+
'parent' => $input_name.'[dokan_store_city]',
|
3156 |
+
'title' => __('Font size','woocommerce-products-slider'),
|
3157 |
+
'details' => __('Set font size.','woocommerce-products-slider'),
|
3158 |
+
'type' => 'text',
|
3159 |
+
'value' => $font_size,
|
3160 |
+
'default' => '',
|
3161 |
+
'placeholder' => '14px',
|
3162 |
+
);
|
3163 |
+
|
3164 |
+
$settings_tabs_field->generate_field($args);
|
3165 |
+
|
3166 |
+
|
3167 |
+
$args = array(
|
3168 |
+
'id' => 'font_family',
|
3169 |
+
'css_id' => $element_index.'_font_family',
|
3170 |
+
'parent' => $input_name.'[dokan_store_city]',
|
3171 |
+
'title' => __('Font family','woocommerce-products-slider'),
|
3172 |
+
'details' => __('Set font family.','woocommerce-products-slider'),
|
3173 |
+
'type' => 'text',
|
3174 |
+
'value' => $font_family,
|
3175 |
+
'default' => '',
|
3176 |
+
'placeholder' => 'Open Sans',
|
3177 |
+
);
|
3178 |
+
|
3179 |
+
$settings_tabs_field->generate_field($args);
|
3180 |
+
|
3181 |
+
|
3182 |
+
$args = array(
|
3183 |
+
'id' => 'margin',
|
3184 |
+
'css_id' => $element_index.'_margin',
|
3185 |
+
'parent' => $input_name.'[dokan_store_city]',
|
3186 |
+
'title' => __('Margin','woocommerce-products-slider'),
|
3187 |
+
'details' => __('Set margin.','woocommerce-products-slider'),
|
3188 |
+
'type' => 'text',
|
3189 |
+
'value' => $margin,
|
3190 |
+
'default' => '',
|
3191 |
+
'placeholder' => '5px 0',
|
3192 |
+
);
|
3193 |
+
|
3194 |
+
$settings_tabs_field->generate_field($args);
|
3195 |
+
|
3196 |
+
|
3197 |
+
$args = array(
|
3198 |
+
'id' => 'text_align',
|
3199 |
+
'css_id' => $element_index.'_text_align',
|
3200 |
+
'parent' => $input_name.'[dokan_store_city]',
|
3201 |
+
'title' => __('Text align','woocommerce-products-slider'),
|
3202 |
+
'details' => __('Choose text align.','woocommerce-products-slider'),
|
3203 |
+
'type' => 'select',
|
3204 |
+
'value' => $text_align,
|
3205 |
+
'default' => 'left',
|
3206 |
+
'args' => array('left'=> __('Left', 'woocommerce-products-slider'),'right'=> __('Right', 'woocommerce-products-slider'),'center'=> __('Center', 'woocommerce-products-slider') ),
|
3207 |
+
);
|
3208 |
+
|
3209 |
+
$settings_tabs_field->generate_field($args);
|
3210 |
+
|
3211 |
+
|
3212 |
+
ob_start();
|
3213 |
+
?>
|
3214 |
+
<textarea readonly type="text" onclick="this.select();">.element-<?php echo $element_index?>{}</textarea>
|
3215 |
+
<?php
|
3216 |
+
|
3217 |
+
$html = ob_get_clean();
|
3218 |
+
|
3219 |
+
$args = array(
|
3220 |
+
'id' => 'use_css',
|
3221 |
+
'title' => __('Use of CSS','woocommerce-products-slider'),
|
3222 |
+
'details' => __('Use following class selector to add custom CSS for this element.','woocommerce-products-slider'),
|
3223 |
+
'type' => 'custom_html',
|
3224 |
+
'html' => $html,
|
3225 |
+
|
3226 |
+
);
|
3227 |
+
|
3228 |
+
$settings_tabs_field->generate_field($args);
|
3229 |
+
|
3230 |
+
?>
|
3231 |
+
|
3232 |
+
</div>
|
3233 |
+
</div>
|
3234 |
+
<?php
|
3235 |
+
|
3236 |
+
}
|
3237 |
+
|
3238 |
+
|
3239 |
+
add_action('wcps_layout_elements_option_dokan_store_country','wcps_layout_elements_option_dokan_store_country');
|
3240 |
+
function wcps_layout_elements_option_dokan_store_country($parameters){
|
3241 |
+
|
3242 |
+
$settings_tabs_field = new settings_tabs_field();
|
3243 |
+
|
3244 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
3245 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
3246 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
3247 |
+
|
3248 |
+
|
3249 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
3250 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
3251 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
3252 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
3253 |
+
$link_to = isset($element_data['link_to']) ? $element_data['link_to'] : '';
|
3254 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
3255 |
+
$wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
|
3256 |
+
|
3257 |
+
$custom_css = isset($element_data['custom_css']) ? $element_data['custom_css'] : '';
|
3258 |
+
$custom_css_hover = isset($element_data['custom_css_hover']) ? $element_data['custom_css_hover'] : '';
|
3259 |
+
|
3260 |
+
|
3261 |
+
|
3262 |
+
?>
|
3263 |
+
<div class="item">
|
3264 |
+
<div class="element-title header ">
|
3265 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
3266 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
3267 |
+
|
3268 |
+
<span class="expand"><?php echo __('Dokan store country','woocommerce-products-slider'); ?></span>
|
3269 |
+
</div>
|
3270 |
+
<div class="element-options options">
|
3271 |
+
|
3272 |
+
<?php
|
3273 |
+
|
3274 |
+
|
3275 |
+
$args = array(
|
3276 |
+
'id' => 'wrapper_html',
|
3277 |
+
'css_id' => $element_index.'_wrapper_html',
|
3278 |
+
'parent' => $input_name.'[dokan_store_country]',
|
3279 |
+
'title' => __('Wrapper html','woocommerce-products-slider'),
|
3280 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace sale count output.','woocommerce-products-slider'),
|
3281 |
+
'type' => 'text',
|
3282 |
+
'value' => $wrapper_html,
|
3283 |
+
'default' => '',
|
3284 |
+
'placeholder' => 'Country: %s',
|
3285 |
+
);
|
3286 |
+
|
3287 |
+
$settings_tabs_field->generate_field($args);
|
3288 |
+
|
3289 |
+
$args = array(
|
3290 |
+
'id' => 'color',
|
3291 |
+
'css_id' => $element_index.'_dokan_store_country',
|
3292 |
+
'parent' => $input_name.'[dokan_store_country]',
|
3293 |
+
'title' => __('Color','woocommerce-products-slider'),
|
3294 |
+
'details' => __('Title text color.','woocommerce-products-slider'),
|
3295 |
+
'type' => 'colorpicker',
|
3296 |
+
'value' => $color,
|
3297 |
+
'default' => '',
|
3298 |
+
);
|
3299 |
+
|
3300 |
+
$settings_tabs_field->generate_field($args);
|
3301 |
+
|
3302 |
+
$args = array(
|
3303 |
+
'id' => 'font_size',
|
3304 |
+
'css_id' => $element_index.'_font_size',
|
3305 |
+
'parent' => $input_name.'[dokan_store_country]',
|
3306 |
+
'title' => __('Font size','woocommerce-products-slider'),
|
3307 |
+
'details' => __('Set font size.','woocommerce-products-slider'),
|
3308 |
+
'type' => 'text',
|
3309 |
+
'value' => $font_size,
|
3310 |
+
'default' => '',
|
3311 |
+
'placeholder' => '14px',
|
3312 |
+
);
|
3313 |
+
|
3314 |
+
$settings_tabs_field->generate_field($args);
|
3315 |
+
|
3316 |
+
|
3317 |
+
$args = array(
|
3318 |
+
'id' => 'font_family',
|
3319 |
+
'css_id' => $element_index.'_font_family',
|
3320 |
+
'parent' => $input_name.'[dokan_store_country]',
|
3321 |
+
'title' => __('Font family','woocommerce-products-slider'),
|
3322 |
+
'details' => __('Set font family.','woocommerce-products-slider'),
|
3323 |
+
'type' => 'text',
|
3324 |
+
'value' => $font_family,
|
3325 |
+
'default' => '',
|
3326 |
+
'placeholder' => 'Open Sans',
|
3327 |
+
);
|
3328 |
+
|
3329 |
+
$settings_tabs_field->generate_field($args);
|
3330 |
+
|
3331 |
+
|
3332 |
+
$args = array(
|
3333 |
+
'id' => 'margin',
|
3334 |
+
'css_id' => $element_index.'_margin',
|
3335 |
+
'parent' => $input_name.'[dokan_store_country]',
|
3336 |
+
'title' => __('Margin','woocommerce-products-slider'),
|
3337 |
+
'details' => __('Set margin.','woocommerce-products-slider'),
|
3338 |
+
'type' => 'text',
|
3339 |
+
'value' => $margin,
|
3340 |
+
'default' => '',
|
3341 |
+
'placeholder' => '5px 0',
|
3342 |
+
);
|
3343 |
+
|
3344 |
+
$settings_tabs_field->generate_field($args);
|
3345 |
+
|
3346 |
+
|
3347 |
+
$args = array(
|
3348 |
+
'id' => 'text_align',
|
3349 |
+
'css_id' => $element_index.'_text_align',
|
3350 |
+
'parent' => $input_name.'[dokan_store_country]',
|
3351 |
+
'title' => __('Text align','woocommerce-products-slider'),
|
3352 |
+
'details' => __('Choose text align.','woocommerce-products-slider'),
|
3353 |
+
'type' => 'select',
|
3354 |
+
'value' => $text_align,
|
3355 |
+
'default' => 'left',
|
3356 |
+
'args' => array('left'=> __('Left', 'woocommerce-products-slider'),'right'=> __('Right', 'woocommerce-products-slider'),'center'=> __('Center', 'woocommerce-products-slider') ),
|
3357 |
+
);
|
3358 |
+
|
3359 |
+
$settings_tabs_field->generate_field($args);
|
3360 |
+
|
3361 |
+
|
3362 |
+
ob_start();
|
3363 |
+
?>
|
3364 |
+
<textarea readonly type="text" onclick="this.select();">.element-<?php echo $element_index?>{}</textarea>
|
3365 |
+
<?php
|
3366 |
+
|
3367 |
+
$html = ob_get_clean();
|
3368 |
+
|
3369 |
+
$args = array(
|
3370 |
+
'id' => 'use_css',
|
3371 |
+
'title' => __('Use of CSS','woocommerce-products-slider'),
|
3372 |
+
'details' => __('Use following class selector to add custom CSS for this element.','woocommerce-products-slider'),
|
3373 |
+
'type' => 'custom_html',
|
3374 |
+
'html' => $html,
|
3375 |
+
|
3376 |
+
);
|
3377 |
+
|
3378 |
+
$settings_tabs_field->generate_field($args);
|
3379 |
+
|
3380 |
+
?>
|
3381 |
+
|
3382 |
+
</div>
|
3383 |
+
</div>
|
3384 |
+
<?php
|
3385 |
+
|
3386 |
+
}
|
3387 |
+
|
3388 |
+
|
3389 |
+
|
3390 |
+
add_action('wcps_layout_elements_option_dokan_store_phone','wcps_layout_elements_option_dokan_store_phone');
|
3391 |
+
function wcps_layout_elements_option_dokan_store_phone($parameters){
|
3392 |
+
|
3393 |
+
$settings_tabs_field = new settings_tabs_field();
|
3394 |
+
|
3395 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
3396 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
3397 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
3398 |
+
|
3399 |
+
|
3400 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
3401 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
3402 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
3403 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
3404 |
+
$link_to = isset($element_data['link_to']) ? $element_data['link_to'] : '';
|
3405 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
3406 |
+
$wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
|
3407 |
+
|
3408 |
+
$custom_css = isset($element_data['custom_css']) ? $element_data['custom_css'] : '';
|
3409 |
+
$custom_css_hover = isset($element_data['custom_css_hover']) ? $element_data['custom_css_hover'] : '';
|
3410 |
+
|
3411 |
+
|
3412 |
+
|
3413 |
+
?>
|
3414 |
+
<div class="item">
|
3415 |
+
<div class="element-title header ">
|
3416 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
3417 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
3418 |
+
|
3419 |
+
<span class="expand"><?php echo __('Dokan store phone','woocommerce-products-slider'); ?></span>
|
3420 |
+
</div>
|
3421 |
+
<div class="element-options options">
|
3422 |
+
|
3423 |
+
<?php
|
3424 |
+
|
3425 |
+
|
3426 |
+
$args = array(
|
3427 |
+
'id' => 'wrapper_html',
|
3428 |
+
'css_id' => $element_index.'_wrapper_html',
|
3429 |
+
'parent' => $input_name.'[dokan_store_phone]',
|
3430 |
+
'title' => __('Wrapper html','woocommerce-products-slider'),
|
3431 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace sale count output.','woocommerce-products-slider'),
|
3432 |
+
'type' => 'text',
|
3433 |
+
'value' => $wrapper_html,
|
3434 |
+
'default' => '',
|
3435 |
+
'placeholder' => 'Phone: %s',
|
3436 |
+
);
|
3437 |
+
|
3438 |
+
$settings_tabs_field->generate_field($args);
|
3439 |
+
|
3440 |
+
$args = array(
|
3441 |
+
'id' => 'color',
|
3442 |
+
'css_id' => $element_index.'_dokan_store_country',
|
3443 |
+
'parent' => $input_name.'[dokan_store_phone]',
|
3444 |
+
'title' => __('Color','woocommerce-products-slider'),
|
3445 |
+
'details' => __('Title text color.','woocommerce-products-slider'),
|
3446 |
+
'type' => 'colorpicker',
|
3447 |
+
'value' => $color,
|
3448 |
+
'default' => '',
|
3449 |
+
);
|
3450 |
+
|
3451 |
+
$settings_tabs_field->generate_field($args);
|
3452 |
+
|
3453 |
+
$args = array(
|
3454 |
+
'id' => 'font_size',
|
3455 |
+
'css_id' => $element_index.'_font_size',
|
3456 |
+
'parent' => $input_name.'[dokan_store_phone]',
|
3457 |
+
'title' => __('Font size','woocommerce-products-slider'),
|
3458 |
+
'details' => __('Set font size.','woocommerce-products-slider'),
|
3459 |
+
'type' => 'text',
|
3460 |
+
'value' => $font_size,
|
3461 |
+
'default' => '',
|
3462 |
+
'placeholder' => '14px',
|
3463 |
+
);
|
3464 |
+
|
3465 |
+
$settings_tabs_field->generate_field($args);
|
3466 |
+
|
3467 |
+
|
3468 |
+
$args = array(
|
3469 |
+
'id' => 'font_family',
|
3470 |
+
'css_id' => $element_index.'_font_family',
|
3471 |
+
'parent' => $input_name.'[dokan_store_phone]',
|
3472 |
+
'title' => __('Font family','woocommerce-products-slider'),
|
3473 |
+
'details' => __('Set font family.','woocommerce-products-slider'),
|
3474 |
+
'type' => 'text',
|
3475 |
+
'value' => $font_family,
|
3476 |
+
'default' => '',
|
3477 |
+
'placeholder' => 'Open Sans',
|
3478 |
+
);
|
3479 |
+
|
3480 |
+
$settings_tabs_field->generate_field($args);
|
3481 |
+
|
3482 |
+
|
3483 |
+
$args = array(
|
3484 |
+
'id' => 'margin',
|
3485 |
+
'css_id' => $element_index.'_margin',
|
3486 |
+
'parent' => $input_name.'[dokan_store_phone]',
|
3487 |
+
'title' => __('Margin','woocommerce-products-slider'),
|
3488 |
+
'details' => __('Set margin.','woocommerce-products-slider'),
|
3489 |
+
'type' => 'text',
|
3490 |
+
'value' => $margin,
|
3491 |
+
'default' => '',
|
3492 |
+
'placeholder' => '5px 0',
|
3493 |
+
);
|
3494 |
+
|
3495 |
+
$settings_tabs_field->generate_field($args);
|
3496 |
+
|
3497 |
+
|
3498 |
+
$args = array(
|
3499 |
+
'id' => 'text_align',
|
3500 |
+
'css_id' => $element_index.'_text_align',
|
3501 |
+
'parent' => $input_name.'[dokan_store_phone]',
|
3502 |
+
'title' => __('Text align','woocommerce-products-slider'),
|
3503 |
+
'details' => __('Choose text align.','woocommerce-products-slider'),
|
3504 |
+
'type' => 'select',
|
3505 |
+
'value' => $text_align,
|
3506 |
+
'default' => 'left',
|
3507 |
+
'args' => array('left'=> __('Left', 'woocommerce-products-slider'),'right'=> __('Right', 'woocommerce-products-slider'),'center'=> __('Center', 'woocommerce-products-slider') ),
|
3508 |
+
);
|
3509 |
+
|
3510 |
+
$settings_tabs_field->generate_field($args);
|
3511 |
+
|
3512 |
+
|
3513 |
+
ob_start();
|
3514 |
+
?>
|
3515 |
+
<textarea readonly type="text" onclick="this.select();">.element-<?php echo $element_index?>{}</textarea>
|
3516 |
+
<?php
|
3517 |
+
|
3518 |
+
$html = ob_get_clean();
|
3519 |
+
|
3520 |
+
$args = array(
|
3521 |
+
'id' => 'use_css',
|
3522 |
+
'title' => __('Use of CSS','woocommerce-products-slider'),
|
3523 |
+
'details' => __('Use following class selector to add custom CSS for this element.','woocommerce-products-slider'),
|
3524 |
+
'type' => 'custom_html',
|
3525 |
+
'html' => $html,
|
3526 |
+
|
3527 |
+
);
|
3528 |
+
|
3529 |
+
$settings_tabs_field->generate_field($args);
|
3530 |
+
|
3531 |
+
?>
|
3532 |
+
|
3533 |
+
</div>
|
3534 |
+
</div>
|
3535 |
+
<?php
|
3536 |
+
|
3537 |
+
}
|
3538 |
+
|
3539 |
+
|
3540 |
+
|
3541 |
+
add_action('wcps_layout_elements_option_dokan_banner','wcps_layout_elements_option_dokan_banner');
|
3542 |
+
function wcps_layout_elements_option_dokan_banner($parameters){
|
3543 |
+
|
3544 |
+
$settings_tabs_field = new settings_tabs_field();
|
3545 |
+
|
3546 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
3547 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
3548 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
3549 |
+
|
3550 |
+
|
3551 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
3552 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
3553 |
+
$width = isset($element_data['width']) ? $element_data['width'] : '';
|
3554 |
+
$height = isset($element_data['height']) ? $element_data['height'] : '';
|
3555 |
+
|
3556 |
+
$custom_css = isset($element_data['custom_css']) ? $element_data['custom_css'] : '';
|
3557 |
+
$custom_css_hover = isset($element_data['custom_css_hover']) ? $element_data['custom_css_hover'] : '';
|
3558 |
+
|
3559 |
+
|
3560 |
+
|
3561 |
+
?>
|
3562 |
+
<div class="item">
|
3563 |
+
<div class="element-title header ">
|
3564 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
3565 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
3566 |
+
|
3567 |
+
<span class="expand"><?php echo __('Dokan store banner','woocommerce-products-slider'); ?></span>
|
3568 |
+
</div>
|
3569 |
+
<div class="element-options options">
|
3570 |
+
|
3571 |
+
<?php
|
3572 |
+
|
3573 |
+
$args = array(
|
3574 |
+
'id' => 'width',
|
3575 |
+
'css_id' => $element_index.'_width',
|
3576 |
+
'parent' => $input_name.'[dokan_banner]',
|
3577 |
+
'title' => __('Width','woocommerce-products-slider'),
|
3578 |
+
'details' => __('Set banner width. ex: 200px or 45%','woocommerce-products-slider'),
|
3579 |
+
'type' => 'text',
|
3580 |
+
'value' => $width,
|
3581 |
+
'default' => '',
|
3582 |
+
'placeholder' => '',
|
3583 |
+
);
|
3584 |
+
|
3585 |
+
$settings_tabs_field->generate_field($args);
|
3586 |
+
|
3587 |
+
$args = array(
|
3588 |
+
'id' => 'height',
|
3589 |
+
'css_id' => $element_index.'_height',
|
3590 |
+
'parent' => $input_name.'[dokan_banner]',
|
3591 |
+
'title' => __('height','woocommerce-products-slider'),
|
3592 |
+
'details' => __('Set banner height. ex: 200px','woocommerce-products-slider'),
|
3593 |
+
'type' => 'text',
|
3594 |
+
'value' => $height,
|
3595 |
+
'default' => '',
|
3596 |
+
'placeholder' => '',
|
3597 |
+
);
|
3598 |
+
|
3599 |
+
$settings_tabs_field->generate_field($args);
|
3600 |
+
|
3601 |
+
$args = array(
|
3602 |
+
'id' => 'margin',
|
3603 |
+
'css_id' => $element_index.'_margin',
|
3604 |
+
'parent' => $input_name.'[dokan_banner]',
|
3605 |
+
'title' => __('Margin','woocommerce-products-slider'),
|
3606 |
+
'details' => __('Set margin.','woocommerce-products-slider'),
|
3607 |
+
'type' => 'text',
|
3608 |
+
'value' => $margin,
|
3609 |
+
'default' => '',
|
3610 |
+
'placeholder' => '5px 0',
|
3611 |
+
);
|
3612 |
+
|
3613 |
+
$settings_tabs_field->generate_field($args);
|
3614 |
+
|
3615 |
+
|
3616 |
+
$args = array(
|
3617 |
+
'id' => 'text_align',
|
3618 |
+
'css_id' => $element_index.'_text_align',
|
3619 |
+
'parent' => $input_name.'[dokan_banner]',
|
3620 |
+
'title' => __('Text align','woocommerce-products-slider'),
|
3621 |
+
'details' => __('Choose text align.','woocommerce-products-slider'),
|
3622 |
+
'type' => 'select',
|
3623 |
+
'value' => $text_align,
|
3624 |
+
'default' => 'left',
|
3625 |
+
'args' => array('left'=> __('Left', 'woocommerce-products-slider'),'right'=> __('Right', 'woocommerce-products-slider'),'center'=> __('Center', 'woocommerce-products-slider') ),
|
3626 |
+
);
|
3627 |
+
|
3628 |
+
$settings_tabs_field->generate_field($args);
|
3629 |
+
|
3630 |
+
|
3631 |
+
ob_start();
|
3632 |
+
?>
|
3633 |
+
<textarea readonly type="text" onclick="this.select();">.element-<?php echo $element_index?>{}</textarea>
|
3634 |
+
<?php
|
3635 |
+
|
3636 |
+
$html = ob_get_clean();
|
3637 |
+
|
3638 |
+
$args = array(
|
3639 |
+
'id' => 'use_css',
|
3640 |
+
'title' => __('Use of CSS','woocommerce-products-slider'),
|
3641 |
+
'details' => __('Use following class selector to add custom CSS for this element.','woocommerce-products-slider'),
|
3642 |
+
'type' => 'custom_html',
|
3643 |
+
'html' => $html,
|
3644 |
+
|
3645 |
+
);
|
3646 |
+
|
3647 |
+
$settings_tabs_field->generate_field($args);
|
3648 |
+
|
3649 |
+
?>
|
3650 |
+
|
3651 |
+
</div>
|
3652 |
+
</div>
|
3653 |
+
<?php
|
3654 |
+
|
3655 |
+
}
|
3656 |
+
|
3657 |
+
|
3658 |
+
|
3659 |
+
|
3660 |
+
add_action('wcps_layout_elements_option_dokan_avatar','wcps_layout_elements_option_dokan_avatar');
|
3661 |
+
function wcps_layout_elements_option_dokan_avatar($parameters){
|
3662 |
+
|
3663 |
+
$settings_tabs_field = new settings_tabs_field();
|
3664 |
+
|
3665 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
3666 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
3667 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
3668 |
+
|
3669 |
+
|
3670 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
3671 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
3672 |
+
$width = isset($element_data['width']) ? $element_data['width'] : '';
|
3673 |
+
|
3674 |
+
$custom_css = isset($element_data['custom_css']) ? $element_data['custom_css'] : '';
|
3675 |
+
$custom_css_hover = isset($element_data['custom_css_hover']) ? $element_data['custom_css_hover'] : '';
|
3676 |
+
|
3677 |
+
|
3678 |
+
|
3679 |
+
?>
|
3680 |
+
<div class="item">
|
3681 |
+
<div class="element-title header ">
|
3682 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
3683 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
3684 |
+
|
3685 |
+
<span class="expand"><?php echo __('Dokan store avatar','woocommerce-products-slider'); ?></span>
|
3686 |
+
</div>
|
3687 |
+
<div class="element-options options">
|
3688 |
+
|
3689 |
+
<?php
|
3690 |
+
|
3691 |
+
|
3692 |
+
$args = array(
|
3693 |
+
'id' => 'width',
|
3694 |
+
'css_id' => $element_index.'_font_size',
|
3695 |
+
'parent' => $input_name.'[dokan_avatar]',
|
3696 |
+
'title' => __('Width','woocommerce-products-slider'),
|
3697 |
+
'details' => __('Set avatar width. ex: 200px or 50%','woocommerce-products-slider'),
|
3698 |
+
'type' => 'text',
|
3699 |
+
'value' => $width,
|
3700 |
+
'default' => '',
|
3701 |
+
'placeholder' => '200px',
|
3702 |
+
);
|
3703 |
+
|
3704 |
+
$settings_tabs_field->generate_field($args);
|
3705 |
+
|
3706 |
+
|
3707 |
+
$args = array(
|
3708 |
+
'id' => 'margin',
|
3709 |
+
'css_id' => $element_index.'_margin',
|
3710 |
+
'parent' => $input_name.'[dokan_avatar]',
|
3711 |
+
'title' => __('Margin','woocommerce-products-slider'),
|
3712 |
+
'details' => __('Set margin.','woocommerce-products-slider'),
|
3713 |
+
'type' => 'text',
|
3714 |
+
'value' => $margin,
|
3715 |
+
'default' => '',
|
3716 |
+
'placeholder' => '5px 0',
|
3717 |
+
);
|
3718 |
+
|
3719 |
+
$settings_tabs_field->generate_field($args);
|
3720 |
+
|
3721 |
+
|
3722 |
+
$args = array(
|
3723 |
+
'id' => 'text_align',
|
3724 |
+
'css_id' => $element_index.'_text_align',
|
3725 |
+
'parent' => $input_name.'[dokan_avatar]',
|
3726 |
+
'title' => __('Text align','woocommerce-products-slider'),
|
3727 |
+
'details' => __('Choose text align.','woocommerce-products-slider'),
|
3728 |
+
'type' => 'select',
|
3729 |
+
'value' => $text_align,
|
3730 |
+
'default' => 'left',
|
3731 |
+
'args' => array('left'=> __('Left', 'woocommerce-products-slider'),'right'=> __('Right', 'woocommerce-products-slider'),'center'=> __('Center', 'woocommerce-products-slider') ),
|
3732 |
+
);
|
3733 |
+
|
3734 |
+
$settings_tabs_field->generate_field($args);
|
3735 |
+
|
3736 |
+
|
3737 |
+
ob_start();
|
3738 |
+
?>
|
3739 |
+
<textarea readonly type="text" onclick="this.select();">.element-<?php echo $element_index?>{}</textarea>
|
3740 |
+
<?php
|
3741 |
+
|
3742 |
+
$html = ob_get_clean();
|
3743 |
+
|
3744 |
+
$args = array(
|
3745 |
+
'id' => 'use_css',
|
3746 |
+
'title' => __('Use of CSS','woocommerce-products-slider'),
|
3747 |
+
'details' => __('Use following class selector to add custom CSS for this element.','woocommerce-products-slider'),
|
3748 |
+
'type' => 'custom_html',
|
3749 |
+
'html' => $html,
|
3750 |
+
|
3751 |
+
);
|
3752 |
+
|
3753 |
+
$settings_tabs_field->generate_field($args);
|
3754 |
+
|
3755 |
+
?>
|
3756 |
+
|
3757 |
+
</div>
|
3758 |
+
</div>
|
3759 |
+
<?php
|
3760 |
+
|
3761 |
+
}
|
3762 |
+
|
3763 |
+
|
3764 |
+
|
3765 |
+
add_action('wcps_layout_elements_option_order_title','wcps_layout_elements_option_order_title');
|
3766 |
+
function wcps_layout_elements_option_order_title($parameters){
|
3767 |
+
|
3768 |
+
$settings_tabs_field = new settings_tabs_field();
|
3769 |
+
|
3770 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
3771 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
3772 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
3773 |
+
|
3774 |
+
|
3775 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
3776 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
3777 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
3778 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
3779 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
3780 |
+
$wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
|
3781 |
+
|
3782 |
+
$custom_css = isset($element_data['custom_css']) ? $element_data['custom_css'] : '';
|
3783 |
+
$custom_css_hover = isset($element_data['custom_css_hover']) ? $element_data['custom_css_hover'] : '';
|
3784 |
+
|
3785 |
+
|
3786 |
+
|
3787 |
+
?>
|
3788 |
+
<div class="item">
|
3789 |
+
<div class="element-title header ">
|
3790 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
3791 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
3792 |
+
|
3793 |
+
<span class="expand"><?php echo __('Order title','woocommerce-products-slider'); ?></span>
|
3794 |
+
</div>
|
3795 |
+
<div class="element-options options">
|
3796 |
+
|
3797 |
+
<?php
|
3798 |
+
|
3799 |
+
|
3800 |
+
$args = array(
|
3801 |
+
'id' => 'wrapper_html',
|
3802 |
+
'css_id' => $element_index.'_wrapper_html',
|
3803 |
+
'parent' => $input_name.'[order_title]',
|
3804 |
+
'title' => __('Wrapper html','woocommerce-products-slider'),
|
3805 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace sale count output.','woocommerce-products-slider'),
|
3806 |
+
'type' => 'text',
|
3807 |
+
'value' => $wrapper_html,
|
3808 |
+
'default' => '',
|
3809 |
+
'placeholder' => 'Phone: %s',
|
3810 |
+
);
|
3811 |
+
|
3812 |
+
$settings_tabs_field->generate_field($args);
|
3813 |
+
|
3814 |
+
$args = array(
|
3815 |
+
'id' => 'color',
|
3816 |
+
'css_id' => $element_index.'_order_title',
|
3817 |
+
'parent' => $input_name.'[order_title]',
|
3818 |
+
'title' => __('Color','woocommerce-products-slider'),
|
3819 |
+
'details' => __('Title text color.','woocommerce-products-slider'),
|
3820 |
+
'type' => 'colorpicker',
|
3821 |
+
'value' => $color,
|
3822 |
+
'default' => '',
|
3823 |
+
);
|
3824 |
+
|
3825 |
+
$settings_tabs_field->generate_field($args);
|
3826 |
+
|
3827 |
+
$args = array(
|
3828 |
+
'id' => 'font_size',
|
3829 |
+
'css_id' => $element_index.'_font_size',
|
3830 |
+
'parent' => $input_name.'[order_title]',
|
3831 |
+
'title' => __('Font size','woocommerce-products-slider'),
|
3832 |
+
'details' => __('Set font size.','woocommerce-products-slider'),
|
3833 |
+
'type' => 'text',
|
3834 |
+
'value' => $font_size,
|
3835 |
+
'default' => '',
|
3836 |
+
'placeholder' => '14px',
|
3837 |
+
);
|
3838 |
+
|
3839 |
+
$settings_tabs_field->generate_field($args);
|
3840 |
+
|
3841 |
+
|
3842 |
+
$args = array(
|
3843 |
+
'id' => 'font_family',
|
3844 |
+
'css_id' => $element_index.'_font_family',
|
3845 |
+
'parent' => $input_name.'[order_title]',
|
3846 |
+
'title' => __('Font family','woocommerce-products-slider'),
|
3847 |
+
'details' => __('Set font family.','woocommerce-products-slider'),
|
3848 |
+
'type' => 'text',
|
3849 |
+
'value' => $font_family,
|
3850 |
+
'default' => '',
|
3851 |
+
'placeholder' => 'Open Sans',
|
3852 |
+
);
|
3853 |
+
|
3854 |
+
$settings_tabs_field->generate_field($args);
|
3855 |
+
|
3856 |
+
|
3857 |
+
$args = array(
|
3858 |
+
'id' => 'margin',
|
3859 |
+
'css_id' => $element_index.'_margin',
|
3860 |
+
'parent' => $input_name.'[order_title]',
|
3861 |
+
'title' => __('Margin','woocommerce-products-slider'),
|
3862 |
+
'details' => __('Set margin.','woocommerce-products-slider'),
|
3863 |
+
'type' => 'text',
|
3864 |
+
'value' => $margin,
|
3865 |
+
'default' => '',
|
3866 |
+
'placeholder' => '5px 0',
|
3867 |
+
);
|
3868 |
+
|
3869 |
+
$settings_tabs_field->generate_field($args);
|
3870 |
+
|
3871 |
+
|
3872 |
+
$args = array(
|
3873 |
+
'id' => 'text_align',
|
3874 |
+
'css_id' => $element_index.'_text_align',
|
3875 |
+
'parent' => $input_name.'[order_title]',
|
3876 |
+
'title' => __('Text align','woocommerce-products-slider'),
|
3877 |
+
'details' => __('Choose text align.','woocommerce-products-slider'),
|
3878 |
+
'type' => 'select',
|
3879 |
+
'value' => $text_align,
|
3880 |
+
'default' => 'left',
|
3881 |
+
'args' => array('left'=> __('Left', 'woocommerce-products-slider'),'right'=> __('Right', 'woocommerce-products-slider'),'center'=> __('Center', 'woocommerce-products-slider') ),
|
3882 |
+
);
|
3883 |
+
|
3884 |
+
$settings_tabs_field->generate_field($args);
|
3885 |
+
|
3886 |
+
|
3887 |
+
ob_start();
|
3888 |
+
?>
|
3889 |
+
<textarea readonly type="text" onclick="this.select();">.element-<?php echo $element_index?>{}</textarea>
|
3890 |
+
<?php
|
3891 |
+
|
3892 |
+
$html = ob_get_clean();
|
3893 |
+
|
3894 |
+
$args = array(
|
3895 |
+
'id' => 'use_css',
|
3896 |
+
'title' => __('Use of CSS','woocommerce-products-slider'),
|
3897 |
+
'details' => __('Use following class selector to add custom CSS for this element.','woocommerce-products-slider'),
|
3898 |
+
'type' => 'custom_html',
|
3899 |
+
'html' => $html,
|
3900 |
+
|
3901 |
+
);
|
3902 |
+
|
3903 |
+
$settings_tabs_field->generate_field($args);
|
3904 |
+
|
3905 |
+
?>
|
3906 |
+
|
3907 |
+
</div>
|
3908 |
+
</div>
|
3909 |
+
<?php
|
3910 |
+
|
3911 |
+
}
|
3912 |
+
|
3913 |
+
|
3914 |
+
|
3915 |
+
add_action('wcps_layout_elements_option_order_date','wcps_layout_elements_option_order_date');
|
3916 |
+
function wcps_layout_elements_option_order_date($parameters){
|
3917 |
+
|
3918 |
+
$settings_tabs_field = new settings_tabs_field();
|
3919 |
+
|
3920 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
3921 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
3922 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
3923 |
+
|
3924 |
+
|
3925 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
3926 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
3927 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
3928 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
3929 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
3930 |
+
$wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
|
3931 |
+
|
3932 |
+
$custom_css = isset($element_data['custom_css']) ? $element_data['custom_css'] : '';
|
3933 |
+
$custom_css_hover = isset($element_data['custom_css_hover']) ? $element_data['custom_css_hover'] : '';
|
3934 |
+
|
3935 |
+
|
3936 |
+
|
3937 |
+
?>
|
3938 |
+
<div class="item">
|
3939 |
+
<div class="element-title header ">
|
3940 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
3941 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
3942 |
+
|
3943 |
+
<span class="expand"><?php echo __('Order date','woocommerce-products-slider'); ?></span>
|
3944 |
+
</div>
|
3945 |
+
<div class="element-options options">
|
3946 |
+
|
3947 |
+
<?php
|
3948 |
+
|
3949 |
+
|
3950 |
+
$args = array(
|
3951 |
+
'id' => 'wrapper_html',
|
3952 |
+
'css_id' => $element_index.'_wrapper_html',
|
3953 |
+
'parent' => $input_name.'[order_date]',
|
3954 |
+
'title' => __('Wrapper html','woocommerce-products-slider'),
|
3955 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace sale count output.','woocommerce-products-slider'),
|
3956 |
+
'type' => 'text',
|
3957 |
+
'value' => $wrapper_html,
|
3958 |
+
'default' => '',
|
3959 |
+
'placeholder' => 'Phone: %s',
|
3960 |
+
);
|
3961 |
+
|
3962 |
+
$settings_tabs_field->generate_field($args);
|
3963 |
+
|
3964 |
+
$args = array(
|
3965 |
+
'id' => 'color',
|
3966 |
+
'css_id' => $element_index.'_order_date',
|
3967 |
+
'parent' => $input_name.'[order_date]',
|
3968 |
+
'title' => __('Color','woocommerce-products-slider'),
|
3969 |
+
'details' => __('Title text color.','woocommerce-products-slider'),
|
3970 |
+
'type' => 'colorpicker',
|
3971 |
+
'value' => $color,
|
3972 |
+
'default' => '',
|
3973 |
+
);
|
3974 |
+
|
3975 |
+
$settings_tabs_field->generate_field($args);
|
3976 |
+
|
3977 |
+
$args = array(
|
3978 |
+
'id' => 'font_size',
|
3979 |
+
'css_id' => $element_index.'_font_size',
|
3980 |
+
'parent' => $input_name.'[order_date]',
|
3981 |
+
'title' => __('Font size','woocommerce-products-slider'),
|
3982 |
+
'details' => __('Set font size.','woocommerce-products-slider'),
|
3983 |
+
'type' => 'text',
|
3984 |
+
'value' => $font_size,
|
3985 |
+
'default' => '',
|
3986 |
+
'placeholder' => '14px',
|
3987 |
+
);
|
3988 |
+
|
3989 |
+
$settings_tabs_field->generate_field($args);
|
3990 |
+
|
3991 |
+
|
3992 |
+
$args = array(
|
3993 |
+
'id' => 'font_family',
|
3994 |
+
'css_id' => $element_index.'_font_family',
|
3995 |
+
'parent' => $input_name.'[order_date]',
|
3996 |
+
'title' => __('Font family','woocommerce-products-slider'),
|
3997 |
+
'details' => __('Set font family.','woocommerce-products-slider'),
|
3998 |
+
'type' => 'text',
|
3999 |
+
'value' => $font_family,
|
4000 |
+
'default' => '',
|
4001 |
+
'placeholder' => 'Open Sans',
|
4002 |
+
);
|
4003 |
+
|
4004 |
+
$settings_tabs_field->generate_field($args);
|
4005 |
+
|
4006 |
+
|
4007 |
+
$args = array(
|
4008 |
+
'id' => 'margin',
|
4009 |
+
'css_id' => $element_index.'_margin',
|
4010 |
+
'parent' => $input_name.'[order_date]',
|
4011 |
+
'title' => __('Margin','woocommerce-products-slider'),
|
4012 |
+
'details' => __('Set margin.','woocommerce-products-slider'),
|
4013 |
+
'type' => 'text',
|
4014 |
+
'value' => $margin,
|
4015 |
+
'default' => '',
|
4016 |
+
'placeholder' => '5px 0',
|
4017 |
+
);
|
4018 |
+
|
4019 |
+
$settings_tabs_field->generate_field($args);
|
4020 |
+
|
4021 |
+
|
4022 |
+
$args = array(
|
4023 |
+
'id' => 'text_align',
|
4024 |
+
'css_id' => $element_index.'_text_align',
|
4025 |
+
'parent' => $input_name.'[order_date]',
|
4026 |
+
'title' => __('Text align','woocommerce-products-slider'),
|
4027 |
+
'details' => __('Choose text align.','woocommerce-products-slider'),
|
4028 |
+
'type' => 'select',
|
4029 |
+
'value' => $text_align,
|
4030 |
+
'default' => 'left',
|
4031 |
+
'args' => array('left'=> __('Left', 'woocommerce-products-slider'),'right'=> __('Right', 'woocommerce-products-slider'),'center'=> __('Center', 'woocommerce-products-slider') ),
|
4032 |
+
);
|
4033 |
+
|
4034 |
+
$settings_tabs_field->generate_field($args);
|
4035 |
+
|
4036 |
+
|
4037 |
+
ob_start();
|
4038 |
+
?>
|
4039 |
+
<textarea readonly type="text" onclick="this.select();">.element-<?php echo $element_index?>{}</textarea>
|
4040 |
+
<?php
|
4041 |
+
|
4042 |
+
$html = ob_get_clean();
|
4043 |
+
|
4044 |
+
$args = array(
|
4045 |
+
'id' => 'use_css',
|
4046 |
+
'title' => __('Use of CSS','woocommerce-products-slider'),
|
4047 |
+
'details' => __('Use following class selector to add custom CSS for this element.','woocommerce-products-slider'),
|
4048 |
+
'type' => 'custom_html',
|
4049 |
+
'html' => $html,
|
4050 |
+
|
4051 |
+
);
|
4052 |
+
|
4053 |
+
$settings_tabs_field->generate_field($args);
|
4054 |
+
|
4055 |
+
?>
|
4056 |
+
|
4057 |
+
</div>
|
4058 |
+
</div>
|
4059 |
+
<?php
|
4060 |
+
|
4061 |
+
}
|
4062 |
+
|
4063 |
+
|
4064 |
+
add_action('wcps_layout_elements_option_order_customer_name','wcps_layout_elements_option_order_customer_name');
|
4065 |
+
function wcps_layout_elements_option_order_customer_name($parameters){
|
4066 |
+
|
4067 |
+
$settings_tabs_field = new settings_tabs_field();
|
4068 |
+
|
4069 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
4070 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
4071 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
4072 |
+
|
4073 |
+
|
4074 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
4075 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
4076 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
4077 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
4078 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
4079 |
+
$wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
|
4080 |
+
|
4081 |
+
$custom_css = isset($element_data['custom_css']) ? $element_data['custom_css'] : '';
|
4082 |
+
$custom_css_hover = isset($element_data['custom_css_hover']) ? $element_data['custom_css_hover'] : '';
|
4083 |
+
|
4084 |
+
|
4085 |
+
|
4086 |
+
?>
|
4087 |
+
<div class="item">
|
4088 |
+
<div class="element-title header ">
|
4089 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
4090 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
4091 |
+
|
4092 |
+
<span class="expand"><?php echo __('Customer name','woocommerce-products-slider'); ?></span>
|
4093 |
+
</div>
|
4094 |
+
<div class="element-options options">
|
4095 |
+
|
4096 |
+
<?php
|
4097 |
+
|
4098 |
+
|
4099 |
+
$args = array(
|
4100 |
+
'id' => 'wrapper_html',
|
4101 |
+
'css_id' => $element_index.'_wrapper_html',
|
4102 |
+
'parent' => $input_name.'[order_customer_name]',
|
4103 |
+
'title' => __('Wrapper html','woocommerce-products-slider'),
|
4104 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace sale count output.','woocommerce-products-slider'),
|
4105 |
+
'type' => 'text',
|
4106 |
+
'value' => $wrapper_html,
|
4107 |
+
'default' => '',
|
4108 |
+
'placeholder' => 'Phone: %s',
|
4109 |
+
);
|
4110 |
+
|
4111 |
+
$settings_tabs_field->generate_field($args);
|
4112 |
+
|
4113 |
+
$args = array(
|
4114 |
+
'id' => 'color',
|
4115 |
+
'css_id' => $element_index.'_order_customer_name',
|
4116 |
+
'parent' => $input_name.'[order_customer_name]',
|
4117 |
+
'title' => __('Color','woocommerce-products-slider'),
|
4118 |
+
'details' => __('Title text color.','woocommerce-products-slider'),
|
4119 |
+
'type' => 'colorpicker',
|
4120 |
+
'value' => $color,
|
4121 |
+
'default' => '',
|
4122 |
+
);
|
4123 |
+
|
4124 |
+
$settings_tabs_field->generate_field($args);
|
4125 |
+
|
4126 |
+
$args = array(
|
4127 |
+
'id' => 'font_size',
|
4128 |
+
'css_id' => $element_index.'_font_size',
|
4129 |
+
'parent' => $input_name.'[order_customer_name]',
|
4130 |
+
'title' => __('Font size','woocommerce-products-slider'),
|
4131 |
+
'details' => __('Set font size.','woocommerce-products-slider'),
|
4132 |
+
'type' => 'text',
|
4133 |
+
'value' => $font_size,
|
4134 |
+
'default' => '',
|
4135 |
+
'placeholder' => '14px',
|
4136 |
+
);
|
4137 |
+
|
4138 |
+
$settings_tabs_field->generate_field($args);
|
4139 |
+
|
4140 |
+
|
4141 |
+
$args = array(
|
4142 |
+
'id' => 'font_family',
|
4143 |
+
'css_id' => $element_index.'_font_family',
|
4144 |
+
'parent' => $input_name.'[order_customer_name]',
|
4145 |
+
'title' => __('Font family','woocommerce-products-slider'),
|
4146 |
+
'details' => __('Set font family.','woocommerce-products-slider'),
|
4147 |
+
'type' => 'text',
|
4148 |
+
'value' => $font_family,
|
4149 |
+
'default' => '',
|
4150 |
+
'placeholder' => 'Open Sans',
|
4151 |
+
);
|
4152 |
+
|
4153 |
+
$settings_tabs_field->generate_field($args);
|
4154 |
+
|
4155 |
+
|
4156 |
+
$args = array(
|
4157 |
+
'id' => 'margin',
|
4158 |
+
'css_id' => $element_index.'_margin',
|
4159 |
+
'parent' => $input_name.'[order_customer_name]',
|
4160 |
+
'title' => __('Margin','woocommerce-products-slider'),
|
4161 |
+
'details' => __('Set margin.','woocommerce-products-slider'),
|
4162 |
+
'type' => 'text',
|
4163 |
+
'value' => $margin,
|
4164 |
+
'default' => '',
|
4165 |
+
'placeholder' => '5px 0',
|
4166 |
+
);
|
4167 |
+
|
4168 |
+
$settings_tabs_field->generate_field($args);
|
4169 |
+
|
4170 |
+
|
4171 |
+
$args = array(
|
4172 |
+
'id' => 'text_align',
|
4173 |
+
'css_id' => $element_index.'_text_align',
|
4174 |
+
'parent' => $input_name.'[order_customer_name]',
|
4175 |
+
'title' => __('Text align','woocommerce-products-slider'),
|
4176 |
+
'details' => __('Choose text align.','woocommerce-products-slider'),
|
4177 |
+
'type' => 'select',
|
4178 |
+
'value' => $text_align,
|
4179 |
+
'default' => 'left',
|
4180 |
+
'args' => array('left'=> __('Left', 'woocommerce-products-slider'),'right'=> __('Right', 'woocommerce-products-slider'),'center'=> __('Center', 'woocommerce-products-slider') ),
|
4181 |
+
);
|
4182 |
+
|
4183 |
+
$settings_tabs_field->generate_field($args);
|
4184 |
+
|
4185 |
+
|
4186 |
+
ob_start();
|
4187 |
+
?>
|
4188 |
+
<textarea readonly type="text" onclick="this.select();">.element-<?php echo $element_index?>{}</textarea>
|
4189 |
+
<?php
|
4190 |
+
|
4191 |
+
$html = ob_get_clean();
|
4192 |
+
|
4193 |
+
$args = array(
|
4194 |
+
'id' => 'use_css',
|
4195 |
+
'title' => __('Use of CSS','woocommerce-products-slider'),
|
4196 |
+
'details' => __('Use following class selector to add custom CSS for this element.','woocommerce-products-slider'),
|
4197 |
+
'type' => 'custom_html',
|
4198 |
+
'html' => $html,
|
4199 |
+
|
4200 |
+
);
|
4201 |
+
|
4202 |
+
$settings_tabs_field->generate_field($args);
|
4203 |
+
|
4204 |
+
?>
|
4205 |
+
|
4206 |
+
</div>
|
4207 |
+
</div>
|
4208 |
+
<?php
|
4209 |
+
|
4210 |
+
}
|
4211 |
+
|
4212 |
+
|
4213 |
+
add_action('wcps_layout_elements_option_order_customer_thumb','wcps_layout_elements_option_order_customer_thumb');
|
4214 |
+
function wcps_layout_elements_option_order_customer_thumb($parameters){
|
4215 |
+
|
4216 |
+
$settings_tabs_field = new settings_tabs_field();
|
4217 |
+
|
4218 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
4219 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
4220 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
4221 |
+
|
4222 |
+
$width = isset($element_data['width']) ? $element_data['width'] : '';
|
4223 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
4224 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
4225 |
+
$wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
|
4226 |
+
|
4227 |
+
$custom_css = isset($element_data['custom_css']) ? $element_data['custom_css'] : '';
|
4228 |
+
$custom_css_hover = isset($element_data['custom_css_hover']) ? $element_data['custom_css_hover'] : '';
|
4229 |
+
|
4230 |
+
|
4231 |
+
|
4232 |
+
?>
|
4233 |
+
<div class="item">
|
4234 |
+
<div class="element-title header ">
|
4235 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
4236 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
4237 |
+
|
4238 |
+
<span class="expand"><?php echo __('Customer thumbnail','woocommerce-products-slider'); ?></span>
|
4239 |
+
</div>
|
4240 |
+
<div class="element-options options">
|
4241 |
+
|
4242 |
+
<?php
|
4243 |
+
|
4244 |
+
$args = array(
|
4245 |
+
'id' => 'width',
|
4246 |
+
'css_id' => $element_index.'_width',
|
4247 |
+
'parent' => $input_name.'[order_customer_thumb]',
|
4248 |
+
'title' => __('width','woocommerce-products-slider'),
|
4249 |
+
'details' => __('Set width.','woocommerce-products-slider'),
|
4250 |
+
'type' => 'text',
|
4251 |
+
'value' => $width,
|
4252 |
+
'default' => '',
|
4253 |
+
'placeholder' => '200px',
|
4254 |
+
);
|
4255 |
+
|
4256 |
+
$settings_tabs_field->generate_field($args);
|
4257 |
+
|
4258 |
+
$args = array(
|
4259 |
+
'id' => 'margin',
|
4260 |
+
'css_id' => $element_index.'_margin',
|
4261 |
+
'parent' => $input_name.'[order_customer_thumb]',
|
4262 |
+
'title' => __('Margin','woocommerce-products-slider'),
|
4263 |
+
'details' => __('Set margin.','woocommerce-products-slider'),
|
4264 |
+
'type' => 'text',
|
4265 |
+
'value' => $margin,
|
4266 |
+
'default' => '',
|
4267 |
+
'placeholder' => '5px 0',
|
4268 |
+
);
|
4269 |
+
|
4270 |
+
$settings_tabs_field->generate_field($args);
|
4271 |
+
|
4272 |
+
|
4273 |
+
$args = array(
|
4274 |
+
'id' => 'text_align',
|
4275 |
+
'css_id' => $element_index.'_text_align',
|
4276 |
+
'parent' => $input_name.'[order_customer_thumb]',
|
4277 |
+
'title' => __('Text align','woocommerce-products-slider'),
|
4278 |
+
'details' => __('Choose text align.','woocommerce-products-slider'),
|
4279 |
+
'type' => 'select',
|
4280 |
+
'value' => $text_align,
|
4281 |
+
'default' => 'left',
|
4282 |
+
'args' => array('left'=> __('Left', 'woocommerce-products-slider'),'right'=> __('Right', 'woocommerce-products-slider'),'center'=> __('Center', 'woocommerce-products-slider') ),
|
4283 |
+
);
|
4284 |
+
|
4285 |
+
$settings_tabs_field->generate_field($args);
|
4286 |
+
|
4287 |
+
|
4288 |
+
ob_start();
|
4289 |
+
?>
|
4290 |
+
<textarea readonly type="text" onclick="this.select();">.element-<?php echo $element_index?>{}</textarea>
|
4291 |
+
<?php
|
4292 |
+
|
4293 |
+
$html = ob_get_clean();
|
4294 |
+
|
4295 |
+
$args = array(
|
4296 |
+
'id' => 'use_css',
|
4297 |
+
'title' => __('Use of CSS','woocommerce-products-slider'),
|
4298 |
+
'details' => __('Use following class selector to add custom CSS for this element.','woocommerce-products-slider'),
|
4299 |
+
'type' => 'custom_html',
|
4300 |
+
'html' => $html,
|
4301 |
+
|
4302 |
+
);
|
4303 |
+
|
4304 |
+
$settings_tabs_field->generate_field($args);
|
4305 |
+
|
4306 |
+
?>
|
4307 |
+
|
4308 |
+
</div>
|
4309 |
+
</div>
|
4310 |
+
<?php
|
4311 |
+
|
4312 |
+
}
|
4313 |
+
|
4314 |
+
|
4315 |
+
|
4316 |
+
add_action('wcps_layout_elements_option_order_country','wcps_layout_elements_option_order_country');
|
4317 |
+
function wcps_layout_elements_option_order_country($parameters){
|
4318 |
+
|
4319 |
+
$settings_tabs_field = new settings_tabs_field();
|
4320 |
+
|
4321 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
4322 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
4323 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
4324 |
+
|
4325 |
+
|
4326 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
4327 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
4328 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
4329 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
4330 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
4331 |
+
$wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
|
4332 |
+
|
4333 |
+
$custom_css = isset($element_data['custom_css']) ? $element_data['custom_css'] : '';
|
4334 |
+
$custom_css_hover = isset($element_data['custom_css_hover']) ? $element_data['custom_css_hover'] : '';
|
4335 |
+
|
4336 |
+
|
4337 |
+
|
4338 |
+
?>
|
4339 |
+
<div class="item">
|
4340 |
+
<div class="element-title header ">
|
4341 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
4342 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
4343 |
+
|
4344 |
+
<span class="expand"><?php echo __('Customer country','woocommerce-products-slider'); ?></span>
|
4345 |
+
</div>
|
4346 |
+
<div class="element-options options">
|
4347 |
+
|
4348 |
+
<?php
|
4349 |
+
|
4350 |
+
|
4351 |
+
$args = array(
|
4352 |
+
'id' => 'wrapper_html',
|
4353 |
+
'css_id' => $element_index.'_wrapper_html',
|
4354 |
+
'parent' => $input_name.'[order_country]',
|
4355 |
+
'title' => __('Wrapper html','woocommerce-products-slider'),
|
4356 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace sale count output.','woocommerce-products-slider'),
|
4357 |
+
'type' => 'text',
|
4358 |
+
'value' => $wrapper_html,
|
4359 |
+
'default' => '',
|
4360 |
+
'placeholder' => 'Phone: %s',
|
4361 |
+
);
|
4362 |
+
|
4363 |
+
$settings_tabs_field->generate_field($args);
|
4364 |
+
|
4365 |
+
$args = array(
|
4366 |
+
'id' => 'color',
|
4367 |
+
'css_id' => $element_index.'_order_country',
|
4368 |
+
'parent' => $input_name.'[order_country]',
|
4369 |
+
'title' => __('Color','woocommerce-products-slider'),
|
4370 |
+
'details' => __('Title text color.','woocommerce-products-slider'),
|
4371 |
+
'type' => 'colorpicker',
|
4372 |
+
'value' => $color,
|
4373 |
+
'default' => '',
|
4374 |
+
);
|
4375 |
+
|
4376 |
+
$settings_tabs_field->generate_field($args);
|
4377 |
+
|
4378 |
+
$args = array(
|
4379 |
+
'id' => 'font_size',
|
4380 |
+
'css_id' => $element_index.'_font_size',
|
4381 |
+
'parent' => $input_name.'[order_country]',
|
4382 |
+
'title' => __('Font size','woocommerce-products-slider'),
|
4383 |
+
'details' => __('Set font size.','woocommerce-products-slider'),
|
4384 |
+
'type' => 'text',
|
4385 |
+
'value' => $font_size,
|
4386 |
+
'default' => '',
|
4387 |
+
'placeholder' => '14px',
|
4388 |
+
);
|
4389 |
+
|
4390 |
+
$settings_tabs_field->generate_field($args);
|
4391 |
+
|
4392 |
+
|
4393 |
+
$args = array(
|
4394 |
+
'id' => 'font_family',
|
4395 |
+
'css_id' => $element_index.'_font_family',
|
4396 |
+
'parent' => $input_name.'[order_country]',
|
4397 |
+
'title' => __('Font family','woocommerce-products-slider'),
|
4398 |
+
'details' => __('Set font family.','woocommerce-products-slider'),
|
4399 |
+
'type' => 'text',
|
4400 |
+
'value' => $font_family,
|
4401 |
+
'default' => '',
|
4402 |
+
'placeholder' => 'Open Sans',
|
4403 |
+
);
|
4404 |
+
|
4405 |
+
$settings_tabs_field->generate_field($args);
|
4406 |
+
|
4407 |
+
|
4408 |
+
$args = array(
|
4409 |
+
'id' => 'margin',
|
4410 |
+
'css_id' => $element_index.'_margin',
|
4411 |
+
'parent' => $input_name.'[order_country]',
|
4412 |
+
'title' => __('Margin','woocommerce-products-slider'),
|
4413 |
+
'details' => __('Set margin.','woocommerce-products-slider'),
|
4414 |
+
'type' => 'text',
|
4415 |
+
'value' => $margin,
|
4416 |
+
'default' => '',
|
4417 |
+
'placeholder' => '5px 0',
|
4418 |
+
);
|
4419 |
+
|
4420 |
+
$settings_tabs_field->generate_field($args);
|
4421 |
+
|
4422 |
+
|
4423 |
+
$args = array(
|
4424 |
+
'id' => 'text_align',
|
4425 |
+
'css_id' => $element_index.'_text_align',
|
4426 |
+
'parent' => $input_name.'[order_country]',
|
4427 |
+
'title' => __('Text align','woocommerce-products-slider'),
|
4428 |
+
'details' => __('Choose text align.','woocommerce-products-slider'),
|
4429 |
+
'type' => 'select',
|
4430 |
+
'value' => $text_align,
|
4431 |
+
'default' => 'left',
|
4432 |
+
'args' => array('left'=> __('Left', 'woocommerce-products-slider'),'right'=> __('Right', 'woocommerce-products-slider'),'center'=> __('Center', 'woocommerce-products-slider') ),
|
4433 |
+
);
|
4434 |
+
|
4435 |
+
$settings_tabs_field->generate_field($args);
|
4436 |
+
|
4437 |
+
|
4438 |
+
ob_start();
|
4439 |
+
?>
|
4440 |
+
<textarea readonly type="text" onclick="this.select();">.element-<?php echo $element_index?>{}</textarea>
|
4441 |
+
<?php
|
4442 |
+
|
4443 |
+
$html = ob_get_clean();
|
4444 |
+
|
4445 |
+
$args = array(
|
4446 |
+
'id' => 'use_css',
|
4447 |
+
'title' => __('Use of CSS','woocommerce-products-slider'),
|
4448 |
+
'details' => __('Use following class selector to add custom CSS for this element.','woocommerce-products-slider'),
|
4449 |
+
'type' => 'custom_html',
|
4450 |
+
'html' => $html,
|
4451 |
+
|
4452 |
+
);
|
4453 |
+
|
4454 |
+
$settings_tabs_field->generate_field($args);
|
4455 |
+
|
4456 |
+
?>
|
4457 |
+
|
4458 |
+
</div>
|
4459 |
+
</div>
|
4460 |
+
<?php
|
4461 |
+
|
4462 |
+
}
|
4463 |
+
|
4464 |
+
add_action('wcps_layout_elements_option_order_payment_method','wcps_layout_elements_option_order_payment_method');
|
4465 |
+
function wcps_layout_elements_option_order_payment_method($parameters){
|
4466 |
+
|
4467 |
+
$settings_tabs_field = new settings_tabs_field();
|
4468 |
+
|
4469 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
4470 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
4471 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
4472 |
+
|
4473 |
+
|
4474 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
4475 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
4476 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
4477 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
4478 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
4479 |
+
$wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
|
4480 |
+
|
4481 |
+
$custom_css = isset($element_data['custom_css']) ? $element_data['custom_css'] : '';
|
4482 |
+
$custom_css_hover = isset($element_data['custom_css_hover']) ? $element_data['custom_css_hover'] : '';
|
4483 |
+
|
4484 |
+
|
4485 |
+
|
4486 |
+
?>
|
4487 |
+
<div class="item">
|
4488 |
+
<div class="element-title header ">
|
4489 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
4490 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
4491 |
+
|
4492 |
+
<span class="expand"><?php echo __('Customer payment method','woocommerce-products-slider'); ?></span>
|
4493 |
+
</div>
|
4494 |
+
<div class="element-options options">
|
4495 |
+
|
4496 |
+
<?php
|
4497 |
+
|
4498 |
+
|
4499 |
+
$args = array(
|
4500 |
+
'id' => 'wrapper_html',
|
4501 |
+
'css_id' => $element_index.'_wrapper_html',
|
4502 |
+
'parent' => $input_name.'[order_payment_method]',
|
4503 |
+
'title' => __('Wrapper html','woocommerce-products-slider'),
|
4504 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace sale count output.','woocommerce-products-slider'),
|
4505 |
+
'type' => 'text',
|
4506 |
+
'value' => $wrapper_html,
|
4507 |
+
'default' => '',
|
4508 |
+
'placeholder' => 'Phone: %s',
|
4509 |
+
);
|
4510 |
+
|
4511 |
+
$settings_tabs_field->generate_field($args);
|
4512 |
+
|
4513 |
+
$args = array(
|
4514 |
+
'id' => 'color',
|
4515 |
+
'css_id' => $element_index.'_payment_method',
|
4516 |
+
'parent' => $input_name.'[order_payment_method]',
|
4517 |
+
'title' => __('Color','woocommerce-products-slider'),
|
4518 |
+
'details' => __('Title text color.','woocommerce-products-slider'),
|
4519 |
+
'type' => 'colorpicker',
|
4520 |
+
'value' => $color,
|
4521 |
+
'default' => '',
|
4522 |
+
);
|
4523 |
+
|
4524 |
+
$settings_tabs_field->generate_field($args);
|
4525 |
+
|
4526 |
+
$args = array(
|
4527 |
+
'id' => 'font_size',
|
4528 |
+
'css_id' => $element_index.'_font_size',
|
4529 |
+
'parent' => $input_name.'[order_payment_method]',
|
4530 |
+
'title' => __('Font size','woocommerce-products-slider'),
|
4531 |
+
'details' => __('Set font size.','woocommerce-products-slider'),
|
4532 |
+
'type' => 'text',
|
4533 |
+
'value' => $font_size,
|
4534 |
+
'default' => '',
|
4535 |
+
'placeholder' => '14px',
|
4536 |
+
);
|
4537 |
+
|
4538 |
+
$settings_tabs_field->generate_field($args);
|
4539 |
+
|
4540 |
+
|
4541 |
+
$args = array(
|
4542 |
+
'id' => 'font_family',
|
4543 |
+
'css_id' => $element_index.'_font_family',
|
4544 |
+
'parent' => $input_name.'[order_payment_method]',
|
4545 |
+
'title' => __('Font family','woocommerce-products-slider'),
|
4546 |
+
'details' => __('Set font family.','woocommerce-products-slider'),
|
4547 |
+
'type' => 'text',
|
4548 |
+
'value' => $font_family,
|
4549 |
+
'default' => '',
|
4550 |
+
'placeholder' => 'Open Sans',
|
4551 |
+
);
|
4552 |
+
|
4553 |
+
$settings_tabs_field->generate_field($args);
|
4554 |
+
|
4555 |
+
|
4556 |
+
$args = array(
|
4557 |
+
'id' => 'margin',
|
4558 |
+
'css_id' => $element_index.'_margin',
|
4559 |
+
'parent' => $input_name.'[order_payment_method]',
|
4560 |
+
'title' => __('Margin','woocommerce-products-slider'),
|
4561 |
+
'details' => __('Set margin.','woocommerce-products-slider'),
|
4562 |
+
'type' => 'text',
|
4563 |
+
'value' => $margin,
|
4564 |
+
'default' => '',
|
4565 |
+
'placeholder' => '5px 0',
|
4566 |
+
);
|
4567 |
+
|
4568 |
+
$settings_tabs_field->generate_field($args);
|
4569 |
+
|
4570 |
+
|
4571 |
+
$args = array(
|
4572 |
+
'id' => 'text_align',
|
4573 |
+
'css_id' => $element_index.'_text_align',
|
4574 |
+
'parent' => $input_name.'[order_payment_method]',
|
4575 |
+
'title' => __('Text align','woocommerce-products-slider'),
|
4576 |
+
'details' => __('Choose text align.','woocommerce-products-slider'),
|
4577 |
+
'type' => 'select',
|
4578 |
+
'value' => $text_align,
|
4579 |
+
'default' => 'left',
|
4580 |
+
'args' => array('left'=> __('Left', 'woocommerce-products-slider'),'right'=> __('Right', 'woocommerce-products-slider'),'center'=> __('Center', 'woocommerce-products-slider') ),
|
4581 |
+
);
|
4582 |
+
|
4583 |
+
$settings_tabs_field->generate_field($args);
|
4584 |
+
|
4585 |
+
|
4586 |
+
ob_start();
|
4587 |
+
?>
|
4588 |
+
<textarea readonly type="text" onclick="this.select();">.element-<?php echo $element_index?>{}</textarea>
|
4589 |
+
<?php
|
4590 |
+
|
4591 |
+
$html = ob_get_clean();
|
4592 |
+
|
4593 |
+
$args = array(
|
4594 |
+
'id' => 'use_css',
|
4595 |
+
'title' => __('Use of CSS','woocommerce-products-slider'),
|
4596 |
+
'details' => __('Use following class selector to add custom CSS for this element.','woocommerce-products-slider'),
|
4597 |
+
'type' => 'custom_html',
|
4598 |
+
'html' => $html,
|
4599 |
+
|
4600 |
+
);
|
4601 |
+
|
4602 |
+
$settings_tabs_field->generate_field($args);
|
4603 |
+
|
4604 |
+
?>
|
4605 |
+
|
4606 |
+
</div>
|
4607 |
+
</div>
|
4608 |
+
<?php
|
4609 |
+
|
4610 |
+
}
|
4611 |
+
|
4612 |
+
|
4613 |
+
|
4614 |
+
|
4615 |
+
add_action('wcps_layout_elements_option_order_total','wcps_layout_elements_option_order_total');
|
4616 |
+
function wcps_layout_elements_option_order_total($parameters){
|
4617 |
+
|
4618 |
+
$settings_tabs_field = new settings_tabs_field();
|
4619 |
+
|
4620 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
4621 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
4622 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
4623 |
+
|
4624 |
+
|
4625 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
4626 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
4627 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
4628 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
4629 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
4630 |
+
$wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
|
4631 |
+
|
4632 |
+
$custom_css = isset($element_data['custom_css']) ? $element_data['custom_css'] : '';
|
4633 |
+
$custom_css_hover = isset($element_data['custom_css_hover']) ? $element_data['custom_css_hover'] : '';
|
4634 |
+
|
4635 |
+
|
4636 |
+
|
4637 |
+
?>
|
4638 |
+
<div class="item">
|
4639 |
+
<div class="element-title header ">
|
4640 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
4641 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
4642 |
+
|
4643 |
+
<span class="expand"><?php echo __('Order total','woocommerce-products-slider'); ?></span>
|
4644 |
+
</div>
|
4645 |
+
<div class="element-options options">
|
4646 |
+
|
4647 |
+
<?php
|
4648 |
+
|
4649 |
+
|
4650 |
+
$args = array(
|
4651 |
+
'id' => 'wrapper_html',
|
4652 |
+
'css_id' => $element_index.'_wrapper_html',
|
4653 |
+
'parent' => $input_name.'[order_total]',
|
4654 |
+
'title' => __('Wrapper html','woocommerce-products-slider'),
|
4655 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace sale count output.','woocommerce-products-slider'),
|
4656 |
+
'type' => 'text',
|
4657 |
+
'value' => $wrapper_html,
|
4658 |
+
'default' => '',
|
4659 |
+
'placeholder' => 'Phone: %s',
|
4660 |
+
);
|
4661 |
+
|
4662 |
+
$settings_tabs_field->generate_field($args);
|
4663 |
+
|
4664 |
+
$args = array(
|
4665 |
+
'id' => 'color',
|
4666 |
+
'css_id' => $element_index.'_order_total',
|
4667 |
+
'parent' => $input_name.'[order_total]',
|
4668 |
+
'title' => __('Color','woocommerce-products-slider'),
|
4669 |
+
'details' => __('Title text color.','woocommerce-products-slider'),
|
4670 |
+
'type' => 'colorpicker',
|
4671 |
+
'value' => $color,
|
4672 |
+
'default' => '',
|
4673 |
+
);
|
4674 |
+
|
4675 |
+
$settings_tabs_field->generate_field($args);
|
4676 |
+
|
4677 |
+
$args = array(
|
4678 |
+
'id' => 'font_size',
|
4679 |
+
'css_id' => $element_index.'_font_size',
|
4680 |
+
'parent' => $input_name.'[order_total]',
|
4681 |
+
'title' => __('Font size','woocommerce-products-slider'),
|
4682 |
+
'details' => __('Set font size.','woocommerce-products-slider'),
|
4683 |
+
'type' => 'text',
|
4684 |
+
'value' => $font_size,
|
4685 |
+
'default' => '',
|
4686 |
+
'placeholder' => '14px',
|
4687 |
+
);
|
4688 |
+
|
4689 |
+
$settings_tabs_field->generate_field($args);
|
4690 |
+
|
4691 |
+
|
4692 |
+
$args = array(
|
4693 |
+
'id' => 'font_family',
|
4694 |
+
'css_id' => $element_index.'_font_family',
|
4695 |
+
'parent' => $input_name.'[order_total]',
|
4696 |
+
'title' => __('Font family','woocommerce-products-slider'),
|
4697 |
+
'details' => __('Set font family.','woocommerce-products-slider'),
|
4698 |
+
'type' => 'text',
|
4699 |
+
'value' => $font_family,
|
4700 |
+
'default' => '',
|
4701 |
+
'placeholder' => 'Open Sans',
|
4702 |
+
);
|
4703 |
+
|
4704 |
+
$settings_tabs_field->generate_field($args);
|
4705 |
+
|
4706 |
+
|
4707 |
+
$args = array(
|
4708 |
+
'id' => 'margin',
|
4709 |
+
'css_id' => $element_index.'_margin',
|
4710 |
+
'parent' => $input_name.'[order_total]',
|
4711 |
+
'title' => __('Margin','woocommerce-products-slider'),
|
4712 |
+
'details' => __('Set margin.','woocommerce-products-slider'),
|
4713 |
+
'type' => 'text',
|
4714 |
+
'value' => $margin,
|
4715 |
+
'default' => '',
|
4716 |
+
'placeholder' => '5px 0',
|
4717 |
+
);
|
4718 |
+
|
4719 |
+
$settings_tabs_field->generate_field($args);
|
4720 |
+
|
4721 |
+
|
4722 |
+
$args = array(
|
4723 |
+
'id' => 'text_align',
|
4724 |
+
'css_id' => $element_index.'_text_align',
|
4725 |
+
'parent' => $input_name.'[order_total]',
|
4726 |
+
'title' => __('Text align','woocommerce-products-slider'),
|
4727 |
+
'details' => __('Choose text align.','woocommerce-products-slider'),
|
4728 |
+
'type' => 'select',
|
4729 |
+
'value' => $text_align,
|
4730 |
+
'default' => 'left',
|
4731 |
+
'args' => array('left'=> __('Left', 'woocommerce-products-slider'),'right'=> __('Right', 'woocommerce-products-slider'),'center'=> __('Center', 'woocommerce-products-slider') ),
|
4732 |
+
);
|
4733 |
+
|
4734 |
+
$settings_tabs_field->generate_field($args);
|
4735 |
+
|
4736 |
+
|
4737 |
+
ob_start();
|
4738 |
+
?>
|
4739 |
+
<textarea readonly type="text" onclick="this.select();">.element-<?php echo $element_index?>{}</textarea>
|
4740 |
+
<?php
|
4741 |
+
|
4742 |
+
$html = ob_get_clean();
|
4743 |
+
|
4744 |
+
$args = array(
|
4745 |
+
'id' => 'use_css',
|
4746 |
+
'title' => __('Use of CSS','woocommerce-products-slider'),
|
4747 |
+
'details' => __('Use following class selector to add custom CSS for this element.','woocommerce-products-slider'),
|
4748 |
+
'type' => 'custom_html',
|
4749 |
+
'html' => $html,
|
4750 |
+
|
4751 |
+
);
|
4752 |
+
|
4753 |
+
$settings_tabs_field->generate_field($args);
|
4754 |
+
|
4755 |
+
?>
|
4756 |
+
|
4757 |
+
</div>
|
4758 |
+
</div>
|
4759 |
+
<?php
|
4760 |
+
|
4761 |
+
}
|
4762 |
+
|
4763 |
+
|
4764 |
+
add_action('wcps_layout_elements_option_order_items','wcps_layout_elements_option_order_items');
|
4765 |
+
function wcps_layout_elements_option_order_items($parameters){
|
4766 |
+
|
4767 |
+
$settings_tabs_field = new settings_tabs_field();
|
4768 |
+
|
4769 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
4770 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
4771 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
4772 |
+
|
4773 |
+
|
4774 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
4775 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
4776 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
4777 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
4778 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
4779 |
+
$wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
|
4780 |
+
|
4781 |
+
$custom_css = isset($element_data['custom_css']) ? $element_data['custom_css'] : '';
|
4782 |
+
$custom_css_hover = isset($element_data['custom_css_hover']) ? $element_data['custom_css_hover'] : '';
|
4783 |
+
|
4784 |
+
|
4785 |
+
|
4786 |
+
?>
|
4787 |
+
<div class="item">
|
4788 |
+
<div class="element-title header ">
|
4789 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
4790 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
4791 |
+
|
4792 |
+
<span class="expand"><?php echo __('Order items','woocommerce-products-slider'); ?></span>
|
4793 |
+
</div>
|
4794 |
+
<div class="element-options options">
|
4795 |
+
|
4796 |
+
<?php
|
4797 |
+
|
4798 |
+
|
4799 |
+
$args = array(
|
4800 |
+
'id' => 'wrapper_html',
|
4801 |
+
'css_id' => $element_index.'_wrapper_html',
|
4802 |
+
'parent' => $input_name.'[order_items]',
|
4803 |
+
'title' => __('Wrapper html','woocommerce-products-slider'),
|
4804 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace sale count output.','woocommerce-products-slider'),
|
4805 |
+
'type' => 'text',
|
4806 |
+
'value' => $wrapper_html,
|
4807 |
+
'default' => '',
|
4808 |
+
'placeholder' => 'Order items: %s',
|
4809 |
+
);
|
4810 |
+
|
4811 |
+
$settings_tabs_field->generate_field($args);
|
4812 |
+
|
4813 |
+
$args = array(
|
4814 |
+
'id' => 'color',
|
4815 |
+
'css_id' => $element_index.'_order_items',
|
4816 |
+
'parent' => $input_name.'[order_items]',
|
4817 |
+
'title' => __('Color','woocommerce-products-slider'),
|
4818 |
+
'details' => __('Title text color.','woocommerce-products-slider'),
|
4819 |
+
'type' => 'colorpicker',
|
4820 |
+
'value' => $color,
|
4821 |
+
'default' => '',
|
4822 |
+
);
|
4823 |
+
|
4824 |
+
$settings_tabs_field->generate_field($args);
|
4825 |
+
|
4826 |
+
$args = array(
|
4827 |
+
'id' => 'font_size',
|
4828 |
+
'css_id' => $element_index.'_font_size',
|
4829 |
+
'parent' => $input_name.'[order_items]',
|
4830 |
+
'title' => __('Font size','woocommerce-products-slider'),
|
4831 |
+
'details' => __('Set font size.','woocommerce-products-slider'),
|
4832 |
+
'type' => 'text',
|
4833 |
+
'value' => $font_size,
|
4834 |
+
'default' => '',
|
4835 |
+
'placeholder' => '14px',
|
4836 |
+
);
|
4837 |
+
|
4838 |
+
$settings_tabs_field->generate_field($args);
|
4839 |
+
|
4840 |
+
|
4841 |
+
$args = array(
|
4842 |
+
'id' => 'font_family',
|
4843 |
+
'css_id' => $element_index.'_font_family',
|
4844 |
+
'parent' => $input_name.'[order_items]',
|
4845 |
+
'title' => __('Font family','woocommerce-products-slider'),
|
4846 |
+
'details' => __('Set font family.','woocommerce-products-slider'),
|
4847 |
+
'type' => 'text',
|
4848 |
+
'value' => $font_family,
|
4849 |
+
'default' => '',
|
4850 |
+
'placeholder' => 'Open Sans',
|
4851 |
+
);
|
4852 |
+
|
4853 |
+
$settings_tabs_field->generate_field($args);
|
4854 |
+
|
4855 |
+
|
4856 |
+
$args = array(
|
4857 |
+
'id' => 'margin',
|
4858 |
+
'css_id' => $element_index.'_margin',
|
4859 |
+
'parent' => $input_name.'[order_items]',
|
4860 |
+
'title' => __('Margin','woocommerce-products-slider'),
|
4861 |
+
'details' => __('Set margin.','woocommerce-products-slider'),
|
4862 |
+
'type' => 'text',
|
4863 |
+
'value' => $margin,
|
4864 |
+
'default' => '',
|
4865 |
+
'placeholder' => '5px 0',
|
4866 |
+
);
|
4867 |
+
|
4868 |
+
$settings_tabs_field->generate_field($args);
|
4869 |
+
|
4870 |
+
|
4871 |
+
$args = array(
|
4872 |
+
'id' => 'text_align',
|
4873 |
+
'css_id' => $element_index.'_text_align',
|
4874 |
+
'parent' => $input_name.'[order_items]',
|
4875 |
+
'title' => __('Text align','woocommerce-products-slider'),
|
4876 |
+
'details' => __('Choose text align.','woocommerce-products-slider'),
|
4877 |
+
'type' => 'select',
|
4878 |
+
'value' => $text_align,
|
4879 |
+
'default' => 'left',
|
4880 |
+
'args' => array('left'=> __('Left', 'woocommerce-products-slider'),'right'=> __('Right', 'woocommerce-products-slider'),'center'=> __('Center', 'woocommerce-products-slider') ),
|
4881 |
+
);
|
4882 |
+
|
4883 |
+
$settings_tabs_field->generate_field($args);
|
4884 |
+
|
4885 |
+
|
4886 |
+
ob_start();
|
4887 |
+
?>
|
4888 |
+
<textarea readonly type="text" onclick="this.select();">.element-<?php echo $element_index?>{}</textarea>
|
4889 |
+
<?php
|
4890 |
+
|
4891 |
+
$html = ob_get_clean();
|
4892 |
+
|
4893 |
+
$args = array(
|
4894 |
+
'id' => 'use_css',
|
4895 |
+
'title' => __('Use of CSS','woocommerce-products-slider'),
|
4896 |
+
'details' => __('Use following class selector to add custom CSS for this element.','woocommerce-products-slider'),
|
4897 |
+
'type' => 'custom_html',
|
4898 |
+
'html' => $html,
|
4899 |
+
|
4900 |
+
);
|
4901 |
+
|
4902 |
+
$settings_tabs_field->generate_field($args);
|
4903 |
+
|
4904 |
+
?>
|
4905 |
+
|
4906 |
+
</div>
|
4907 |
+
</div>
|
4908 |
+
<?php
|
4909 |
+
|
4910 |
+
}
|
4911 |
+
|
4912 |
+
|
4913 |
+
|
4914 |
+
add_action('wcps_layout_elements_option_order_discount_total','wcps_layout_elements_option_order_discount_total');
|
4915 |
+
function wcps_layout_elements_option_order_discount_total($parameters){
|
4916 |
+
|
4917 |
+
$settings_tabs_field = new settings_tabs_field();
|
4918 |
+
|
4919 |
+
$input_name = isset($parameters['input_name']) ? $parameters['input_name'] : '{input_name}';
|
4920 |
+
$element_data = isset($parameters['element_data']) ? $parameters['element_data'] : array();
|
4921 |
+
$element_index = isset($parameters['index']) ? $parameters['index'] : '';
|
4922 |
+
|
4923 |
+
|
4924 |
+
$color = isset($element_data['color']) ? $element_data['color'] : '';
|
4925 |
+
$font_size = isset($element_data['font_size']) ? $element_data['font_size'] : '';
|
4926 |
+
$font_family = isset($element_data['font_family']) ? $element_data['font_family'] : '';
|
4927 |
+
$margin = isset($element_data['margin']) ? $element_data['margin'] : '';
|
4928 |
+
$text_align = isset($element_data['text_align']) ? $element_data['text_align'] : '';
|
4929 |
+
$wrapper_html = isset($element_data['wrapper_html']) ? $element_data['wrapper_html'] : '';
|
4930 |
+
|
4931 |
+
$custom_css = isset($element_data['custom_css']) ? $element_data['custom_css'] : '';
|
4932 |
+
$custom_css_hover = isset($element_data['custom_css_hover']) ? $element_data['custom_css_hover'] : '';
|
4933 |
+
|
4934 |
+
|
4935 |
+
|
4936 |
+
?>
|
4937 |
+
<div class="item">
|
4938 |
+
<div class="element-title header ">
|
4939 |
+
<span class="remove" onclick="jQuery(this).parent().parent().remove()"><i class="fas fa-times"></i></span>
|
4940 |
+
<span class="sort"><i class="fas fa-sort"></i></span>
|
4941 |
+
|
4942 |
+
<span class="expand"><?php echo __('Order discount total','woocommerce-products-slider'); ?></span>
|
4943 |
+
</div>
|
4944 |
+
<div class="element-options options">
|
4945 |
+
|
4946 |
+
<?php
|
4947 |
+
|
4948 |
+
|
4949 |
+
$args = array(
|
4950 |
+
'id' => 'wrapper_html',
|
4951 |
+
'css_id' => $element_index.'_wrapper_html',
|
4952 |
+
'parent' => $input_name.'[order_discount_total]',
|
4953 |
+
'title' => __('Wrapper html','woocommerce-products-slider'),
|
4954 |
+
'details' => __('Write wrapper html, use <code>%s</code> to replace sale count output.','woocommerce-products-slider'),
|
4955 |
+
'type' => 'text',
|
4956 |
+
'value' => $wrapper_html,
|
4957 |
+
'default' => '',
|
4958 |
+
'placeholder' => 'Discount total: %s',
|
4959 |
+
);
|
4960 |
+
|
4961 |
+
$settings_tabs_field->generate_field($args);
|
4962 |
+
|
4963 |
+
$args = array(
|
4964 |
+
'id' => 'color',
|
4965 |
+
'css_id' => $element_index.'_order_discount_total',
|
4966 |
+
'parent' => $input_name.'[order_discount_total]',
|
4967 |
+
'title' => __('Color','woocommerce-products-slider'),
|
4968 |
+
'details' => __('Title text color.','woocommerce-products-slider'),
|
4969 |
+
'type' => 'colorpicker',
|
4970 |
+
'value' => $color,
|
4971 |
+
'default' => '',
|
4972 |
+
);
|
4973 |
+
|
4974 |
+
$settings_tabs_field->generate_field($args);
|
4975 |
+
|
4976 |
+
$args = array(
|
4977 |
+
'id' => 'font_size',
|
4978 |
+
'css_id' => $element_index.'_font_size',
|
4979 |
+
'parent' => $input_name.'[order_discount_total]',
|
4980 |
+
'title' => __('Font size','woocommerce-products-slider'),
|
4981 |
+
'details' => __('Set font size.','woocommerce-products-slider'),
|
4982 |
+
'type' => 'text',
|
4983 |
+
'value' => $font_size,
|
4984 |
+
'default' => '',
|
4985 |
+
'placeholder' => '14px',
|
4986 |
+
);
|
4987 |
+
|
4988 |
+
$settings_tabs_field->generate_field($args);
|
4989 |
+
|
4990 |
+
|
4991 |
+
$args = array(
|
4992 |
+
'id' => 'font_family',
|
4993 |
+
'css_id' => $element_index.'_font_family',
|
4994 |
+
'parent' => $input_name.'[order_discount_total]',
|
4995 |
+
'title' => __('Font family','woocommerce-products-slider'),
|
4996 |
+
'details' => __('Set font family.','woocommerce-products-slider'),
|
4997 |
+
'type' => 'text',
|
4998 |
+
'value' => $font_family,
|
4999 |
+
'default' => '',
|
5000 |
+
'placeholder' => 'Open Sans',
|
5001 |
+
);
|
5002 |
+
|
5003 |
+
$settings_tabs_field->generate_field($args);
|
5004 |
+
|
5005 |
+
|
5006 |
+
$args = array(
|
5007 |
+
'id' => 'margin',
|
5008 |
+
'css_id' => $element_index.'_margin',
|
5009 |
+
'parent' => $input_name.'[order_discount_total]',
|
5010 |
+
'title' => __('Margin','woocommerce-products-slider'),
|
5011 |
+
'details' => __('Set margin.','woocommerce-products-slider'),
|
5012 |
+
'type' => 'text',
|
5013 |
+
'value' => $margin,
|
5014 |
+
'default' => '',
|
5015 |
+
'placeholder' => '5px 0',
|
5016 |
+
);
|
5017 |
+
|
5018 |
+
$settings_tabs_field->generate_field($args);
|
5019 |
+
|
5020 |
+
|
5021 |
+
$args = array(
|
5022 |
+
'id' => 'text_align',
|
5023 |
+
'css_id' => $element_index.'_text_align',
|
5024 |
+
'parent' => $input_name.'[order_discount_total]',
|
5025 |
+
'title' => __('Text align','woocommerce-products-slider'),
|
5026 |
+
'details' => __('Choose text align.','woocommerce-products-slider'),
|
5027 |
+
'type' => 'select',
|
5028 |
+
'value' => $text_align,
|
5029 |
+
'default' => 'left',
|
5030 |
+
'args' => array('left'=> __('Left', 'woocommerce-products-slider'),'right'=> __('Right', 'woocommerce-products-slider'),'center'=> __('Center', 'woocommerce-products-slider') ),
|
5031 |
+
);
|
5032 |
+
|
5033 |
+
$settings_tabs_field->generate_field($args);
|
5034 |
+
|
5035 |
+
|
5036 |
+
ob_start();
|
5037 |
+
?>
|
5038 |
+
<textarea readonly type="text" onclick="this.select();">.element-<?php echo $element_index?>{}</textarea>
|
5039 |
+
<?php
|
5040 |
+
|
5041 |
+
$html = ob_get_clean();
|
5042 |
+
|
5043 |
+
$args = array(
|
5044 |
+
'id' => 'use_css',
|
5045 |
+
'title' => __('Use of CSS','woocommerce-products-slider'),
|
5046 |
+
'details' => __('Use following class selector to add custom CSS for this element.','woocommerce-products-slider'),
|
5047 |
+
'type' => 'custom_html',
|
5048 |
+
'html' => $html,
|
5049 |
+
|
5050 |
+
);
|
5051 |
+
|
5052 |
+
$settings_tabs_field->generate_field($args);
|
5053 |
+
|
5054 |
+
?>
|
5055 |
+
|
5056 |
+
</div>
|
5057 |
+
</div>
|
5058 |
+
<?php
|
5059 |
+
|
5060 |
+
}
|
5061 |
+
|
5062 |
+
|
5063 |
+
|
5064 |
+
|
5065 |
+
|
5066 |
+
|
5067 |
+
|
includes/functions-settings-hook.php
CHANGED
@@ -602,6 +602,83 @@ if(!function_exists('wcps_settings_content_buy_pro')) {
|
|
602 |
<td><i class="fas fa-check"></i></td>
|
603 |
</tr>
|
604 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
605 |
<tr>
|
606 |
<th class="col-features"><?php echo __('Features','woocommerce-products-slider'); ?></th>
|
607 |
<th class="col-free"><?php echo __('Free','woocommerce-products-slider'); ?></th>
|
602 |
<td><i class="fas fa-check"></i></td>
|
603 |
</tr>
|
604 |
|
605 |
+
<tr>
|
606 |
+
<td colspan="3" class="col-features"><?php echo __('3rd party','woocommerce-products-slider'); ?> </td>
|
607 |
+
</tr>
|
608 |
+
<tr>
|
609 |
+
<td class="col-features"><?php echo __('YITH WooCommerce Badge Management','woocommerce-products-slider'); ?> </td>
|
610 |
+
<td><i class="fas fa-check"></i></td>
|
611 |
+
<td><i class="fas fa-check"></i></td>
|
612 |
+
</tr>
|
613 |
+
<tr>
|
614 |
+
<td class="col-features"><?php echo __('YITH WooCommerce Quick View','woocommerce-products-slider'); ?> </td>
|
615 |
+
<td><i class="fas fa-check"></i></td>
|
616 |
+
<td><i class="fas fa-check"></i></td>
|
617 |
+
</tr>
|
618 |
+
<tr>
|
619 |
+
<td class="col-features"><?php echo __('YITH WooCommerce Wishlist','woocommerce-products-slider'); ?> </td>
|
620 |
+
<td><i class="fas fa-check"></i></td>
|
621 |
+
<td><i class="fas fa-check"></i></td>
|
622 |
+
</tr>
|
623 |
+
<tr>
|
624 |
+
<td class="col-features"><?php echo __('YITH WooCommerce Brands','woocommerce-products-slider'); ?> </td>
|
625 |
+
<td><i class="fas fa-check"></i></td>
|
626 |
+
<td><i class="fas fa-check"></i></td>
|
627 |
+
</tr>
|
628 |
+
<tr>
|
629 |
+
<td class="col-features"><?php echo __('YITH WooCommerce Compare','woocommerce-products-slider'); ?> </td>
|
630 |
+
<td><i class="fas fa-check"></i></td>
|
631 |
+
<td><i class="fas fa-check"></i></td>
|
632 |
+
</tr>
|
633 |
+
|
634 |
+
<tr>
|
635 |
+
<td class="col-features"><?php echo __('WooCommerce Wholesale Prices','woocommerce-products-slider'); ?> </td>
|
636 |
+
<td><i class="fas fa-check"></i></td>
|
637 |
+
<td><i class="fas fa-check"></i></td>
|
638 |
+
</tr>
|
639 |
+
<tr>
|
640 |
+
<td class="col-features"><?php echo __('TI WooCommerce Wishlist','woocommerce-products-slider'); ?> </td>
|
641 |
+
<td><i class="fas fa-check"></i></td>
|
642 |
+
<td><i class="fas fa-check"></i></td>
|
643 |
+
</tr>
|
644 |
+
<tr>
|
645 |
+
<td class="col-features"><?php echo __('WPC Countdown Timer','woocommerce-products-slider'); ?> </td>
|
646 |
+
<td><i class="fas fa-check"></i></td>
|
647 |
+
<td><i class="fas fa-check"></i></td>
|
648 |
+
</tr>
|
649 |
+
<tr>
|
650 |
+
<td class="col-features"><?php echo __('WPC Smart Compare','woocommerce-products-slider'); ?> </td>
|
651 |
+
<td><i class="fas fa-check"></i></td>
|
652 |
+
<td><i class="fas fa-check"></i></td>
|
653 |
+
</tr>
|
654 |
+
<tr>
|
655 |
+
<td class="col-features"><?php echo __('WPC Smart Quick View','woocommerce-products-slider'); ?> </td>
|
656 |
+
<td><i class="fas fa-check"></i></td>
|
657 |
+
<td><i class="fas fa-check"></i></td>
|
658 |
+
</tr>
|
659 |
+
<tr>
|
660 |
+
<td class="col-features"><?php echo __('WPC Smart Wishlist','woocommerce-products-slider'); ?> </td>
|
661 |
+
<td><i class="fas fa-check"></i></td>
|
662 |
+
<td><i class="fas fa-check"></i></td>
|
663 |
+
</tr>
|
664 |
+
<tr>
|
665 |
+
<td class="col-features"><?php echo __('Wishlist by PickPlugins','woocommerce-products-slider'); ?> </td>
|
666 |
+
<td><i class="fas fa-check"></i></td>
|
667 |
+
<td><i class="fas fa-check"></i></td>
|
668 |
+
</tr>
|
669 |
+
<tr>
|
670 |
+
<td class="col-features"><?php echo __('Wish List for WooCommerce','woocommerce-products-slider'); ?> </td>
|
671 |
+
<td><i class="fas fa-check"></i></td>
|
672 |
+
<td><i class="fas fa-check"></i></td>
|
673 |
+
</tr>
|
674 |
+
<tr>
|
675 |
+
<td class="col-features"><?php echo __('WooCommerce Wholesale Prices','woocommerce-products-slider'); ?> </td>
|
676 |
+
<td><i class="fas fa-check"></i></td>
|
677 |
+
<td><i class="fas fa-check"></i></td>
|
678 |
+
</tr>
|
679 |
+
|
680 |
+
|
681 |
+
|
682 |
<tr>
|
683 |
<th class="col-features"><?php echo __('Features','woocommerce-products-slider'); ?></th>
|
684 |
<th class="col-free"><?php echo __('Free','woocommerce-products-slider'); ?></th>
|
includes/functions.php
CHANGED
@@ -90,7 +90,27 @@ function wcps_first_wcps_layout(){
|
|
90 |
}
|
91 |
|
92 |
|
|
|
93 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
94 |
|
95 |
function wcps_get_first_product_id(){
|
96 |
|
@@ -115,6 +135,35 @@ function wcps_get_first_product_id(){
|
|
115 |
}
|
116 |
|
117 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
function wcps_featured_product_ids($query_args){
|
119 |
|
120 |
$query_args['tax_query'][] = array(
|
@@ -140,6 +189,9 @@ function wcps_featured_product_ids($query_args){
|
|
140 |
}
|
141 |
|
142 |
|
|
|
|
|
|
|
143 |
function wcps_recently_viewed_products(){
|
144 |
|
145 |
|
90 |
}
|
91 |
|
92 |
|
93 |
+
function wcps_get_first_order_id(){
|
94 |
|
95 |
+
$args = array(
|
96 |
+
'post_type' => 'shop_order',
|
97 |
+
'post_status' => 'publish',
|
98 |
+
'posts_per_page' => 1,
|
99 |
+
);
|
100 |
+
|
101 |
+
$post_id ='';
|
102 |
+
|
103 |
+
$wp_query = new WP_Query($args);
|
104 |
+
|
105 |
+
if ($wp_query->have_posts()) :
|
106 |
+
while ($wp_query->have_posts()) : $wp_query->the_post();
|
107 |
+
$product_id = get_the_id();
|
108 |
+
return $product_id;
|
109 |
+
endwhile;
|
110 |
+
else:
|
111 |
+
|
112 |
+
endif;
|
113 |
+
}
|
114 |
|
115 |
function wcps_get_first_product_id(){
|
116 |
|
135 |
}
|
136 |
|
137 |
|
138 |
+
function wcps_get_first_category_id(){
|
139 |
+
|
140 |
+
$terms = get_terms( array(
|
141 |
+
'taxonomy' => 'product_cat',
|
142 |
+
'hide_empty' => false,
|
143 |
+
) );
|
144 |
+
|
145 |
+
return $terms[1]->term_id;
|
146 |
+
|
147 |
+
|
148 |
+
}
|
149 |
+
|
150 |
+
function wcps_get_first_dokan_vendor_id(){
|
151 |
+
|
152 |
+
$args = array(
|
153 |
+
'role' => 'shop_vendor',
|
154 |
+
'orderby' => 'registered',
|
155 |
+
'order' => 'DESC',
|
156 |
+
'number' => 1
|
157 |
+
);
|
158 |
+
|
159 |
+
$users = get_users( $args );
|
160 |
+
$last_user_registered = isset($users[0]) ? $users[0] : '';
|
161 |
+
|
162 |
+
$vendor_id = isset($last_user_registered->ID) ?$last_user_registered->ID : '';
|
163 |
+
|
164 |
+
return $vendor_id;
|
165 |
+
}
|
166 |
+
|
167 |
function wcps_featured_product_ids($query_args){
|
168 |
|
169 |
$query_args['tax_query'][] = array(
|
189 |
}
|
190 |
|
191 |
|
192 |
+
|
193 |
+
|
194 |
+
|
195 |
function wcps_recently_viewed_products(){
|
196 |
|
197 |
|
readme.txt
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
=== PickPlugins Product Slider for WooCommerce ===
|
2 |
Contributors: PickPlugins
|
3 |
Donate link: https://www.pickplugins.com/item/woocommerce-products-slider-for-wordpress/?ref=wordpress.org
|
4 |
-
Tags: product slider, woocommerce slider,
|
5 |
Requires at least: 3.8
|
6 |
-
Tested up to: 5.
|
7 |
-
Stable tag: 1.13.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -141,6 +141,39 @@ then paste this shortcode anywhere in your page to display slider<br />
|
|
141 |
|
142 |
== Changelog ==
|
143 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
144 |
|
145 |
|
146 |
= 1.13.9 =
|
1 |
=== PickPlugins Product Slider for WooCommerce ===
|
2 |
Contributors: PickPlugins
|
3 |
Donate link: https://www.pickplugins.com/item/woocommerce-products-slider-for-wordpress/?ref=wordpress.org
|
4 |
+
Tags: product slider, woocommerce slider, carousel slider, product category slider, woo slider, carousel slider, woocommerce product slider
|
5 |
Requires at least: 3.8
|
6 |
+
Tested up to: 5.4
|
7 |
+
Stable tag: 1.13.10
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
141 |
|
142 |
== Changelog ==
|
143 |
|
144 |
+
= 1.13.10 =
|
145 |
+
* 2020-04-05 add - Customer Orders slider
|
146 |
+
* 2020-04-05 add - Categories slider
|
147 |
+
* 2020-04-05 add - Dokan vendors slider
|
148 |
+
* 2020-04-05 add - add element "Term title" under layout builder
|
149 |
+
* 2020-04-05 add - add element "Term thumbnail" under layout builder
|
150 |
+
* 2020-04-05 add - add element "Term description" under layout builder
|
151 |
+
* 2020-04-05 add - add element "Term slug" under layout builder
|
152 |
+
* 2020-04-05 add - add element "Term post count" under layout builder
|
153 |
+
* 2020-04-05 add - add element "Order date" under layout builder
|
154 |
+
* 2020-04-05 add - add element "Order customer name" under layout builder
|
155 |
+
* 2020-04-05 add - add element "Order customer thumbnail" under layout builder
|
156 |
+
* 2020-04-05 add - add element "Order country" under layout builder
|
157 |
+
* 2020-04-05 add - add element "Order payment method" under layout builder
|
158 |
+
* 2020-04-05 add - add element "Order total" under layout builder
|
159 |
+
* 2020-04-05 add - add element "Order items" under layout builder
|
160 |
+
* 2020-04-05 add - add element "Order discount total" under layout builder
|
161 |
+
* 2020-04-05 add - add element "Dokan store name" under layout builder
|
162 |
+
* 2020-04-05 add - add element "Dokan store address" under layout builder
|
163 |
+
* 2020-04-05 add - add element "Dokan store city" under layout builder
|
164 |
+
* 2020-04-05 add - add element "Dokan store country" under layout builder
|
165 |
+
* 2020-04-05 add - add element "Dokan store phone" under layout builder
|
166 |
+
* 2020-04-05 add - add element "Dokan store banner" under layout builder
|
167 |
+
* 2020-04-05 add - add element "Dokan store avatar" under layout builder
|
168 |
+
* 2020-04-05 add - add element for "Wishlist" plugin under layout builder
|
169 |
+
* 2020-04-05 add - add element for "WPC Smart Wishlist" plugin under layout builder
|
170 |
+
* 2020-04-05 add - add element for "WPC Smart Quick View" plugin under layout builder
|
171 |
+
* 2020-04-05 add - add element for "WPC Smart Compare" plugin under layout builder
|
172 |
+
* 2020-04-05 add - add element for "WPC Countdown Timer" plugin under layout builder
|
173 |
+
* 2020-04-05 add - add element for "TI WooCommerce Wishlist" plugin under layout builder
|
174 |
+
* 2020-04-05 add - compatibility check for "WooCommerce Wholesale Prices" plugin
|
175 |
+
* 2020-04-05 add - add element for "Wish List for WooCommerce" plugin under layout builder
|
176 |
+
|
177 |
|
178 |
|
179 |
= 1.13.9 =
|
templates/wcps-slider/wcps-slider-hook.php
CHANGED
@@ -64,9 +64,12 @@ add_action('wcps_slider_main', 'wcps_slider_main_items', 20);
|
|
64 |
|
65 |
function wcps_slider_main_items($args){
|
66 |
|
67 |
-
$wcps_id = isset($args['wcps_id']) ? (int) $args['wcps_id'] : 0;
|
68 |
|
|
|
69 |
$wcps_options = get_post_meta( $wcps_id, 'wcps_options', true );
|
|
|
|
|
|
|
70 |
$item_layout_id = isset($wcps_options['item_layout_id']) ? $wcps_options['item_layout_id'] : wcps_first_wcps_layout();
|
71 |
|
72 |
if(empty($item_layout_id)){
|
@@ -277,15 +280,11 @@ function wcps_slider_main_items($args){
|
|
277 |
|
278 |
|
279 |
|
280 |
-
|
281 |
-
|
282 |
add_action('wcps_slider_item', 'wcps_slider_item', 10);
|
283 |
|
284 |
function wcps_slider_item($args){
|
285 |
|
286 |
$wcps_id = isset($args['wcps_id']) ? $args['wcps_id'] : '';
|
287 |
-
$product_id = isset($args['product_id']) ? $args['product_id'] : 0;
|
288 |
-
$args['product_id'] = $product_id;
|
289 |
|
290 |
$wcps_options = get_post_meta( $wcps_id, 'wcps_options', true );
|
291 |
$item_layout_id = isset($wcps_options['item_layout_id']) ? $wcps_options['item_layout_id'] : wcps_first_wcps_layout();
|
@@ -326,6 +325,436 @@ function wcps_slider_item($args){
|
|
326 |
|
327 |
|
328 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
329 |
add_filter('wcps_slider_main', 'wcps_slider_main_scripts', 90);
|
330 |
|
331 |
function wcps_slider_main_scripts( $args){
|
64 |
|
65 |
function wcps_slider_main_items($args){
|
66 |
|
|
|
67 |
|
68 |
+
$wcps_id = isset($args['wcps_id']) ? (int) $args['wcps_id'] : 0;
|
69 |
$wcps_options = get_post_meta( $wcps_id, 'wcps_options', true );
|
70 |
+
$slider_for = isset($wcps_options['slider_for']) ? $wcps_options['slider_for'] : 'products';
|
71 |
+
if($slider_for != 'products') return;
|
72 |
+
|
73 |
$item_layout_id = isset($wcps_options['item_layout_id']) ? $wcps_options['item_layout_id'] : wcps_first_wcps_layout();
|
74 |
|
75 |
if(empty($item_layout_id)){
|
280 |
|
281 |
|
282 |
|
|
|
|
|
283 |
add_action('wcps_slider_item', 'wcps_slider_item', 10);
|
284 |
|
285 |
function wcps_slider_item($args){
|
286 |
|
287 |
$wcps_id = isset($args['wcps_id']) ? $args['wcps_id'] : '';
|
|
|
|
|
288 |
|
289 |
$wcps_options = get_post_meta( $wcps_id, 'wcps_options', true );
|
290 |
$item_layout_id = isset($wcps_options['item_layout_id']) ? $wcps_options['item_layout_id'] : wcps_first_wcps_layout();
|
325 |
|
326 |
|
327 |
|
328 |
+
|
329 |
+
|
330 |
+
|
331 |
+
add_action('wcps_slider_main', 'wcps_slider_main_items_orders', 20);
|
332 |
+
|
333 |
+
function wcps_slider_main_items_orders($args){
|
334 |
+
|
335 |
+
|
336 |
+
$wcps_id = isset($args['wcps_id']) ? (int) $args['wcps_id'] : 0;
|
337 |
+
$wcps_options = get_post_meta( $wcps_id, 'wcps_options', true );
|
338 |
+
$slider_for = isset($wcps_options['slider_for']) ? $wcps_options['slider_for'] : 'products';
|
339 |
+
if($slider_for != 'orders') return;
|
340 |
+
|
341 |
+
$item_layout_id = isset($wcps_options['item_layout_id']) ? $wcps_options['item_layout_id'] : wcps_first_wcps_layout();
|
342 |
+
|
343 |
+
if(empty($item_layout_id)){
|
344 |
+
|
345 |
+
?><i class="far fa-times-circle"></i> Please create a <a target="_blank" href="<?php echo admin_url(); ?>post-new.php?post_type=wcps_layout">layout</a> first. watch this video to learn <a href="https://www.youtube.com/watch?v=_HMHaSjjHdo&list=PL0QP7T2SN94bgierw1J8Qn3sf4mZo7F9f&index=8&t=0s">customize layouts</a>
|
346 |
+
<?php
|
347 |
+
|
348 |
+
return;
|
349 |
+
}
|
350 |
+
|
351 |
+
$developer_options = isset($wcps_options['developer_options']) ? $wcps_options['developer_options'] : array();
|
352 |
+
|
353 |
+
$query_orders = isset($wcps_options['query_orders']) ? $wcps_options['query_orders'] : array();
|
354 |
+
|
355 |
+
$posts_per_page = isset($query_orders['posts_per_page']) ? $query_orders['posts_per_page'] : 10;
|
356 |
+
$query_order = isset($query_orders['order']) ? $query_orders['order'] : 'DESC';
|
357 |
+
$query_orderby = isset($query_orders['orderby']) ? $query_orders['orderby'] : 'date';
|
358 |
+
$product_ids = isset($query_orders['post_ids']) ? $query_orders['post_ids'] : '';
|
359 |
+
|
360 |
+
//if(empty($post_id)) return;
|
361 |
+
$query_args = array();
|
362 |
+
|
363 |
+
$query_args['post_type'] = 'shop_order';
|
364 |
+
$query_args['post_status'] = 'any';
|
365 |
+
|
366 |
+
//echo '<pre>'.var_export($query_orderby, true).'</pre>';
|
367 |
+
|
368 |
+
|
369 |
+
|
370 |
+
//echo '<pre>'.var_export($query_orderby, true).'</pre>';
|
371 |
+
|
372 |
+
$query_args['orderby'] = $query_orderby;
|
373 |
+
|
374 |
+
$query_args['order'] = $query_order;
|
375 |
+
$query_args['posts_per_page'] = $posts_per_page;
|
376 |
+
|
377 |
+
|
378 |
+
|
379 |
+
|
380 |
+
if(!empty($product_ids)){
|
381 |
+
|
382 |
+
$product_ids = array_map('intval',explode(',', $product_ids));
|
383 |
+
$query_args['post__in'] = $product_ids;
|
384 |
+
}
|
385 |
+
|
386 |
+
|
387 |
+
$query_args = apply_filters('wcps_slider_query_args', $query_args, $args);
|
388 |
+
|
389 |
+
if(in_array('query_args', $developer_options)){
|
390 |
+
echo 'query_args: ############';
|
391 |
+
echo '<pre>'.var_export($query_args, true).'</pre>';
|
392 |
+
}
|
393 |
+
|
394 |
+
|
395 |
+
|
396 |
+
//echo '<pre>'.var_export($query_args, true).'</pre>';
|
397 |
+
$wcps_query = new WP_Query($query_args);
|
398 |
+
|
399 |
+
if(in_array('found_posts', $developer_options)){
|
400 |
+
|
401 |
+
echo 'found_posts: ############';
|
402 |
+
echo '<pre>'.var_export(((int) $wcps_query->found_posts), true).'</pre>';
|
403 |
+
}
|
404 |
+
|
405 |
+
|
406 |
+
|
407 |
+
if ( $wcps_query->have_posts() ) :
|
408 |
+
|
409 |
+
$wcps_items_class = apply_filters('wcps_items_wrapper_class', 'wcps-items owl-carousel owl-theme', $args);
|
410 |
+
|
411 |
+
do_action('wcps_slider_before_items', $wcps_query, $args);
|
412 |
+
|
413 |
+
?>
|
414 |
+
<div id="wcps-<?php echo $wcps_id; ?>" class="<?php echo $wcps_items_class; ?>">
|
415 |
+
<?php
|
416 |
+
|
417 |
+
$loop_count = 1;
|
418 |
+
while ( $wcps_query->have_posts() ) : $wcps_query->the_post();
|
419 |
+
|
420 |
+
$product_id = get_the_id();
|
421 |
+
$args['post_id'] = $product_id;
|
422 |
+
$args['loop_count'] = $loop_count;
|
423 |
+
|
424 |
+
|
425 |
+
|
426 |
+
//echo '<pre>'.var_export($product_id, true).'</pre>';
|
427 |
+
do_action('wcps_slider_item_order', $args);
|
428 |
+
|
429 |
+
$loop_count++;
|
430 |
+
endwhile;
|
431 |
+
|
432 |
+
wp_reset_query();
|
433 |
+
?>
|
434 |
+
</div>
|
435 |
+
|
436 |
+
<?php
|
437 |
+
|
438 |
+
|
439 |
+
do_action('wcps_slider_after_items', $wcps_query, $args);
|
440 |
+
|
441 |
+
?>
|
442 |
+
|
443 |
+
<?php
|
444 |
+
else:
|
445 |
+
do_action('wcps_slider_no_item');
|
446 |
+
endif;
|
447 |
+
|
448 |
+
|
449 |
+
}
|
450 |
+
|
451 |
+
|
452 |
+
|
453 |
+
add_action('wcps_slider_item_order', 'wcps_slider_item_order', 10);
|
454 |
+
|
455 |
+
function wcps_slider_item_order($args){
|
456 |
+
|
457 |
+
$first_term_id = (int) wcps_get_first_category_id();
|
458 |
+
|
459 |
+
$wcps_id = isset($args['wcps_id']) ? $args['wcps_id'] : '';
|
460 |
+
$post_id = isset($args['post_id']) ? $args['post_id'] : $first_term_id;
|
461 |
+
|
462 |
+
$wcps_options = get_post_meta( $wcps_id, 'wcps_options', true );
|
463 |
+
$item_layout_id = isset($wcps_options['item_layout_id']) ? $wcps_options['item_layout_id'] : wcps_first_wcps_layout();
|
464 |
+
$layout_elements_data = get_post_meta( $item_layout_id, 'layout_elements_data', true );
|
465 |
+
|
466 |
+
$wcps_item_class = apply_filters('wcps_slider_item_class', 'item ', $args);
|
467 |
+
|
468 |
+
?>
|
469 |
+
<div class="<?php echo $wcps_item_class; ?>">
|
470 |
+
<div class="elements-wrapper layout-<?php echo $item_layout_id; ?>">
|
471 |
+
<?php
|
472 |
+
if(!empty($layout_elements_data))
|
473 |
+
foreach ($layout_elements_data as $elementGroupIndex => $elementGroupData){
|
474 |
+
|
475 |
+
if(!empty($elementGroupData))
|
476 |
+
foreach ($elementGroupData as $elementIndex => $elementData){
|
477 |
+
|
478 |
+
$args['elementData'] = $elementData;
|
479 |
+
$args['element_index'] = $elementGroupIndex;
|
480 |
+
|
481 |
+
//echo '<pre>'.var_export($elementIndex, true).'</pre>';
|
482 |
+
|
483 |
+
do_action('wcps_layout_element_'.$elementIndex, $args);
|
484 |
+
}
|
485 |
+
}
|
486 |
+
?>
|
487 |
+
</div>
|
488 |
+
</div>
|
489 |
+
<?php
|
490 |
+
|
491 |
+
}
|
492 |
+
|
493 |
+
|
494 |
+
|
495 |
+
|
496 |
+
|
497 |
+
|
498 |
+
add_action('wcps_slider_main', 'wcps_slider_main_items_dokan_vendors', 20);
|
499 |
+
|
500 |
+
function wcps_slider_main_items_dokan_vendors($args){
|
501 |
+
|
502 |
+
|
503 |
+
$wcps_id = isset($args['wcps_id']) ? (int) $args['wcps_id'] : 0;
|
504 |
+
$wcps_options = get_post_meta( $wcps_id, 'wcps_options', true );
|
505 |
+
$slider_for = isset($wcps_options['slider_for']) ? $wcps_options['slider_for'] : 'products';
|
506 |
+
if($slider_for != 'dokan_vendors') return;
|
507 |
+
|
508 |
+
$item_layout_id = isset($wcps_options['item_layout_id']) ? $wcps_options['item_layout_id'] : wcps_first_wcps_layout();
|
509 |
+
|
510 |
+
if(empty($item_layout_id)){
|
511 |
+
|
512 |
+
?><i class="far fa-times-circle"></i> Please create a <a target="_blank" href="<?php echo admin_url(); ?>post-new.php?post_type=wcps_layout">layout</a> first. watch this video to learn <a href="https://www.youtube.com/watch?v=_HMHaSjjHdo&list=PL0QP7T2SN94bgierw1J8Qn3sf4mZo7F9f&index=8&t=0s">customize layouts</a>
|
513 |
+
<?php
|
514 |
+
|
515 |
+
return;
|
516 |
+
}
|
517 |
+
|
518 |
+
$developer_options = isset($wcps_options['developer_options']) ? $wcps_options['developer_options'] : array();
|
519 |
+
|
520 |
+
$dokan_vendors_query = isset($wcps_options['dokan_vendors_query']) ? $wcps_options['dokan_vendors_query'] : array();
|
521 |
+
|
522 |
+
$posts_per_page = isset($dokan_vendors_query['posts_per_page']) ? $dokan_vendors_query['posts_per_page'] : 10;
|
523 |
+
$query_order = isset($dokan_vendors_query['order']) ? $dokan_vendors_query['order'] : 'DESC';
|
524 |
+
$query_orderby = isset($dokan_vendors_query['orderby']) ? $dokan_vendors_query['orderby'] : 'date';
|
525 |
+
$product_ids = isset($dokan_vendors_query['post_ids']) ? $dokan_vendors_query['post_ids'] : '';
|
526 |
+
|
527 |
+
//if(empty($post_id)) return;
|
528 |
+
$query_args = array();
|
529 |
+
|
530 |
+
//$query_args['role__in'] = array('shop_vendor');
|
531 |
+
$query_args['orderby'] = $query_orderby;
|
532 |
+
$query_args['order'] = $query_order;
|
533 |
+
$query_args['number'] = $posts_per_page;
|
534 |
+
|
535 |
+
|
536 |
+
|
537 |
+
|
538 |
+
|
539 |
+
|
540 |
+
|
541 |
+
|
542 |
+
$query_args = apply_filters('wcps_slider_query_dokan_vendors_args', $query_args, $args);
|
543 |
+
|
544 |
+
|
545 |
+
|
546 |
+
|
547 |
+
|
548 |
+
$authors = get_users($query_args);
|
549 |
+
//$authors = $wp_user_query->get_results();
|
550 |
+
|
551 |
+
//echo '<pre>'.var_export($authors, true).'</pre>';
|
552 |
+
|
553 |
+
if ( !empty($authors) ) :
|
554 |
+
|
555 |
+
$wcps_items_class = apply_filters('wcps_items_wrapper_class', 'wcps-items owl-carousel owl-theme', $args);
|
556 |
+
|
557 |
+
|
558 |
+
?>
|
559 |
+
<div id="wcps-<?php echo $wcps_id; ?>" class="<?php echo $wcps_items_class; ?>">
|
560 |
+
<?php
|
561 |
+
|
562 |
+
$loop_count = 1;
|
563 |
+
foreach ($authors as $author){
|
564 |
+
|
565 |
+
$args['user_id'] = $author->ID;
|
566 |
+
$args['loop_count'] = $loop_count;
|
567 |
+
|
568 |
+
//echo '<pre>'.var_export($product_id, true).'</pre>';
|
569 |
+
do_action('wcps_slider_item_dokan_vendor', $args);
|
570 |
+
|
571 |
+
$loop_count++;
|
572 |
+
}
|
573 |
+
|
574 |
+
?>
|
575 |
+
</div>
|
576 |
+
|
577 |
+
<?php
|
578 |
+
else:
|
579 |
+
do_action('wcps_slider_no_item');
|
580 |
+
endif;
|
581 |
+
|
582 |
+
|
583 |
+
}
|
584 |
+
|
585 |
+
|
586 |
+
|
587 |
+
add_action('wcps_slider_item_dokan_vendor', 'wcps_slider_item_dokan_vendors', 10);
|
588 |
+
|
589 |
+
function wcps_slider_item_dokan_vendors($args){
|
590 |
+
|
591 |
+
$first_user_id = (int) wcps_get_first_dokan_vendor_id();
|
592 |
+
|
593 |
+
$wcps_id = isset($args['wcps_id']) ? $args['wcps_id'] : $first_user_id;
|
594 |
+
$user_id = isset($args['user_id']) ? $args['user_id'] : '';
|
595 |
+
|
596 |
+
$wcps_options = get_post_meta( $wcps_id, 'wcps_options', true );
|
597 |
+
$item_layout_id = isset($wcps_options['item_layout_id']) ? $wcps_options['item_layout_id'] : wcps_first_wcps_layout();
|
598 |
+
$layout_elements_data = get_post_meta( $item_layout_id, 'layout_elements_data', true );
|
599 |
+
|
600 |
+
$wcps_item_class = apply_filters('wcps_slider_item_class', 'item ', $args);
|
601 |
+
|
602 |
+
//echo '<pre>'.var_export($user_id, true).'</pre>';
|
603 |
+
|
604 |
+
?>
|
605 |
+
<div class="<?php echo $wcps_item_class; ?>">
|
606 |
+
<div class="elements-wrapper layout-<?php echo $item_layout_id; ?>">
|
607 |
+
<?php
|
608 |
+
if(!empty($layout_elements_data))
|
609 |
+
foreach ($layout_elements_data as $elementGroupIndex => $elementGroupData){
|
610 |
+
|
611 |
+
if(!empty($elementGroupData))
|
612 |
+
foreach ($elementGroupData as $elementIndex => $elementData){
|
613 |
+
|
614 |
+
$args['elementData'] = $elementData;
|
615 |
+
$args['element_index'] = $elementGroupIndex;
|
616 |
+
|
617 |
+
do_action('wcps_layout_element_'.$elementIndex, $args);
|
618 |
+
}
|
619 |
+
}
|
620 |
+
?>
|
621 |
+
</div>
|
622 |
+
</div>
|
623 |
+
<?php
|
624 |
+
|
625 |
+
}
|
626 |
+
|
627 |
+
|
628 |
+
|
629 |
+
|
630 |
+
|
631 |
+
|
632 |
+
|
633 |
+
|
634 |
+
|
635 |
+
|
636 |
+
|
637 |
+
|
638 |
+
add_action('wcps_slider_main', 'wcps_slider_main_items_categories', 20);
|
639 |
+
|
640 |
+
function wcps_slider_main_items_categories($args){
|
641 |
+
|
642 |
+
|
643 |
+
$wcps_id = isset($args['wcps_id']) ? (int) $args['wcps_id'] : 0;
|
644 |
+
$wcps_options = get_post_meta( $wcps_id, 'wcps_options', true );
|
645 |
+
$slider_for = isset($wcps_options['slider_for']) ? $wcps_options['slider_for'] : 'products';
|
646 |
+
if($slider_for != 'categories') return;
|
647 |
+
|
648 |
+
$item_layout_id = isset($wcps_options['item_layout_id']) ? $wcps_options['item_layout_id'] : wcps_first_wcps_layout();
|
649 |
+
|
650 |
+
$query = !empty($wcps_options['query_categories']) ? $wcps_options['query_categories'] : array();
|
651 |
+
$taxonomies = !empty($query['taxonomies']) ? $query['taxonomies'] : array();
|
652 |
+
|
653 |
+
if(empty($item_layout_id)){
|
654 |
+
|
655 |
+
?><i class="far fa-times-circle"></i> Please create a <a target="_blank" href="<?php echo admin_url(); ?>post-new.php?post_type=wcps_layout">layout</a> first. watch this video to learn <a href="https://www.youtube.com/watch?v=_HMHaSjjHdo&list=PL0QP7T2SN94bgierw1J8Qn3sf4mZo7F9f&index=8&t=0s">customize layouts</a>
|
656 |
+
<?php
|
657 |
+
|
658 |
+
return;
|
659 |
+
}
|
660 |
+
|
661 |
+
|
662 |
+
|
663 |
+
$terms_list = array();
|
664 |
+
$loop_count = 0;
|
665 |
+
|
666 |
+
if(!empty($taxonomies) && is_array($taxonomies)):
|
667 |
+
|
668 |
+
$wcps_items_class = apply_filters('wcps_items_wrapper_class', 'wcps-items owl-carousel owl-theme', $args);
|
669 |
+
|
670 |
+
?>
|
671 |
+
<div id="wcps-<?php echo $wcps_id; ?>" class="<?php echo $wcps_items_class; ?>">
|
672 |
+
<?php
|
673 |
+
|
674 |
+
foreach ($taxonomies as $taxonomy){
|
675 |
+
$terms = isset($taxonomy['terms']) ? $taxonomy['terms'] : array();
|
676 |
+
foreach ( $terms as $terms_id){
|
677 |
+
//$terms_list[] = $terms_id;
|
678 |
+
|
679 |
+
$args['term_id'] = $terms_id;
|
680 |
+
$args['loop_count'] = $loop_count;
|
681 |
+
|
682 |
+
do_action('wcps_slider_item_term', $args);
|
683 |
+
|
684 |
+
$loop_count++;
|
685 |
+
}
|
686 |
+
}
|
687 |
+
|
688 |
+
?>
|
689 |
+
</div>
|
690 |
+
<?php
|
691 |
+
|
692 |
+
else:
|
693 |
+
do_action('wcps_slider_no_item');
|
694 |
+
endif;
|
695 |
+
|
696 |
+
|
697 |
+
//echo '<pre>'.var_export($terms_list, true).'</pre>';
|
698 |
+
|
699 |
+
|
700 |
+
}
|
701 |
+
|
702 |
+
|
703 |
+
|
704 |
+
add_action('wcps_slider_item_term', 'wcps_slider_item_term', 10);
|
705 |
+
|
706 |
+
function wcps_slider_item_term($args){
|
707 |
+
|
708 |
+
$first_term_id = (int) wcps_get_first_category_id();
|
709 |
+
|
710 |
+
$wcps_id = isset($args['wcps_id']) ? $args['wcps_id'] : '';
|
711 |
+
$term_id = isset($args['term_id']) ? $args['term_id'] : $first_term_id;
|
712 |
+
|
713 |
+
$wcps_options = get_post_meta( $wcps_id, 'wcps_options', true );
|
714 |
+
$item_layout_id = isset($wcps_options['item_layout_id']) ? $wcps_options['item_layout_id'] : wcps_first_wcps_layout();
|
715 |
+
$layout_elements_data = get_post_meta( $item_layout_id, 'layout_elements_data', true );
|
716 |
+
|
717 |
+
$wcps_item_class = apply_filters('wcps_slider_item_class', 'item ', $args);
|
718 |
+
|
719 |
+
?>
|
720 |
+
<div class="<?php echo $wcps_item_class; ?>">
|
721 |
+
<div class="elements-wrapper layout-<?php echo $item_layout_id; ?>">
|
722 |
+
<?php
|
723 |
+
if(!empty($layout_elements_data))
|
724 |
+
foreach ($layout_elements_data as $elementGroupIndex => $elementGroupData){
|
725 |
+
|
726 |
+
if(!empty($elementGroupData))
|
727 |
+
foreach ($elementGroupData as $elementIndex => $elementData){
|
728 |
+
|
729 |
+
$args['elementData'] = $elementData;
|
730 |
+
$args['element_index'] = $elementGroupIndex;
|
731 |
+
|
732 |
+
//echo '<pre>'.var_export($elementIndex, true).'</pre>';
|
733 |
+
|
734 |
+
do_action('wcps_layout_element_'.$elementIndex, $args);
|
735 |
+
}
|
736 |
+
}
|
737 |
+
?>
|
738 |
+
</div>
|
739 |
+
</div>
|
740 |
+
<?php
|
741 |
+
|
742 |
+
}
|
743 |
+
|
744 |
+
|
745 |
+
|
746 |
+
|
747 |
+
|
748 |
+
|
749 |
+
|
750 |
+
|
751 |
+
|
752 |
+
|
753 |
+
|
754 |
+
|
755 |
+
|
756 |
+
|
757 |
+
|
758 |
add_filter('wcps_slider_main', 'wcps_slider_main_scripts', 90);
|
759 |
|
760 |
function wcps_slider_main_scripts( $args){
|
woocommerce-products-slider.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: PickPlugins Product Slider for WooCommerce
|
4 |
Plugin URI: http://pickplugins.com/items/woocommerce-product-slider-for-wordpress/
|
5 |
Description: Fully responsive and mobile ready Carousel Slider for your WooCommerce product. unlimited slider anywhere via short-codes and easy admin setting.
|
6 |
-
Version: 1.13.
|
7 |
WC requires at least: 3.0.0
|
8 |
WC tested up to: 4.0
|
9 |
Author: PickPlugins
|
@@ -23,7 +23,7 @@ class WoocommerceProductsSlider{
|
|
23 |
define('wcps_plugin_url', plugins_url('/', __FILE__) );
|
24 |
define('wcps_plugin_dir', plugin_dir_path( __FILE__ ) );
|
25 |
define('wcps_plugin_name', 'PickPlugins Product Slider' );
|
26 |
-
define('wcps_plugin_version', '1.13.
|
27 |
|
28 |
require_once( wcps_plugin_dir . 'includes/class-post-types.php');
|
29 |
require_once( wcps_plugin_dir . 'includes/class-metabox-wcps.php');
|
@@ -133,8 +133,7 @@ class WoocommerceProductsSlider{
|
|
133 |
wp_register_style('animate', wcps_plugin_url.'assets/front/css/animate.css');
|
134 |
|
135 |
|
136 |
-
|
137 |
-
}
|
138 |
|
139 |
public function _admin_scripts(){
|
140 |
|
@@ -142,22 +141,17 @@ class WoocommerceProductsSlider{
|
|
142 |
wp_register_style('font-awesome-4', wcps_plugin_url.'assets/global/css/font-awesome-4.css');
|
143 |
wp_register_style('font-awesome-5', wcps_plugin_url.'assets/global/css/font-awesome-5.css');
|
144 |
|
145 |
-
wp_register_script('codemirror', wcps_plugin_url.'assets/admin/js/codemirror.js' , array( 'jquery' ));
|
146 |
-
wp_register_style('codemirror', wcps_plugin_url.'assets/admin/css/codemirror.css');
|
147 |
-
|
148 |
wp_register_style('settings-tabs', wcps_plugin_url.'assets/settings-tabs/settings-tabs.css');
|
149 |
wp_register_script('settings-tabs', wcps_plugin_url.'assets/settings-tabs/settings-tabs.js' , array( 'jquery' ));
|
150 |
|
|
|
|
|
151 |
|
152 |
|
153 |
-
|
154 |
-
wp_localize_script('jquery', 'cm_settings', $cm_settings);
|
155 |
-
wp_enqueue_script('wp-theme-plugin-editor');
|
156 |
-
|
157 |
|
158 |
|
159 |
-
|
160 |
|
161 |
-
}
|
162 |
|
163 |
-
|
3 |
Plugin Name: PickPlugins Product Slider for WooCommerce
|
4 |
Plugin URI: http://pickplugins.com/items/woocommerce-product-slider-for-wordpress/
|
5 |
Description: Fully responsive and mobile ready Carousel Slider for your WooCommerce product. unlimited slider anywhere via short-codes and easy admin setting.
|
6 |
+
Version: 1.13.10
|
7 |
WC requires at least: 3.0.0
|
8 |
WC tested up to: 4.0
|
9 |
Author: PickPlugins
|
23 |
define('wcps_plugin_url', plugins_url('/', __FILE__) );
|
24 |
define('wcps_plugin_dir', plugin_dir_path( __FILE__ ) );
|
25 |
define('wcps_plugin_name', 'PickPlugins Product Slider' );
|
26 |
+
define('wcps_plugin_version', '1.13.10' );
|
27 |
|
28 |
require_once( wcps_plugin_dir . 'includes/class-post-types.php');
|
29 |
require_once( wcps_plugin_dir . 'includes/class-metabox-wcps.php');
|
133 |
wp_register_style('animate', wcps_plugin_url.'assets/front/css/animate.css');
|
134 |
|
135 |
|
136 |
+
}
|
|
|
137 |
|
138 |
public function _admin_scripts(){
|
139 |
|
141 |
wp_register_style('font-awesome-4', wcps_plugin_url.'assets/global/css/font-awesome-4.css');
|
142 |
wp_register_style('font-awesome-5', wcps_plugin_url.'assets/global/css/font-awesome-5.css');
|
143 |
|
|
|
|
|
|
|
144 |
wp_register_style('settings-tabs', wcps_plugin_url.'assets/settings-tabs/settings-tabs.css');
|
145 |
wp_register_script('settings-tabs', wcps_plugin_url.'assets/settings-tabs/settings-tabs.js' , array( 'jquery' ));
|
146 |
|
147 |
+
$settings_tabs_field = new settings_tabs_field();
|
148 |
+
$settings_tabs_field->admin_scripts();
|
149 |
|
150 |
|
151 |
+
}
|
|
|
|
|
|
|
152 |
|
153 |
|
154 |
+
}
|
155 |
|
|
|
156 |
|
157 |
+
new WoocommerceProductsSlider();
|