Version Description
- Update - Styles for plugin settings page
- Dev - Add aws_search_results_tax_archives filter
- Dev - Clear code for all unused stuff
Download this release
Release Info
Developer | Mihail Barinov |
Plugin | Advanced Woo Search |
Version | 1.68 |
Comparing to | |
See all releases |
Code changes from version 1.67 to 1.68
- advanced-woo-search.php +4 -3
- assets/css/admin.css +4 -0
- assets/js/common.js +21 -30
- includes/class-aws-admin-fields.php +279 -0
- includes/class-aws-admin.php +7 -242
- includes/class-aws-helpers.php +29 -0
- includes/class-aws-search.php +30 -27
- includes/class-aws-table.php +2 -31
- readme.txt +7 -1
advanced-woo-search.php
CHANGED
@@ -3,12 +3,12 @@
|
|
3 |
/*
|
4 |
Plugin Name: Advanced Woo Search
|
5 |
Description: Advance ajax WooCommerce product search.
|
6 |
-
Version: 1.
|
7 |
Author: ILLID
|
8 |
Author URI: https://advanced-woo-search.com/
|
9 |
Text Domain: aws
|
10 |
WC requires at least: 3.0.0
|
11 |
-
WC tested up to: 3.
|
12 |
*/
|
13 |
|
14 |
|
@@ -16,7 +16,7 @@ if ( ! defined( 'ABSPATH' ) ) {
|
|
16 |
exit;
|
17 |
}
|
18 |
|
19 |
-
define( 'AWS_VERSION', '1.
|
20 |
|
21 |
|
22 |
define( 'AWS_DIR', dirname( __FILE__ ) );
|
@@ -102,6 +102,7 @@ final class AWS_Main {
|
|
102 |
public function includes() {
|
103 |
include_once( 'includes/class-aws-helpers.php' );
|
104 |
include_once( 'includes/class-aws-versions.php' );
|
|
|
105 |
include_once( 'includes/class-aws-admin.php' );
|
106 |
include_once( 'includes/class-aws-cache.php' );
|
107 |
include_once( 'includes/class-aws-table.php' );
|
3 |
/*
|
4 |
Plugin Name: Advanced Woo Search
|
5 |
Description: Advance ajax WooCommerce product search.
|
6 |
+
Version: 1.68
|
7 |
Author: ILLID
|
8 |
Author URI: https://advanced-woo-search.com/
|
9 |
Text Domain: aws
|
10 |
WC requires at least: 3.0.0
|
11 |
+
WC tested up to: 3.6.0
|
12 |
*/
|
13 |
|
14 |
|
16 |
exit;
|
17 |
}
|
18 |
|
19 |
+
define( 'AWS_VERSION', '1.68' );
|
20 |
|
21 |
|
22 |
define( 'AWS_DIR', dirname( __FILE__ ) );
|
102 |
public function includes() {
|
103 |
include_once( 'includes/class-aws-helpers.php' );
|
104 |
include_once( 'includes/class-aws-versions.php' );
|
105 |
+
include_once( 'includes/class-aws-admin-fields.php' );
|
106 |
include_once( 'includes/class-aws-admin.php' );
|
107 |
include_once( 'includes/class-aws-cache.php' );
|
108 |
include_once( 'includes/class-aws-table.php' );
|
assets/css/admin.css
CHANGED
@@ -87,6 +87,10 @@
|
|
87 |
display: inline-block;
|
88 |
}
|
89 |
|
|
|
|
|
|
|
|
|
90 |
/* Image select option */
|
91 |
#aws_form .img-select {
|
92 |
position: relative;
|
87 |
display: inline-block;
|
88 |
}
|
89 |
|
90 |
+
#aws_form .aws-heading {
|
91 |
+
margin-right: -40px;
|
92 |
+
}
|
93 |
+
|
94 |
/* Image select option */
|
95 |
#aws_form .img-select {
|
96 |
position: relative;
|
assets/js/common.js
CHANGED
@@ -110,42 +110,31 @@
|
|
110 |
|
111 |
showResults: function( response ) {
|
112 |
|
|
|
113 |
var html = '<ul>';
|
114 |
|
|
|
115 |
|
116 |
-
|
117 |
|
118 |
-
|
|
|
119 |
|
120 |
-
|
121 |
-
html += '<a class="aws_result_link" href="' + result.link + '" >';
|
122 |
-
html += '<span class="aws_result_content">';
|
123 |
-
html += '<span class="aws_result_title">';
|
124 |
-
html += result.name;
|
125 |
-
html += '<span class="aws_result_count"> (' + result.count + ')</span>';
|
126 |
-
html += '</span>';
|
127 |
-
html += '</span>';
|
128 |
-
html += '</a>';
|
129 |
-
html += '</li>';
|
130 |
-
|
131 |
-
});
|
132 |
-
|
133 |
-
}
|
134 |
|
135 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
136 |
|
137 |
-
|
138 |
-
|
139 |
-
html += '<li class="aws_result_item aws_result_tag">';
|
140 |
-
html += '<a class="aws_result_link" href="' + result.link + '" >';
|
141 |
-
html += '<span class="aws_result_content">';
|
142 |
-
html += '<span class="aws_result_title">';
|
143 |
-
html += result.name;
|
144 |
-
html += '<span class="aws_result_count"> (' + result.count + ')</span>';
|
145 |
-
html += '</span>';
|
146 |
-
html += '</span>';
|
147 |
-
html += '</a>';
|
148 |
-
html += '</li>';
|
149 |
|
150 |
});
|
151 |
|
@@ -155,6 +144,8 @@
|
|
155 |
|
156 |
$.each(response.products, function (i, result) {
|
157 |
|
|
|
|
|
158 |
html += '<li class="aws_result_item">';
|
159 |
html += '<a class="aws_result_link" href="' + result.link + '" >';
|
160 |
|
@@ -213,7 +204,7 @@
|
|
213 |
|
214 |
}
|
215 |
|
216 |
-
if (
|
217 |
html += '<li class="aws_result_item aws_no_result">' + translate.noresults + '</li>';
|
218 |
}
|
219 |
|
110 |
|
111 |
showResults: function( response ) {
|
112 |
|
113 |
+
var resultNum = 0;
|
114 |
var html = '<ul>';
|
115 |
|
116 |
+
if ( typeof response.tax !== 'undefined' ) {
|
117 |
|
118 |
+
$.each(response.tax, function (i, taxes) {
|
119 |
|
120 |
+
if ( ( typeof taxes !== 'undefined' ) && taxes.length > 0 ) {
|
121 |
+
$.each(taxes, function (i, taxitem) {
|
122 |
|
123 |
+
resultNum++;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
124 |
|
125 |
+
html += '<li class="aws_result_item aws_result_tag">';
|
126 |
+
html += '<a class="aws_result_link" href="' + taxitem.link + '" >';
|
127 |
+
html += '<span class="aws_result_content">';
|
128 |
+
html += '<span class="aws_result_title">';
|
129 |
+
html += taxitem.name;
|
130 |
+
html += '<span class="aws_result_count"> (' + taxitem.count + ')</span>';
|
131 |
+
html += '</span>';
|
132 |
+
html += '</span>';
|
133 |
+
html += '</a>';
|
134 |
+
html += '</li>';
|
135 |
|
136 |
+
});
|
137 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
138 |
|
139 |
});
|
140 |
|
144 |
|
145 |
$.each(response.products, function (i, result) {
|
146 |
|
147 |
+
resultNum++;
|
148 |
+
|
149 |
html += '<li class="aws_result_item">';
|
150 |
html += '<a class="aws_result_link" href="' + result.link + '" >';
|
151 |
|
204 |
|
205 |
}
|
206 |
|
207 |
+
if ( ! resultNum ) {
|
208 |
html += '<li class="aws_result_item aws_no_result">' + translate.noresults + '</li>';
|
209 |
}
|
210 |
|
includes/class-aws-admin-fields.php
ADDED
@@ -0,0 +1,279 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
4 |
+
exit;
|
5 |
+
}
|
6 |
+
|
7 |
+
if ( ! class_exists( 'AWS_Admin_Fields' ) ) :
|
8 |
+
|
9 |
+
/**
|
10 |
+
* Class for plugin admin ajax hooks
|
11 |
+
*/
|
12 |
+
class AWS_Admin_Fields {
|
13 |
+
|
14 |
+
/**
|
15 |
+
* @var AWS_Admin_Fields The array of options that is need to be generated
|
16 |
+
*/
|
17 |
+
private $options_array;
|
18 |
+
|
19 |
+
/**
|
20 |
+
* @var AWS_Admin_Fields Current plugin instance options
|
21 |
+
*/
|
22 |
+
private $plugin_options;
|
23 |
+
|
24 |
+
/*
|
25 |
+
* Constructor
|
26 |
+
*/
|
27 |
+
public function __construct( $options ) {
|
28 |
+
|
29 |
+
$this->options_array = $options;
|
30 |
+
$this->plugin_options = get_option( 'aws_settings' );
|
31 |
+
|
32 |
+
$this->generate_fields();
|
33 |
+
|
34 |
+
}
|
35 |
+
|
36 |
+
/*
|
37 |
+
* Generate options fields
|
38 |
+
*/
|
39 |
+
private function generate_fields() {
|
40 |
+
|
41 |
+
if ( empty( $this->options_array ) ) {
|
42 |
+
return;
|
43 |
+
}
|
44 |
+
|
45 |
+
$plugin_options = $this->plugin_options;
|
46 |
+
|
47 |
+
echo '<table class="form-table">';
|
48 |
+
echo '<tbody>';
|
49 |
+
|
50 |
+
foreach ( $this->options_array as $k => $value ) {
|
51 |
+
|
52 |
+
switch ( $value['type'] ) {
|
53 |
+
|
54 |
+
case 'text': ?>
|
55 |
+
<tr valign="top">
|
56 |
+
<th scope="row"><?php echo $value['name']; ?></th>
|
57 |
+
<td>
|
58 |
+
<input type="text" name="<?php echo $value['id']; ?>" class="regular-text" value="<?php echo isset( $plugin_options[ $value['id'] ] ) ? stripslashes( $plugin_options[ $value['id'] ] ) : ''; ?>">
|
59 |
+
<br><span class="description"><?php echo $value['desc']; ?></span>
|
60 |
+
</td>
|
61 |
+
</tr>
|
62 |
+
<?php break;
|
63 |
+
|
64 |
+
case 'image': ?>
|
65 |
+
<tr valign="top">
|
66 |
+
<th scope="row"><?php echo $value['name']; ?></th>
|
67 |
+
<td>
|
68 |
+
<input type="text" name="<?php echo $value['id']; ?>" class="regular-text" value="<?php echo stripslashes( $plugin_options[ $value['id'] ] ); ?>">
|
69 |
+
<br><span class="description"><?php echo $value['desc']; ?></span>
|
70 |
+
<img style="display: block;max-width: 100px;margin-top: 20px;" src="<?php echo stripslashes( $plugin_options[ $value['id'] ] ); ?>">
|
71 |
+
</td>
|
72 |
+
</tr>
|
73 |
+
<?php break;
|
74 |
+
|
75 |
+
case 'number': ?>
|
76 |
+
<tr valign="top">
|
77 |
+
<th scope="row"><?php echo $value['name']; ?></th>
|
78 |
+
<td>
|
79 |
+
<input type="number" name="<?php echo $value['id']; ?>" class="regular-text" value="<?php echo stripslashes( $plugin_options[ $value['id'] ] ); ?>">
|
80 |
+
<br><span class="description"><?php echo $value['desc']; ?></span>
|
81 |
+
</td>
|
82 |
+
</tr>
|
83 |
+
<?php break;
|
84 |
+
|
85 |
+
case 'textarea': ?>
|
86 |
+
<tr valign="top">
|
87 |
+
<th scope="row"><?php echo $value['name']; ?></th>
|
88 |
+
<td>
|
89 |
+
<textarea id="<?php echo $value['id']; ?>" name="<?php echo $value['id']; ?>" cols="65" rows="4"><?php print stripslashes( $plugin_options[ $value['id'] ] ); ?></textarea>
|
90 |
+
<br><span class="description"><?php echo $value['desc']; ?></span>
|
91 |
+
</td>
|
92 |
+
</tr>
|
93 |
+
<?php break;
|
94 |
+
|
95 |
+
case 'checkbox': ?>
|
96 |
+
<tr valign="top">
|
97 |
+
<th scope="row"><?php echo $value['name']; ?></th>
|
98 |
+
<td>
|
99 |
+
<?php $checkbox_options = $plugin_options[ $value['id'] ]; ?>
|
100 |
+
<?php foreach ( $value['choices'] as $val => $label ) { ?>
|
101 |
+
<input type="checkbox" name="<?php echo $value['id'] . '[' . $val . ']'; ?>" id="<?php echo $value['id'] . '_' . $val; ?>" value="1" <?php checked( $checkbox_options[$val], '1' ); ?>> <label for="<?php echo $value['id'] . '_' . $val; ?>"><?php echo $label; ?></label><br>
|
102 |
+
<?php } ?>
|
103 |
+
<br><span class="description"><?php echo $value['desc']; ?></span>
|
104 |
+
</td>
|
105 |
+
</tr>
|
106 |
+
<?php break;
|
107 |
+
|
108 |
+
case 'radio': ?>
|
109 |
+
<tr valign="top">
|
110 |
+
<th scope="row"><?php echo $value['name']; ?></th>
|
111 |
+
<td>
|
112 |
+
<?php foreach ( $value['choices'] as $val => $label ) { ?>
|
113 |
+
<input class="radio" type="radio" name="<?php echo $value['id']; ?>" id="<?php echo $value['id'].$val; ?>" value="<?php echo $val; ?>" <?php checked( $plugin_options[ $value['id'] ], $val ); ?>> <label for="<?php echo $value['id'].$val; ?>"><?php echo $label; ?></label><br>
|
114 |
+
<?php } ?>
|
115 |
+
<br><span class="description"><?php echo $value['desc']; ?></span>
|
116 |
+
</td>
|
117 |
+
</tr>
|
118 |
+
<?php break;
|
119 |
+
|
120 |
+
case 'select': ?>
|
121 |
+
<tr valign="top">
|
122 |
+
<th scope="row"><?php echo $value['name']; ?></th>
|
123 |
+
<td>
|
124 |
+
<select name="<?php echo $value['id']; ?>">
|
125 |
+
<?php foreach ( $value['choices'] as $val => $label ) { ?>
|
126 |
+
<option value="<?php echo $val; ?>" <?php selected( $plugin_options[ $value['id'] ], $val ); ?>><?php echo $label; ?></option>
|
127 |
+
<?php } ?>
|
128 |
+
</select>
|
129 |
+
<br><span class="description"><?php echo $value['desc']; ?></span>
|
130 |
+
</td>
|
131 |
+
</tr>
|
132 |
+
<?php break;
|
133 |
+
|
134 |
+
case 'select_advanced': ?>
|
135 |
+
<tr valign="top">
|
136 |
+
<th scope="row"><?php echo $value['name']; ?></th>
|
137 |
+
<td>
|
138 |
+
<select name="<?php echo $value['id'].'[]'; ?>" multiple class="chosen-select">
|
139 |
+
<?php $values = $plugin_options[ $value['id'] ]; ?>
|
140 |
+
<?php foreach ( $value['choices'] as $val => $label ) { ?>
|
141 |
+
<?php $selected = ( is_array( $values ) && in_array( $val, $values ) ) ? ' selected="selected" ' : ''; ?>
|
142 |
+
<option value="<?php echo $val; ?>"<?php echo $selected; ?>><?php echo $label; ?></option>
|
143 |
+
<?php } ?>
|
144 |
+
</select>
|
145 |
+
<br><span class="description"><?php echo $value['desc']; ?></span>
|
146 |
+
|
147 |
+
<?php if ( $value['sub_option'] ): ?>
|
148 |
+
<?php $sub_options = $value['sub_option']; ?>
|
149 |
+
<br><br>
|
150 |
+
<p>
|
151 |
+
<label for="<?php echo $sub_options['id']; ?>">
|
152 |
+
<input type="checkbox" value="1" id="<?php echo $sub_options['id']; ?>" name="<?php echo $sub_options['id']; ?>" <?php checked( $plugin_options[ $sub_options['id'] ], '1' ); ?>>
|
153 |
+
<?php echo $sub_options['desc']; ?>
|
154 |
+
</label>
|
155 |
+
</p>
|
156 |
+
<?php endif; ?>
|
157 |
+
|
158 |
+
</td>
|
159 |
+
</tr>
|
160 |
+
<?php break;
|
161 |
+
|
162 |
+
case 'radio-image': ?>
|
163 |
+
<tr valign="top">
|
164 |
+
<th scope="row"><?php echo $value['name']; ?></th>
|
165 |
+
<td>
|
166 |
+
<ul class="img-select">
|
167 |
+
<?php foreach ( $value['choices'] as $val => $img ) { ?>
|
168 |
+
<li class="option">
|
169 |
+
<input class="radio" type="radio" name="<?php echo $value['id']; ?>" id="<?php echo $value['id'].$val; ?>" value="<?php echo $val; ?>" <?php checked( $plugin_options[ $value['id'] ], $val ); ?>>
|
170 |
+
<span class="ico" style="background: url('<?php echo AWS_URL . '/assets/img/' . $img; ?>') no-repeat 50% 50%;"></span>
|
171 |
+
</li>
|
172 |
+
<?php } ?>
|
173 |
+
</ul>
|
174 |
+
<br><span class="description"><?php echo $value['desc']; ?></span>
|
175 |
+
</td>
|
176 |
+
</tr>
|
177 |
+
<?php break;
|
178 |
+
|
179 |
+
case 'sortable': ?>
|
180 |
+
<tr valign="top">
|
181 |
+
<th scope="row"><?php echo $value['name']; ?></th>
|
182 |
+
<td>
|
183 |
+
|
184 |
+
<script>
|
185 |
+
jQuery(document).ready(function() {
|
186 |
+
|
187 |
+
jQuery( "#sti-sortable1, #sti-sortable2" ).sortable({
|
188 |
+
connectWith: ".connectedSortable",
|
189 |
+
placeholder: "highlight",
|
190 |
+
update: function(event, ui){
|
191 |
+
var serviceList = '';
|
192 |
+
jQuery("#sti-sortable2 li").each(function(){
|
193 |
+
|
194 |
+
serviceList = serviceList + ',' + jQuery(this).attr('id');
|
195 |
+
|
196 |
+
});
|
197 |
+
var serviceListOut = serviceList.substring(1);
|
198 |
+
jQuery('#<?php echo $value['id']; ?>').attr('value', serviceListOut);
|
199 |
+
}
|
200 |
+
}).disableSelection();
|
201 |
+
|
202 |
+
});
|
203 |
+
</script>
|
204 |
+
|
205 |
+
<span class="description"><?php echo $value['desc']; ?></span><br><br>
|
206 |
+
|
207 |
+
<?php
|
208 |
+
$all_buttons = $value['choices'];
|
209 |
+
$active_buttons = explode( ',', $plugin_options[ $value['id'] ] );
|
210 |
+
$inactive_buttons = array_diff($all_buttons, $active_buttons);
|
211 |
+
?>
|
212 |
+
|
213 |
+
<div class="sortable-container">
|
214 |
+
|
215 |
+
<div class="sortable-title">
|
216 |
+
<?php _e( 'Active sources', 'aws' ) ?><br>
|
217 |
+
<?php _e( 'Change order by drag&drop', 'aws' ) ?>
|
218 |
+
</div>
|
219 |
+
|
220 |
+
<ul id="sti-sortable2" class="sti-sortable enabled connectedSortable">
|
221 |
+
<?php
|
222 |
+
if ( count( $active_buttons ) > 0 ) {
|
223 |
+
foreach ($active_buttons as $button) {
|
224 |
+
if ( ! $button ) continue;
|
225 |
+
echo '<li id="' . $button . '" class="sti-btn sti-' . $button . '-btn">' . $button . '</li>';
|
226 |
+
}
|
227 |
+
}
|
228 |
+
?>
|
229 |
+
</ul>
|
230 |
+
|
231 |
+
</div>
|
232 |
+
|
233 |
+
<div class="sortable-container">
|
234 |
+
|
235 |
+
<div class="sortable-title">
|
236 |
+
<?php _e( 'Deactivated sources', 'aws' ) ?><br>
|
237 |
+
<?php _e( 'Excluded from search results', 'aws' ) ?>
|
238 |
+
</div>
|
239 |
+
|
240 |
+
<ul id="sti-sortable1" class="sti-sortable disabled connectedSortable">
|
241 |
+
<?php
|
242 |
+
if ( count( $inactive_buttons ) > 0 ) {
|
243 |
+
foreach ($inactive_buttons as $button) {
|
244 |
+
echo '<li id="' . $button . '" class="sti-btn sti-' . $button . '-btn">' . $button . '</li>';
|
245 |
+
}
|
246 |
+
}
|
247 |
+
?>
|
248 |
+
</ul>
|
249 |
+
|
250 |
+
</div>
|
251 |
+
|
252 |
+
<input type="hidden" id="<?php echo $value['id']; ?>" name="<?php echo $value['id']; ?>" value="<?php echo $plugin_options[ $value['id'] ]; ?>" />
|
253 |
+
|
254 |
+
</td>
|
255 |
+
</tr>
|
256 |
+
<?php break;
|
257 |
+
|
258 |
+
case 'heading': ?>
|
259 |
+
<tr valign="top">
|
260 |
+
<th scope="row"><h3 class="aws-heading"><?php echo $value['name']; ?></h3></th>
|
261 |
+
</tr>
|
262 |
+
<?php break;
|
263 |
+
|
264 |
+
}
|
265 |
+
|
266 |
+
}
|
267 |
+
|
268 |
+
echo '</tbody>';
|
269 |
+
echo '</table>';
|
270 |
+
|
271 |
+
echo '<p class="submit"><input name="Submit" type="submit" class="button-primary" value="' . __( 'Save Changes', 'aws' ) . '" /></p>';
|
272 |
+
|
273 |
+
}
|
274 |
+
|
275 |
+
|
276 |
+
|
277 |
+
}
|
278 |
+
|
279 |
+
endif;
|
includes/class-aws-admin.php
CHANGED
@@ -137,265 +137,31 @@ class AWS_Admin {
|
|
137 |
|
138 |
echo '<form action="" name="aws_form" id="aws_form" method="post">';
|
139 |
|
140 |
-
echo '<table class="form-table">';
|
141 |
-
echo '<tbody>';
|
142 |
-
|
143 |
switch ($current_tab) {
|
144 |
case('form'):
|
145 |
-
|
146 |
break;
|
147 |
case('results'):
|
148 |
-
|
149 |
break;
|
150 |
default:
|
151 |
$this->update_table();
|
152 |
-
|
153 |
}
|
154 |
|
155 |
-
echo '</tbody>';
|
156 |
-
echo '</table>';
|
157 |
-
|
158 |
-
echo '<p class="submit"><input name="Submit" type="submit" class="button-primary" value="' . __( 'Save Changes', 'aws' ) . '" /></p>';
|
159 |
-
|
160 |
echo '</form>';
|
161 |
|
162 |
echo '</div>';
|
163 |
|
164 |
}
|
165 |
|
166 |
-
/**
|
167 |
-
* Generate options
|
168 |
-
*/
|
169 |
-
public function generate_options( $options ) {
|
170 |
-
|
171 |
-
$plugin_options = get_option( 'aws_settings' );
|
172 |
-
|
173 |
-
if ( empty( $options ) ) {
|
174 |
-
return;
|
175 |
-
}
|
176 |
-
|
177 |
-
foreach ( $options as $k => $value ) {
|
178 |
-
switch ( $value['type'] ) {
|
179 |
-
|
180 |
-
case 'text': ?>
|
181 |
-
<tr valign="top">
|
182 |
-
<th scope="row"><?php echo $value['name']; ?></th>
|
183 |
-
<td>
|
184 |
-
<input type="text" name="<?php echo $value['id']; ?>" class="regular-text" value="<?php echo isset( $plugin_options[ $value['id'] ] ) ? stripslashes( $plugin_options[ $value['id'] ] ) : ''; ?>">
|
185 |
-
<br><span class="description"><?php echo $value['desc']; ?></span>
|
186 |
-
</td>
|
187 |
-
</tr>
|
188 |
-
<?php break;
|
189 |
-
|
190 |
-
case 'image': ?>
|
191 |
-
<tr valign="top">
|
192 |
-
<th scope="row"><?php echo $value['name']; ?></th>
|
193 |
-
<td>
|
194 |
-
<input type="text" name="<?php echo $value['id']; ?>" class="regular-text" value="<?php echo stripslashes( $plugin_options[ $value['id'] ] ); ?>">
|
195 |
-
<br><span class="description"><?php echo $value['desc']; ?></span>
|
196 |
-
<img style="display: block;max-width: 100px;margin-top: 20px;" src="<?php echo stripslashes( $plugin_options[ $value['id'] ] ); ?>">
|
197 |
-
</td>
|
198 |
-
</tr>
|
199 |
-
<?php break;
|
200 |
-
|
201 |
-
case 'number': ?>
|
202 |
-
<tr valign="top">
|
203 |
-
<th scope="row"><?php echo $value['name']; ?></th>
|
204 |
-
<td>
|
205 |
-
<input type="number" name="<?php echo $value['id']; ?>" class="regular-text" value="<?php echo stripslashes( $plugin_options[ $value['id'] ] ); ?>">
|
206 |
-
<br><span class="description"><?php echo $value['desc']; ?></span>
|
207 |
-
</td>
|
208 |
-
</tr>
|
209 |
-
<?php break;
|
210 |
-
|
211 |
-
case 'textarea': ?>
|
212 |
-
<tr valign="top">
|
213 |
-
<th scope="row"><?php echo $value['name']; ?></th>
|
214 |
-
<td>
|
215 |
-
<textarea id="<?php echo $value['id']; ?>" name="<?php echo $value['id']; ?>" cols="65" rows="4"><?php print stripslashes( $plugin_options[ $value['id'] ] ); ?></textarea>
|
216 |
-
<br><span class="description"><?php echo $value['desc']; ?></span>
|
217 |
-
</td>
|
218 |
-
</tr>
|
219 |
-
<?php break;
|
220 |
-
|
221 |
-
case 'checkbox': ?>
|
222 |
-
<tr valign="top">
|
223 |
-
<th scope="row"><?php echo $value['name']; ?></th>
|
224 |
-
<td>
|
225 |
-
<?php $checkbox_options = $plugin_options[ $value['id'] ]; ?>
|
226 |
-
<?php foreach ( $value['choices'] as $val => $label ) { ?>
|
227 |
-
<input type="checkbox" name="<?php echo $value['id'] . '[' . $val . ']'; ?>" id="<?php echo $value['id'] . '_' . $val; ?>" value="1" <?php checked( $checkbox_options[$val], '1' ); ?>> <label for="<?php echo $value['id'] . '_' . $val; ?>"><?php echo $label; ?></label><br>
|
228 |
-
<?php } ?>
|
229 |
-
<br><span class="description"><?php echo $value['desc']; ?></span>
|
230 |
-
</td>
|
231 |
-
</tr>
|
232 |
-
<?php break;
|
233 |
-
|
234 |
-
case 'radio': ?>
|
235 |
-
<tr valign="top">
|
236 |
-
<th scope="row"><?php echo $value['name']; ?></th>
|
237 |
-
<td>
|
238 |
-
<?php foreach ( $value['choices'] as $val => $label ) { ?>
|
239 |
-
<input class="radio" type="radio" name="<?php echo $value['id']; ?>" id="<?php echo $value['id'].$val; ?>" value="<?php echo $val; ?>" <?php checked( $plugin_options[ $value['id'] ], $val ); ?>> <label for="<?php echo $value['id'].$val; ?>"><?php echo $label; ?></label><br>
|
240 |
-
<?php } ?>
|
241 |
-
<br><span class="description"><?php echo $value['desc']; ?></span>
|
242 |
-
</td>
|
243 |
-
</tr>
|
244 |
-
<?php break;
|
245 |
-
|
246 |
-
case 'select': ?>
|
247 |
-
<tr valign="top">
|
248 |
-
<th scope="row"><?php echo $value['name']; ?></th>
|
249 |
-
<td>
|
250 |
-
<select name="<?php echo $value['id']; ?>">
|
251 |
-
<?php foreach ( $value['choices'] as $val => $label ) { ?>
|
252 |
-
<option value="<?php echo $val; ?>" <?php selected( $plugin_options[ $value['id'] ], $val ); ?>><?php echo $label; ?></option>
|
253 |
-
<?php } ?>
|
254 |
-
</select>
|
255 |
-
<br><span class="description"><?php echo $value['desc']; ?></span>
|
256 |
-
</td>
|
257 |
-
</tr>
|
258 |
-
<?php break;
|
259 |
-
|
260 |
-
case 'select_advanced': ?>
|
261 |
-
<tr valign="top">
|
262 |
-
<th scope="row"><?php echo $value['name']; ?></th>
|
263 |
-
<td>
|
264 |
-
<select name="<?php echo $value['id'].'[]'; ?>" multiple class="chosen-select">
|
265 |
-
<?php $values = $plugin_options[ $value['id'] ]; ?>
|
266 |
-
<?php foreach ( $value['choices'] as $val => $label ) { ?>
|
267 |
-
<?php $selected = ( is_array( $values ) && in_array( $val, $values ) ) ? ' selected="selected" ' : ''; ?>
|
268 |
-
<option value="<?php echo $val; ?>"<?php echo $selected; ?>><?php echo $label; ?></option>
|
269 |
-
<?php } ?>
|
270 |
-
</select>
|
271 |
-
<br><span class="description"><?php echo $value['desc']; ?></span>
|
272 |
-
|
273 |
-
<?php if ( $value['sub_option'] ): ?>
|
274 |
-
<?php $sub_options = $value['sub_option']; ?>
|
275 |
-
<br><br>
|
276 |
-
<p>
|
277 |
-
<label for="<?php echo $sub_options['id']; ?>">
|
278 |
-
<input type="checkbox" value="1" id="<?php echo $sub_options['id']; ?>" name="<?php echo $sub_options['id']; ?>" <?php checked( $plugin_options[ $sub_options['id'] ], '1' ); ?>>
|
279 |
-
<?php echo $sub_options['desc']; ?>
|
280 |
-
</label>
|
281 |
-
</p>
|
282 |
-
<?php endif; ?>
|
283 |
-
|
284 |
-
</td>
|
285 |
-
</tr>
|
286 |
-
<?php break;
|
287 |
-
|
288 |
-
case 'radio-image': ?>
|
289 |
-
<tr valign="top">
|
290 |
-
<th scope="row"><?php echo $value['name']; ?></th>
|
291 |
-
<td>
|
292 |
-
<ul class="img-select">
|
293 |
-
<?php foreach ( $value['choices'] as $val => $img ) { ?>
|
294 |
-
<li class="option">
|
295 |
-
<input class="radio" type="radio" name="<?php echo $value['id']; ?>" id="<?php echo $value['id'].$val; ?>" value="<?php echo $val; ?>" <?php checked( $plugin_options[ $value['id'] ], $val ); ?>>
|
296 |
-
<span class="ico" style="background: url('<?php echo AWS_URL . '/assets/img/' . $img; ?>') no-repeat 50% 50%;"></span>
|
297 |
-
</li>
|
298 |
-
<?php } ?>
|
299 |
-
</ul>
|
300 |
-
<br><span class="description"><?php echo $value['desc']; ?></span>
|
301 |
-
</td>
|
302 |
-
</tr>
|
303 |
-
<?php break;
|
304 |
-
|
305 |
-
case 'sortable': ?>
|
306 |
-
<tr valign="top">
|
307 |
-
<th scope="row"><?php echo $value['name']; ?></th>
|
308 |
-
<td>
|
309 |
-
|
310 |
-
<script>
|
311 |
-
jQuery(document).ready(function() {
|
312 |
-
|
313 |
-
jQuery( "#sti-sortable1, #sti-sortable2" ).sortable({
|
314 |
-
connectWith: ".connectedSortable",
|
315 |
-
placeholder: "highlight",
|
316 |
-
update: function(event, ui){
|
317 |
-
var serviceList = '';
|
318 |
-
jQuery("#sti-sortable2 li").each(function(){
|
319 |
-
|
320 |
-
serviceList = serviceList + ',' + jQuery(this).attr('id');
|
321 |
-
|
322 |
-
});
|
323 |
-
var serviceListOut = serviceList.substring(1);
|
324 |
-
jQuery('#<?php echo $value['id']; ?>').attr('value', serviceListOut);
|
325 |
-
}
|
326 |
-
}).disableSelection();
|
327 |
-
|
328 |
-
});
|
329 |
-
</script>
|
330 |
-
|
331 |
-
<span class="description"><?php echo $value['desc']; ?></span><br><br>
|
332 |
-
|
333 |
-
<?php
|
334 |
-
$all_buttons = $value['choices'];
|
335 |
-
$active_buttons = explode( ',', $plugin_options[ $value['id'] ] );
|
336 |
-
$inactive_buttons = array_diff($all_buttons, $active_buttons);
|
337 |
-
?>
|
338 |
-
|
339 |
-
<div class="sortable-container">
|
340 |
-
|
341 |
-
<div class="sortable-title">
|
342 |
-
<?php _e( 'Active sources', 'aws' ) ?><br>
|
343 |
-
<?php _e( 'Change order by drag&drop', 'aws' ) ?>
|
344 |
-
</div>
|
345 |
-
|
346 |
-
<ul id="sti-sortable2" class="sti-sortable enabled connectedSortable">
|
347 |
-
<?php
|
348 |
-
if ( count( $active_buttons ) > 0 ) {
|
349 |
-
foreach ($active_buttons as $button) {
|
350 |
-
if ( ! $button ) continue;
|
351 |
-
echo '<li id="' . $button . '" class="sti-btn sti-' . $button . '-btn">' . $button . '</li>';
|
352 |
-
}
|
353 |
-
}
|
354 |
-
?>
|
355 |
-
</ul>
|
356 |
-
|
357 |
-
</div>
|
358 |
-
|
359 |
-
<div class="sortable-container">
|
360 |
-
|
361 |
-
<div class="sortable-title">
|
362 |
-
<?php _e( 'Deactivated sources', 'aws' ) ?><br>
|
363 |
-
<?php _e( 'Excluded from search results', 'aws' ) ?>
|
364 |
-
</div>
|
365 |
-
|
366 |
-
<ul id="sti-sortable1" class="sti-sortable disabled connectedSortable">
|
367 |
-
<?php
|
368 |
-
if ( count( $inactive_buttons ) > 0 ) {
|
369 |
-
foreach ($inactive_buttons as $button) {
|
370 |
-
echo '<li id="' . $button . '" class="sti-btn sti-' . $button . '-btn">' . $button . '</li>';
|
371 |
-
}
|
372 |
-
}
|
373 |
-
?>
|
374 |
-
</ul>
|
375 |
-
|
376 |
-
</div>
|
377 |
-
|
378 |
-
<input type="hidden" id="<?php echo $value['id']; ?>" name="<?php echo $value['id']; ?>" value="<?php echo $plugin_options[ $value['id'] ]; ?>" />
|
379 |
-
|
380 |
-
</td>
|
381 |
-
</tr>
|
382 |
-
<?php break;
|
383 |
-
|
384 |
-
case 'heading': ?>
|
385 |
-
<tr valign="top">
|
386 |
-
<th scope="row"><h3><?php echo $value['name']; ?></h3></th>
|
387 |
-
</tr>
|
388 |
-
<?php break;
|
389 |
-
}
|
390 |
-
}
|
391 |
-
|
392 |
-
}
|
393 |
-
|
394 |
/*
|
395 |
* Reindex table
|
396 |
*/
|
397 |
private function update_table() {
|
398 |
|
|
|
|
|
399 |
|
400 |
echo '<tr>';
|
401 |
|
@@ -414,9 +180,6 @@ class AWS_Admin {
|
|
414 |
|
415 |
echo '</tr>';
|
416 |
|
417 |
-
|
418 |
-
|
419 |
-
|
420 |
echo '<tr>';
|
421 |
|
422 |
echo '<th>' . __( 'Reindex table', 'aws' ) . '</th>';
|
@@ -442,6 +205,8 @@ class AWS_Admin {
|
|
442 |
|
443 |
echo '</tr>';
|
444 |
|
|
|
|
|
445 |
|
446 |
}
|
447 |
|
137 |
|
138 |
echo '<form action="" name="aws_form" id="aws_form" method="post">';
|
139 |
|
|
|
|
|
|
|
140 |
switch ($current_tab) {
|
141 |
case('form'):
|
142 |
+
new AWS_Admin_Fields( $options['form'] );
|
143 |
break;
|
144 |
case('results'):
|
145 |
+
new AWS_Admin_Fields( $options['results'] );
|
146 |
break;
|
147 |
default:
|
148 |
$this->update_table();
|
149 |
+
new AWS_Admin_Fields( $options['general'] );
|
150 |
}
|
151 |
|
|
|
|
|
|
|
|
|
|
|
152 |
echo '</form>';
|
153 |
|
154 |
echo '</div>';
|
155 |
|
156 |
}
|
157 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
158 |
/*
|
159 |
* Reindex table
|
160 |
*/
|
161 |
private function update_table() {
|
162 |
|
163 |
+
echo '<table class="form-table">';
|
164 |
+
echo '<tbody>';
|
165 |
|
166 |
echo '<tr>';
|
167 |
|
180 |
|
181 |
echo '</tr>';
|
182 |
|
|
|
|
|
|
|
183 |
echo '<tr>';
|
184 |
|
185 |
echo '<th>' . __( 'Reindex table', 'aws' ) . '</th>';
|
205 |
|
206 |
echo '</tr>';
|
207 |
|
208 |
+
echo '</tbody>';
|
209 |
+
echo '</table>';
|
210 |
|
211 |
}
|
212 |
|
includes/class-aws-helpers.php
CHANGED
@@ -584,6 +584,35 @@ if ( ! class_exists( 'AWS_Helpers' ) ) :
|
|
584 |
|
585 |
}
|
586 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
587 |
}
|
588 |
|
589 |
endif;
|
584 |
|
585 |
}
|
586 |
|
587 |
+
/*
|
588 |
+
* Get string with current product terms names
|
589 |
+
*
|
590 |
+
* @return string List of terms names
|
591 |
+
*/
|
592 |
+
static public function get_terms_array( $id, $taxonomy ) {
|
593 |
+
|
594 |
+
$terms = wp_get_object_terms( $id, $taxonomy );
|
595 |
+
|
596 |
+
if ( is_wp_error( $terms ) ) {
|
597 |
+
return '';
|
598 |
+
}
|
599 |
+
|
600 |
+
if ( empty( $terms ) ) {
|
601 |
+
return '';
|
602 |
+
}
|
603 |
+
|
604 |
+
$tax_array_temp = array();
|
605 |
+
$source_name = AWS_Helpers::get_source_name( $taxonomy );
|
606 |
+
|
607 |
+
foreach ( $terms as $term ) {
|
608 |
+
$source = $source_name . '%' . $term->term_id . '%';
|
609 |
+
$tax_array_temp[$source] = $term->name;
|
610 |
+
}
|
611 |
+
|
612 |
+
return $tax_array_temp;
|
613 |
+
|
614 |
+
}
|
615 |
+
|
616 |
}
|
617 |
|
618 |
endif;
|
includes/class-aws-search.php
CHANGED
@@ -127,8 +127,8 @@ if ( ! class_exists( 'AWS_Search' ) ) :
|
|
127 |
}
|
128 |
|
129 |
$products_array = array();
|
130 |
-
$
|
131 |
-
$
|
132 |
|
133 |
$this->data['s'] = $s;
|
134 |
$this->data['results_num'] = $results_num ? $results_num : 10;
|
@@ -180,36 +180,39 @@ if ( ! class_exists( 'AWS_Search' ) ) :
|
|
180 |
*/
|
181 |
$products_array = apply_filters( 'aws_search_results_products', $products_array, $s );
|
182 |
|
183 |
-
|
184 |
if ( $show_cats === 'true' ) {
|
|
|
|
|
185 |
|
186 |
-
|
|
|
|
|
187 |
|
188 |
-
|
189 |
-
|
190 |
-
|
191 |
-
|
192 |
-
|
193 |
-
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
|
198 |
-
|
199 |
|
200 |
-
|
|
|
201 |
|
202 |
-
|
|
|
|
|
203 |
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
-
* @param string $s Search query
|
211 |
-
*/
|
212 |
-
$tags_array = apply_filters( 'aws_search_results_tags', $tags_array, $s );
|
213 |
|
214 |
}
|
215 |
|
@@ -217,11 +220,11 @@ if ( ! class_exists( 'AWS_Search' ) ) :
|
|
217 |
|
218 |
|
219 |
$result_array = array(
|
220 |
-
'
|
221 |
-
'tags' => $tags_array,
|
222 |
'products' => $products_array
|
223 |
);
|
224 |
|
|
|
225 |
/**
|
226 |
* Filters array of all results data before they displayed in search results
|
227 |
*
|
127 |
}
|
128 |
|
129 |
$products_array = array();
|
130 |
+
$tax_to_display = array();
|
131 |
+
$custom_tax_array = array();
|
132 |
|
133 |
$this->data['s'] = $s;
|
134 |
$this->data['results_num'] = $results_num ? $results_num : 10;
|
180 |
*/
|
181 |
$products_array = apply_filters( 'aws_search_results_products', $products_array, $s );
|
182 |
|
|
|
183 |
if ( $show_cats === 'true' ) {
|
184 |
+
$tax_to_display[] = 'product_cat';
|
185 |
+
}
|
186 |
|
187 |
+
if ( $show_tags === 'true' ) {
|
188 |
+
$tax_to_display[] = 'product_tag';
|
189 |
+
}
|
190 |
|
191 |
+
/**
|
192 |
+
* Filters array of custom taxonomies that must be displayed in search results
|
193 |
+
*
|
194 |
+
* @since 1.68
|
195 |
+
*
|
196 |
+
* @param array $taxonomies_archives Array of custom taxonomies
|
197 |
+
* @param string $s Search query
|
198 |
+
*/
|
199 |
+
$taxonomies_archives = apply_filters( 'aws_search_results_tax_archives', $tax_to_display, $s );
|
200 |
|
201 |
+
if ( $taxonomies_archives && is_array( $taxonomies_archives ) && ! empty( $taxonomies_archives ) ) {
|
202 |
|
203 |
+
foreach( $taxonomies_archives as $taxonomies_archive_name ) {
|
204 |
+
$res = $this->get_taxonomies( $taxonomies_archive_name );
|
205 |
|
206 |
+
if ( $taxonomies_archive_name === 'product_cat' ) {
|
207 |
+
$res = apply_filters( 'aws_search_results_categories', $res, $s );
|
208 |
+
}
|
209 |
|
210 |
+
if ( $taxonomies_archive_name === 'product_tag' ) {
|
211 |
+
$res = apply_filters( 'aws_search_results_tags', $res, $s );
|
212 |
+
}
|
213 |
+
|
214 |
+
$custom_tax_array[$taxonomies_archive_name] = $res;
|
215 |
+
}
|
|
|
|
|
|
|
216 |
|
217 |
}
|
218 |
|
220 |
|
221 |
|
222 |
$result_array = array(
|
223 |
+
'tax' => $custom_tax_array,
|
|
|
224 |
'products' => $products_array
|
225 |
);
|
226 |
|
227 |
+
|
228 |
/**
|
229 |
* Filters array of all results data before they displayed in search results
|
230 |
*
|
includes/class-aws-table.php
CHANGED
@@ -323,8 +323,8 @@ if ( ! class_exists( 'AWS_Table' ) ) :
|
|
323 |
|
324 |
$content = apply_filters( 'the_content', get_post_field( 'post_content', $data['id'] ), $data['id'] );
|
325 |
$excerpt = get_post_field( 'post_excerpt', $data['id'] );
|
326 |
-
$cat_array =
|
327 |
-
$tag_array =
|
328 |
|
329 |
|
330 |
// Get all child products if exists
|
@@ -839,35 +839,6 @@ if ( ! class_exists( 'AWS_Table' ) ) :
|
|
839 |
|
840 |
}
|
841 |
|
842 |
-
/*
|
843 |
-
* Get string with current product terms names
|
844 |
-
*
|
845 |
-
* @return string List of terms names
|
846 |
-
*/
|
847 |
-
private function get_terms_array( $id, $taxonomy ) {
|
848 |
-
|
849 |
-
$terms = wp_get_object_terms( $id, $taxonomy );
|
850 |
-
|
851 |
-
if ( is_wp_error( $terms ) ) {
|
852 |
-
return '';
|
853 |
-
}
|
854 |
-
|
855 |
-
if ( empty( $terms ) ) {
|
856 |
-
return '';
|
857 |
-
}
|
858 |
-
|
859 |
-
$tax_array_temp = array();
|
860 |
-
$source_name = AWS_Helpers::get_source_name( $taxonomy );
|
861 |
-
|
862 |
-
foreach ( $terms as $term ) {
|
863 |
-
$source = $source_name . '%' . $term->term_id . '%';
|
864 |
-
$tax_array_temp[$source] = $term->name;
|
865 |
-
}
|
866 |
-
|
867 |
-
return $tax_array_temp;
|
868 |
-
|
869 |
-
}
|
870 |
-
|
871 |
/*
|
872 |
* Get product stock status
|
873 |
*
|
323 |
|
324 |
$content = apply_filters( 'the_content', get_post_field( 'post_content', $data['id'] ), $data['id'] );
|
325 |
$excerpt = get_post_field( 'post_excerpt', $data['id'] );
|
326 |
+
$cat_array = AWS_Helpers::get_terms_array( $data['id'], 'product_cat' );
|
327 |
+
$tag_array = AWS_Helpers::get_terms_array( $data['id'], 'product_tag' );
|
328 |
|
329 |
|
330 |
// Get all child products if exists
|
839 |
|
840 |
}
|
841 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
842 |
/*
|
843 |
* Get product stock status
|
844 |
*
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
|
|
4 |
Tags: widget, plugin, woocommerce, search, product search, woocommerce search, ajax search, live search, custom search, ajax, shortcode, better search, relevance search, relevant search, search by sku, search plugin, shop, store, wordpress search, wp ajax search, wp search, wp search plugin, sidebar, ecommerce, merketing, products, category search, instant-search, search highlight, woocommerce advanced search, woocommerce live search, WooCommerce Plugin, woocommerce product search
|
5 |
Requires at least: 4.0
|
6 |
Tested up to: 5.1
|
7 |
-
Stable tag: 1.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -48,6 +48,7 @@ Additional features available only in PRO plugin version.
|
|
48 |
* Search **form layouts**
|
49 |
* **Filters**. Switch between tabs to show different search results
|
50 |
* **Unlimited** amount of search form instances
|
|
|
51 |
* Support for **variable products**: show child products, parent product or both in search results.
|
52 |
* Product **attributes** search ( including custom attributes)
|
53 |
* Product **custom taxonomies** search
|
@@ -102,6 +103,11 @@ Yep. This plugin is always compatible with the latest version of Woocommerce?
|
|
102 |
|
103 |
== Changelog ==
|
104 |
|
|
|
|
|
|
|
|
|
|
|
105 |
= 1.67 =
|
106 |
* Dev - Add aws_search_query_array filter
|
107 |
* Dev - Send page url with ajax request
|
4 |
Tags: widget, plugin, woocommerce, search, product search, woocommerce search, ajax search, live search, custom search, ajax, shortcode, better search, relevance search, relevant search, search by sku, search plugin, shop, store, wordpress search, wp ajax search, wp search, wp search plugin, sidebar, ecommerce, merketing, products, category search, instant-search, search highlight, woocommerce advanced search, woocommerce live search, WooCommerce Plugin, woocommerce product search
|
5 |
Requires at least: 4.0
|
6 |
Tested up to: 5.1
|
7 |
+
Stable tag: 1.68
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
48 |
* Search **form layouts**
|
49 |
* **Filters**. Switch between tabs to show different search results
|
50 |
* **Unlimited** amount of search form instances
|
51 |
+
* Search for custom taxonomies and attributes **archive pages**
|
52 |
* Support for **variable products**: show child products, parent product or both in search results.
|
53 |
* Product **attributes** search ( including custom attributes)
|
54 |
* Product **custom taxonomies** search
|
103 |
|
104 |
== Changelog ==
|
105 |
|
106 |
+
= 1.68 =
|
107 |
+
* Update - Styles for plugin settings page
|
108 |
+
* Dev - Add aws_search_results_tax_archives filter
|
109 |
+
* Dev - Clear code for all unused stuff
|
110 |
+
|
111 |
= 1.67 =
|
112 |
* Dev - Add aws_search_query_array filter
|
113 |
* Dev - Send page url with ajax request
|