PluginProbe
Datafeedr API / 1.4.3
Datafeedr API v1.4.3
1.4.3 1.4.2 1.0.125 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 1.0.23 1.0.24 1.0.25 1.0.26 1.0.27 1.0.28 1.0.29 1.0.3 1.0.30 1.0.31 1.0.32 All 182 releases
← All changes | classes/class-dfrapi-searchform.php +590 -370 1.0.32 → 1.4.3 View file →
@@ -1,249 +1,366 @@
1 1 <?php
2 2
3 +defined( 'ABSPATH' ) || exit;
3 4
4 5
5 6 class Dfrapi_SearchForm
6 7 {
7 8 function fields() {
8 - $opFulltext = array(
9 - 'contain' => __( 'contains', DFRAPI_DOMAIN ),
10 - 'not_contain' => __( 'doesn\'t contain', DFRAPI_DOMAIN ),
11 - 'start' => __( 'starts with', DFRAPI_DOMAIN ),
12 - 'end' => __( 'ends with', DFRAPI_DOMAIN ),
13 - 'match' => __( 'matches', DFRAPI_DOMAIN )
14 - );
15 - $opFulltextExact = array_merge($opFulltext, array(
16 - 'is' => __( 'is', DFRAPI_DOMAIN )
17 - ));
18 - $opRange = array(
19 - 'eq' => __( 'equal to', DFRAPI_DOMAIN ),
20 - 'lt' => __( 'less than', DFRAPI_DOMAIN ),
21 - 'lte' => __( 'less than or equal to', DFRAPI_DOMAIN ),
22 - 'gt' => __( 'greater than', DFRAPI_DOMAIN ),
23 - 'gte' => __( 'greater than or equal to', DFRAPI_DOMAIN ),
24 - 'between' => __( 'between', DFRAPI_DOMAIN )
25 - );
26 - $opIs = array(
27 - 'is' => __( 'is', DFRAPI_DOMAIN )
28 - );
29 - $opIsIsnt = array(
30 - 'is' => __( 'is', DFRAPI_DOMAIN ),
31 - 'is_not' => __( 'isn\'t', DFRAPI_DOMAIN )
32 - );
33 - $opYesNo = array(
34 - 'yes' => __( 'yes', DFRAPI_DOMAIN ),
35 - 'no' => __( 'no', DFRAPI_DOMAIN )
36 - );
37 9
38 - $sortOpts = array(
39 - '' => __( 'Relevance', DFRAPI_DOMAIN ),
40 - '+price' => __( 'Price Ascending', DFRAPI_DOMAIN ),
41 - '-price' => __( 'Price Decending', DFRAPI_DOMAIN ),
42 - '+saleprice' => __( 'Sale Price Ascending', DFRAPI_DOMAIN ),
43 - '-saleprice' => __( 'Sale Price Decending', DFRAPI_DOMAIN ),
44 - '+finalprice' => __( 'Final Price Ascending', DFRAPI_DOMAIN ),
45 - '-finalprice' => __( 'Final Price Decending', DFRAPI_DOMAIN ),
46 - '+salediscount' => __( 'Discount Ascending', DFRAPI_DOMAIN ),
47 - '-salediscount' => __( 'Discount Decending', DFRAPI_DOMAIN ),
48 - '+merchant' => __( 'Merchant', DFRAPI_DOMAIN ),
49 - '+time_created' => __( 'Date Created Ascending', DFRAPI_DOMAIN ),
50 - '-time_created' => __( 'Date Created Decending', DFRAPI_DOMAIN ),
51 - '+time_updated' => __( 'Last Updated Ascending', DFRAPI_DOMAIN ),
52 - '-time_updated' => __( 'Last Updated Decending', DFRAPI_DOMAIN )
53 - );
10 + $opFulltext = array(
11 + 'match' => __( 'matches', 'datafeedr-api' ),
12 + 'contain' => __( 'contains', 'datafeedr-api' ),
13 + 'not_contain' => __( 'doesn\'t contain', 'datafeedr-api' ),
14 + 'start' => __( 'starts with', 'datafeedr-api' ),
15 + 'end' => __( 'ends with', 'datafeedr-api' ),
16 + );
54 17
55 - return array(
56 - array(
57 - 'title' => __( 'Any Field', DFRAPI_DOMAIN ),
58 - 'name' => 'any',
59 - 'input' => 'text',
60 - 'operator' => $opFulltext,
61 - 'help' => $this->help('any')
62 - ),
63 - array(
64 - 'title' => __( 'Product Name', DFRAPI_DOMAIN ),
65 - 'name' => 'name',
66 - 'input' => 'text',
67 - 'operator' => $opFulltextExact,
68 - 'help' => $this->help('name')
69 - ),
70 - array(
71 - 'title' => __( 'Brand', DFRAPI_DOMAIN ),
72 - 'name' => 'brand',
73 - 'input' => 'text',
74 - 'operator' => $opFulltextExact,
75 - 'help' => $this->help('brand')
76 - ),
77 - array(
78 - 'title' => __( 'Description', DFRAPI_DOMAIN ),
79 - 'name' => 'description',
80 - 'input' => 'text',
81 - 'operator' => $opFulltext,
82 - 'help' => $this->help('description')
83 - ),
84 - array(
85 - 'title' => __( 'Tags', DFRAPI_DOMAIN ),
86 - 'name' => 'tags',
87 - 'input' => 'text',
88 - 'operator' => array(
89 - 'in' => __( 'contain', DFRAPI_DOMAIN ),
90 - 'not_in' => __( 'don\'t contain', DFRAPI_DOMAIN )
91 - ),
92 - 'help' => $this->help('tags')
93 - ),
94 - array(
95 - 'title' => __( 'Category', DFRAPI_DOMAIN ),
96 - 'name' => 'category',
97 - 'input' => 'text',
98 - 'operator' => $opFulltext,
99 - 'help' => $this->help('category')
100 - ),
101 - array(
102 - 'title' => __( 'Product Type', DFRAPI_DOMAIN ),
103 - 'name' => 'type',
104 - 'input' => 'select',
105 - 'options' => array(
106 - 'products' => __( 'Product', DFRAPI_DOMAIN ),
107 - 'coupons' => __( 'Coupon', DFRAPI_DOMAIN )
108 - ),
109 - 'operator' => $opIs,
110 - 'help' => $this->help('type')
111 - ),
112 - array(
113 - 'title' => __( 'Currency', DFRAPI_DOMAIN ),
114 - 'name' => 'currency',
115 - 'input' => 'select',
116 - 'options' => array(
117 - 'AUD' => 'AUD',
118 - 'CAD' => 'CAD',
119 - 'CHF' => 'CHF',
120 - 'DKK' => 'DKK',
121 - 'EUR' => 'EUR',
122 - 'GBP' => 'GBP',
123 - 'NOK' => 'NOK',
124 - 'NZD' => 'NZD',
125 - 'SEK' => 'SEK',
126 - 'TRY' => 'TRY',
127 - 'USD' => 'USD',
128 - ),
129 - 'operator' => $opIsIsnt,
130 - 'help' => $this->help('currency')
131 - ),
132 - array(
133 - 'title' => __( 'Price', DFRAPI_DOMAIN ),
134 - 'name' => 'price',
135 - 'input' => 'range',
136 - 'operator' => $opRange,
137 - 'help' => $this->help('price')
138 - ),
139 - array(
140 - 'title' => __( 'Sale Price', DFRAPI_DOMAIN ),
141 - 'name' => 'saleprice',
142 - 'input' => 'range',
143 - 'operator' => $opRange,
144 - 'help' => $this->help('saleprice')
145 - ),
146 - array(
147 - 'title' => __( 'Final Price', DFRAPI_DOMAIN ),
148 - 'name' => 'finalprice',
149 - 'input' => 'range',
150 - 'operator' => $opRange,
151 - 'help' => $this->help('finalprice')
152 - ),
153 - array(
154 - 'title' => __( 'Network', DFRAPI_DOMAIN ),
155 - 'name' => 'source_id',
156 - 'input' => 'network',
157 - 'operator' => $opIsIsnt,
158 - 'help' => $this->help('source_id')
159 - ),
160 - array(
161 - 'title' => __( 'Merchant', DFRAPI_DOMAIN ),
162 - 'name' => 'merchant_id',
163 - 'input' => 'merchant',
164 - 'operator' => $opIsIsnt,
165 - 'help' => $this->help('merchant_id')
166 - ),
167 - array(
168 - 'title' => __( 'On Sale', DFRAPI_DOMAIN ),
169 - 'name' => 'onsale',
170 - 'input' => 'none',
171 - 'operator' => $opYesNo,
172 - 'help' => $this->help('onsale')
173 - ),
174 - array(
175 - 'title' => __( 'Has Direct URL', DFRAPI_DOMAIN ),
176 - 'name' => 'direct_url',
177 - 'input' => 'none',
178 - 'operator' => $opYesNo,
179 - 'help' => $this->help('direct_url')
180 - ),
181 - array(
182 - 'title' => __( 'Discount', DFRAPI_DOMAIN ),
183 - 'name' => 'salediscount',
184 - 'input' => 'range',
185 - 'operator' => $opRange,
186 - 'help' => $this->help('salediscount')
187 - ),
188 - array(
189 - 'title' => __( 'Has Image', DFRAPI_DOMAIN ),
190 - 'name' => 'image',
191 - 'input' => 'none',
192 - 'operator' => $opYesNo,
193 - 'help' => $this->help('image')
194 - ),
195 - array(
196 - 'title' => __( 'Last Updated', DFRAPI_DOMAIN ),
197 - 'name' => 'time_updated',
198 - 'input' => 'range',
199 - 'operator' => array('lt' => 'before', 'gt' => 'after', 'between' => 'between'),
200 - 'help' => $this->help('time_updated')
201 - ),
202 - array(
203 - 'title' => __( 'Limit', DFRAPI_DOMAIN ),
204 - 'name' => 'limit',
205 - 'input' => 'text',
206 - 'operator' => array('is' => 'is'),
207 - 'help' => $this->help('limit')
208 - ),
209 - array(
210 - 'title' => __( 'Sort By', DFRAPI_DOMAIN ),
211 - 'name' => 'sort',
212 - 'input' => 'none',
213 - 'operator' => $sortOpts,
214 - 'help' => $this->help('sort')
215 - ),
216 - array(
217 - 'title' => __( 'Exclude Duplicates', DFRAPI_DOMAIN ),
218 - 'name' => 'duplicates',
219 - 'input' => 'text',
220 - 'operator' => array(
221 - 'is' => __( 'matching these fields', DFRAPI_DOMAIN ),
222 - ),
223 - 'help' => $this->help('duplicates')
224 - )
225 - );
18 + $opFulltextExact = array_merge( $opFulltext, array(
19 + 'is' => __( 'is', 'datafeedr-api' )
20 + ) );
21 +
22 + $opRange = array(
23 + 'eq' => __( 'equal to', 'datafeedr-api' ),
24 + 'lt' => __( 'less than', 'datafeedr-api' ),
25 + 'lte' => __( 'less than or equal to', 'datafeedr-api' ),
26 + 'gt' => __( 'greater than', 'datafeedr-api' ),
27 + 'gte' => __( 'greater than or equal to', 'datafeedr-api' ),
28 + 'between' => __( 'between', 'datafeedr-api' )
29 + );
30 +
31 + $opIs = array(
32 + 'is' => __( 'is', 'datafeedr-api' )
33 + );
34 +
35 + $opIsIsnt = array(
36 + 'is' => __( 'is', 'datafeedr-api' ),
37 + 'is_not' => __( 'isn\'t', 'datafeedr-api' )
38 + );
39 +
40 + $opYesNo = array(
41 + 'yes' => __( 'yes', 'datafeedr-api' ),
42 + 'no' => __( 'no', 'datafeedr-api' )
43 + );
44 +
45 + $opInStock = array(
46 + 'yes_unknown' => __( 'yes or unknown', 'datafeedr-api' ),
47 + 'yes' => __( 'yes', 'datafeedr-api' ),
48 + 'no' => __( 'no', 'datafeedr-api' ),
49 + );
50 +
51 + $sortOpts = array(
52 + '' => __( 'Relevance', 'datafeedr-api' ),
53 + '+price' => __( 'Price Ascending', 'datafeedr-api' ),
54 + '-price' => __( 'Price Descending', 'datafeedr-api' ),
55 + '+saleprice' => __( 'Sale Price Ascending', 'datafeedr-api' ),
56 + '-saleprice' => __( 'Sale Price Descending', 'datafeedr-api' ),
57 + '+finalprice' => __( 'Final Price Ascending', 'datafeedr-api' ),
58 + '-finalprice' => __( 'Final Price Descending', 'datafeedr-api' ),
59 + '+salediscount' => __( 'Discount Ascending', 'datafeedr-api' ),
60 + '-salediscount' => __( 'Discount Descending', 'datafeedr-api' ),
61 + '+merchant' => __( 'Merchant', 'datafeedr-api' ),
62 + '+time_updated' => __( 'Last Updated Ascending', 'datafeedr-api' ),
63 + '-time_updated' => __( 'Last Updated Descending', 'datafeedr-api' ),
64 + '+_id' => __( 'Product ID Ascending', 'datafeedr-api' ),
65 + '-_id' => __( 'Product ID Descending', 'datafeedr-api' ),
66 + );
67 +
68 + return array(
69 + array(
70 + 'title' => __( 'Any Field', 'datafeedr-api' ),
71 + 'name' => 'any',
72 + 'input' => 'text',
73 + 'operator' => $opFulltext,
74 + 'help' => $this->help( 'any' )
75 + ),
76 + array(
77 + 'title' => __( 'Product Name', 'datafeedr-api' ),
78 + 'name' => 'name',
79 + 'input' => 'text',
80 + 'operator' => $opFulltextExact,
81 + 'help' => $this->help( 'name' )
82 + ),
83 + array(
84 + 'title' => __( 'Product ID', 'datafeedr-api' ),
85 + 'name' => 'id',
86 + 'input' => 'text',
87 + 'operator' => $opIsIsnt,
88 + 'help' => $this->help( 'id' )
89 + ),
90 + array(
91 + 'title' => __( 'Barcode', 'datafeedr-api' ),
92 + 'name' => 'barcode',
93 + 'input' => 'text',
94 + 'operator' => $opIsIsnt,
95 + 'help' => $this->help( 'barcode' )
96 + ),
97 + array(
98 + 'title' => __( 'Brand', 'datafeedr-api' ),
99 + 'name' => 'brand',
100 + 'input' => 'text',
101 + 'operator' => $opFulltextExact,
102 + 'help' => $this->help( 'brand' )
103 + ),
104 + array(
105 + 'title' => __( 'Color', 'datafeedr-api' ),
106 + 'name' => 'color',
107 + 'input' => 'text',
108 + 'operator' => $opFulltextExact,
109 + 'help' => $this->help( 'color' )
110 + ),
111 + array(
112 + 'title' => __( 'Material', 'datafeedr-api' ),
113 + 'name' => 'material',
114 + 'input' => 'text',
115 + 'operator' => $opFulltextExact,
116 + 'help' => $this->help( 'material' )
117 + ),
118 + array(
119 + 'title' => __( 'Size', 'datafeedr-api' ),
120 + 'name' => 'size',
121 + 'input' => 'text',
122 + 'operator' => $opFulltextExact,
123 + 'help' => $this->help( 'size' )
124 + ),
125 + array(
126 + 'title' => __( 'Gender', 'datafeedr-api' ),
127 + 'name' => 'gender',
128 + 'input' => 'text',
129 + 'operator' => $opFulltextExact,
130 + 'help' => $this->help( 'gender' )
131 + ),
132 + array(
133 + 'title' => __( 'SKU', 'datafeedr-api' ),
134 + 'name' => 'sku',
135 + 'input' => 'text',
136 + 'operator' => $opFulltextExact,
137 + 'help' => $this->help( 'sku' )
138 + ),
139 + array(
140 + 'title' => __( 'Condition', 'datafeedr-api' ),
141 + 'name' => 'condition',
142 + 'input' => 'text',
143 + 'operator' => $opFulltextExact,
144 + 'help' => $this->help( 'condition' )
145 + ),
146 + array(
147 + 'title' => __( 'Description', 'datafeedr-api' ),
148 + 'name' => 'description',
149 + 'input' => 'text',
150 + 'operator' => $opFulltext,
151 + 'help' => $this->help( 'description' )
152 + ),
153 + array(
154 + 'title' => __( 'Tags', 'datafeedr-api' ),
155 + 'name' => 'tags',
156 + 'input' => 'text',
157 + 'operator' => array(
158 + 'in' => __( 'contain', 'datafeedr-api' ),
159 + 'not_in' => __( 'don\'t contain', 'datafeedr-api' )
160 + ),
161 + 'help' => $this->help( 'tags' )
162 + ),
163 + array(
164 + 'title' => __( 'Category', 'datafeedr-api' ),
165 + 'name' => 'category',
166 + 'input' => 'text',
167 + 'operator' => $opFulltext,
168 + 'help' => $this->help( 'category' )
169 + ),
170 + array(
171 + 'title' => __( 'Product Type', 'datafeedr-api' ),
172 + 'name' => 'type',
173 + 'input' => 'select',
174 + 'options' => array(
175 + 'products' => __( 'Product', 'datafeedr-api' ),
176 + 'coupons' => __( 'Coupon', 'datafeedr-api' )
177 + ),
178 + 'operator' => $opIs,
179 + 'help' => $this->help( 'type' )
180 + ),
181 + array(
182 + 'title' => __( 'Currency', 'datafeedr-api' ),
183 + 'name' => 'currency',
184 + 'input' => 'select',
185 + 'options' => array(
186 + 'AUD' => 'AUD',
187 + 'BRL' => 'BRL',
188 + 'CAD' => 'CAD',
189 + 'CHF' => 'CHF',
190 + 'CZK' => 'CZK',
191 + 'DKK' => 'DKK',
192 + 'EUR' => 'EUR',
193 + 'GBP' => 'GBP',
194 + 'INR' => 'INR',
195 + 'NOK' => 'NOK',
196 + 'NZD' => 'NZD',
197 + 'PLN' => 'PLN',
198 + 'SEK' => 'SEK',
199 + 'TRY' => 'TRY',
200 + 'USD' => 'USD',
201 + ),
202 + 'operator' => $opIsIsnt,
203 + 'help' => $this->help( 'currency' )
204 + ),
205 + array(
206 + 'title' => __( 'Price', 'datafeedr-api' ),
207 + 'name' => 'price',
208 + 'input' => 'range',
209 + 'operator' => $opRange,
210 + 'help' => $this->help( 'price' )
211 + ),
212 + array(
213 + 'title' => __( 'Sale Price', 'datafeedr-api' ),
214 + 'name' => 'saleprice',
215 + 'input' => 'range',
216 + 'operator' => $opRange,
217 + 'help' => $this->help( 'saleprice' )
218 + ),
219 + array(
220 + 'title' => __( 'Final Price', 'datafeedr-api' ),
221 + 'name' => 'finalprice',
222 + 'input' => 'range',
223 + 'operator' => $opRange,
224 + 'help' => $this->help( 'finalprice' )
225 + ),
226 + array(
227 + 'title' => __( 'Discount', 'datafeedr-api' ),
228 + 'name' => 'salediscount',
229 + 'input' => 'range',
230 + 'operator' => $opRange,
231 + 'help' => $this->help( 'salediscount' )
232 + ),
233 + array(
234 + 'title' => __( 'Network', 'datafeedr-api' ),
235 + 'name' => 'source_id',
236 + 'input' => 'network',
237 + 'operator' => $opIsIsnt,
238 + 'help' => $this->help( 'source_id' )
239 + ),
240 + array(
241 + 'title' => __( 'Merchant', 'datafeedr-api' ),
242 + 'name' => 'merchant_id',
243 + 'input' => 'merchant',
244 + 'operator' => $opIsIsnt,
245 + 'help' => $this->help( 'merchant_id' )
246 + ),
247 + array(
248 + 'title' => __( 'On Sale', 'datafeedr-api' ),
249 + 'name' => 'onsale',
250 + 'input' => 'none',
251 + 'operator' => $opYesNo,
252 + 'help' => $this->help( 'onsale' )
253 + ),
254 + array(
255 + 'title' => __( 'In Stock', 'datafeedr-api' ),
256 + 'name' => 'instock',
257 + 'input' => 'none',
258 + 'operator' => $opInStock,
259 + 'help' => $this->help( 'instock' )
260 + ),
261 + array(
262 + 'title' => __( 'Stock Quantity', 'datafeedr-api' ),
263 + 'name' => 'stockquantity',
264 + 'input' => 'range',
265 + 'operator' => $opRange,
266 + 'help' => $this->help( 'instock' )
267 + ),
268 + array(
269 + 'title' => __( 'Has Direct URL', 'datafeedr-api' ),
270 + 'name' => 'direct_url',
271 + 'input' => 'none',
272 + 'operator' => $opYesNo,
273 + 'help' => $this->help( 'direct_url' )
274 + ),
275 + array(
276 + 'title' => __( 'Has Image', 'datafeedr-api' ),
277 + 'name' => 'image',
278 + 'input' => 'none',
279 + 'operator' => $opYesNo,
280 + 'help' => $this->help( 'image' )
281 + ),
282 + array(
283 + 'title' => __( 'Has Barcode', 'datafeedr-api' ),
284 + 'name' => 'has_barcode',
285 + 'input' => 'none',
286 + 'operator' => $opYesNo,
287 + 'help' => $this->help( 'has_barcode' )
288 + ),
289 + array(
290 + 'title' => __( 'Last Updated', 'datafeedr-api' ),
291 + 'name' => 'time_updated',
292 + 'input' => 'range',
293 + 'operator' => array( 'lt' => 'before', 'gt' => 'after', 'between' => 'between' ),
294 + 'help' => $this->help( 'time_updated' )
295 + ),
296 + array(
297 + 'title' => __( 'Limit', 'datafeedr-api' ),
298 + 'name' => 'limit',
299 + 'input' => 'text',
300 + 'operator' => array( 'is' => 'is' ),
301 + 'help' => $this->help( 'limit' )
302 + ),
303 + array(
304 + 'title' => __( 'Merchant Limit', 'datafeedr-api' ),
305 + 'name' => 'merchant_limit',
306 + 'input' => 'select',
307 + 'options' => array_filter( range( 0, 10 ), function ( $num ) {
308 + return $num != 0;
309 + } ),
310 + 'operator' => array( 'is' => 'is' ),
311 + 'help' => $this->help( 'merchant_limit' )
312 + ),
313 + array(
314 + 'title' => __( 'Sort By', 'datafeedr-api' ),
315 + 'name' => 'sort',
316 + 'input' => 'none',
317 + 'operator' => $sortOpts,
318 + 'help' => $this->help( 'sort' )
319 + ),
320 + array(
321 + 'title' => __( 'Exclude Duplicates', 'datafeedr-api' ),
322 + 'name' => 'duplicates',
323 + 'input' => 'text',
324 + 'operator' => array(
325 + 'is' => __( 'matching these fields', 'datafeedr-api' ),
326 + ),
327 + 'help' => $this->help( 'duplicates' )
328 + )
329 + );
226 330 }
227 331
228 - function defaults() {
229 - return array(
230 - 'any' => array('operator' => 'contain', 'value'=> ''),
231 - 'name' => array('operator' => 'contain', 'value'=> ''),
232 - 'type' => array('value'=> 'product'),
233 - 'currency' => array('value'=> 'USD'),
234 - 'price' => array('operator' => 'between', 'value'=> '0', 'value2' => '999999'),
235 - 'saleprice' => array('operator' => 'between', 'value'=> '0', 'value2' => '999999'),
236 - 'source_id' => array('value'=> array()),
237 - 'merchant_id' => array('value'=> array()),
238 - 'onsale' => array('value'=> '1'),
239 - 'direct_url' => array('value'=> '1'),
240 - 'image' => array('value'=> '1'),
241 - 'thumbnail' => array('value'=> '1'),
242 - 'time_updated' => array('operator' => 'lt', 'value'=> 'today'),
243 - 'limit' => array('value'=> 1000),
244 - );
245 - }
332 + function defaults() {
333 + return array(
334 + 'any' => array( 'operator' => 'match', 'value' => '' ),
335 + 'id' => array( 'operator' => 'is', 'value' => '' ),
336 + 'barcode' => array( 'operator' => 'is', 'value' => '' ),
337 + 'name' => array( 'operator' => 'match', 'value' => '' ),
338 + 'brand' => array( 'operator' => 'match', 'value' => '' ),
339 + 'color' => array( 'operator' => 'match', 'value' => '' ),
340 + 'material' => array( 'operator' => 'match', 'value' => '' ),
341 + 'size' => array( 'operator' => 'match', 'value' => '' ),
342 + 'gender' => array( 'operator' => 'match', 'value' => '' ),
343 + 'sku' => array( 'operator' => 'match', 'value' => '' ),
344 + 'condition' => array( 'operator' => 'match', 'value' => '' ),
345 + 'type' => array( 'value' => 'product' ),
346 + 'currency' => array( 'value' => 'USD' ),
347 + 'price' => array( 'operator' => 'between', 'value' => '0', 'value2' => '999999' ),
348 + 'saleprice' => array( 'operator' => 'between', 'value' => '0', 'value2' => '999999' ),
349 + 'source_id' => array( 'value' => array() ),
350 + 'merchant_id' => array( 'value' => array() ),
351 + 'onsale' => array( 'value' => '1' ),
352 + 'instock' => array( 'value' => 'yes_unknown' ),
353 + 'stockquantity' => array( 'operator' => 'between', 'value' => '0', 'value2' => '100' ),
354 + 'direct_url' => array( 'value' => '1' ),
355 + 'image' => array( 'value' => '1' ),
356 + 'has_barcode' => array( 'value' => '1' ),
357 + 'thumbnail' => array( 'value' => '1' ),
358 + 'time_updated' => array( 'operator' => 'lt', 'value' => 'today' ),
359 + 'limit' => array( 'value' => 1000 ),
360 + 'merchant_limit' => array( 'value' => 5 ),
361 + );
362 + }
246 363
247 364 public $useSelected;
248 365 public $prefix;
249 366
@@ -327,13 +444,13 @@
327 444 }
328 445
329 446 function networksMerchantsPopup($kind, $value) {
330 447 $title = array(
331 - 'network' => __( 'Select Networks', DFRAPI_DOMAIN ),
332 - 'merchant' => __( 'Select Merchants', DFRAPI_DOMAIN )
448 + 'network' => __( 'Select Networks', 'datafeedr-api' ),
449 + 'merchant' => __( 'Select Merchants', 'datafeedr-api' )
333 450 );
334 - $clear = __( 'Clear search', DFRAPI_DOMAIN );
335 - $ok = __( 'OK', DFRAPI_DOMAIN );
451 + $clear = __( 'Clear search', 'datafeedr-api' );
452 + $ok = __( 'OK', 'datafeedr-api' );
336 453 $cells = "";
337 454
338 455 $all = ($kind == 'network') ?
339 456 ($this->useSelected ? $this->selectedNetworks() : $this->allNetworks()) :
@@ -339,13 +456,13 @@
339 456 ($this->useSelected ? $this->selectedNetworks() : $this->allNetworks()) :
340 457 $this->selectedMerchants();
341 458
342 459 foreach($all as $obj) {
343 - $id = $obj['_id'];
344 - $nid = ($kind == 'network') ? $obj['_id'] : $obj['source_id'];
345 - $group_class = $this->groupClass($nid);
460 + $id = absint($obj['_id']);
461 + $nid = absint(($kind == 'network') ? $obj['_id'] : $obj['source_id']);
462 + $group_class = esc_attr($this->groupClass($nid));
346 463
347 - $name = $obj['name'];
464 + $name = esc_html($obj['name']);
348 465 $checked = in_array($id, $value) ? "checked='checked'" : "";
349 466
350 467 $cells .= "
351 468 <div class='inline_frame_element nid_{$nid}'>
@@ -377,9 +494,9 @@
377 494 $all = ($kind == 'network') ? $this->allNetworks() : dfrapi_api_get_merchants_by_id($value);
378 495 $names = array();
379 496 foreach($all as $obj) {
380 497 if(in_array($obj['_id'], $value)) {
381 - $names []= "<span>{$obj['name']}</span>";
498 + $names []= '<span>' . esc_html($obj['name']) . '</span>';
382 499 if(count($names) >= $maxNames)
383 500 break;
384 501 }
385 502 }
@@ -384,9 +501,9 @@
384 501 }
385 502 }
386 503 $html = implode(', ', $names);
387 504 if(count($value) - count($names)) {
388 - $html .= ' ' . sprintf(__( 'and %s more', DFRAPI_DOMAIN ), count($value) - count($names));
505 + $html .= ' ' . sprintf(__( 'and %s more', 'datafeedr-api' ), count($value) - count($names));
389 506 }
390 507 return $html;
391 508 }
392 509
@@ -391,10 +508,10 @@
391 508 }
392 509
393 510 function chooseBox($kind, $field, $index, $value) {
394 511 $pfx = $this->inputPrefix($index);
395 - $value = implode(',', $this->ary($value));
396 - $choose = __( 'choose', DFRAPI_DOMAIN );
512 + $value = esc_attr(implode(',', $this->ary($value)));
513 + $choose = __( 'choose', 'datafeedr-api' );
397 514 return "
398 515 <div class='dfrapi_choose_box' rel='{$kind}'>
399 516 <span class='names'></span>
400 517 <a class='button choose_{$kind}'>{$choose}</a>
@@ -402,26 +519,43 @@
402 519 </div>
403 520 ";
404 521 }
405 522
406 - function ajaxHandler() {
407 - $command = $this->get($_POST, 'command');
408 - $value = $this->ary($this->get($_POST, 'value'));
409 - $this->useSelected = intval($this->get($_POST, 'useSelected', 1));
523 + function ajaxHandler() {
524 + $command = $this->get( $_POST, 'command' );
525 + $value = array_values( array_unique( array_filter( array_map( 'absint', $this->ary( $this->get( $_POST, 'value' ) ) ) ) ) );
526 + $this->useSelected = (int) $this->get( $_POST, 'useSelected', 1 );
410 527
411 - switch($command) {
412 - case "choose_network":
413 - return $this->networksMerchantsPopup('network', $value);
414 - case "choose_merchant":
415 - return $this->networksMerchantsPopup('merchant', $value);
416 - case "names_network":
417 - return $this->networksMerchantsNames('network', $value);
418 - case "names_merchant":
419 - return $this->networksMerchantsNames('merchant', $value);
420 - }
421 - return "";
422 - }
528 + if ( $command === 'choose_network' ) {
529 + return $this->networksMerchantsPopup( 'network', $value );
530 + }
423 531
532 + if ( $command === 'choose_merchant' ) {
533 + return $this->networksMerchantsPopup( 'merchant', $value );
534 + }
535 +
536 + if ( $command === 'names_network' ) {
537 + return $this->networksMerchantsNames( 'network', $value );
538 + }
539 +
540 + if ( $command === 'names_merchant' && ! empty( $value ) ) {
541 + return $this->networksMerchantsNames( 'merchant', $value );
542 + }
543 +
544 +// switch ( $command ) {
545 +// case "choose_network":
546 +// return $this->networksMerchantsPopup( 'network', $value );
547 +// case "choose_merchant":
548 +// return $this->networksMerchantsPopup( 'merchant', $value );
549 +// case "names_network":
550 +// return $this->networksMerchantsNames( 'network', $value );
551 +// case "names_merchant":
552 +// return $this->networksMerchantsNames( 'merchant', $value );
553 +// }
554 +
555 + return '';
556 + }
557 +
424 558 function renderField($field, $index, $params) {
425 559 $pfx = $this->inputPrefix($index);
426 560 $value = $this->get($params, 'value');
427 561 $operator = $this->get($params, 'operator');
@@ -439,9 +573,9 @@
439 573 break;
440 574 case 'range':
441 575 $value = htmlspecialchars($value);
442 576 $value2 = htmlspecialchars($this->get($params, 'value2'));
443 - $and = __( 'and', DFRAPI_DOMAIN );
577 + $and = __( 'and', 'datafeedr-api' );
444 578 $input = "
445 579 <input class='short' name='{$pfx}[value]' type='text' value=\"$value\"/>{$percent_sign}
446 580 <span class='value2' style='display:none'>
447 581 $and
@@ -498,9 +632,9 @@
498 632 </div>
499 633 ";
500 634 }
501 635
502 - function render($prefix, $query, $useSelected=TRUE) {
636 + function render($prefix, $query, $useSelected=true) {
503 637 $this->prefix = $prefix;
504 638 $this->useSelected = intval($useSelected);
505 639 if(!$query)
506 640 $query = array(
@@ -522,9 +656,9 @@
522 656 $field = $this->get($fieldMap, $this->get($params, 'field'));
523 657 if(!$field)
524 658 continue;
525 659 $fieldUsed[$field['name']] = 1;
526 - $form .= $this->renderRow($field, $index++, $params, TRUE);
660 + $form .= $this->renderRow($field, $index++, $params, true);
527 661 }
528 662 $show = ($index == 0); // if none shown, show the first
529 663 foreach($fieldMap as $field) {
530 664 $name = $field['name'];
@@ -533,10 +667,10 @@
533 667 $show = FALSE;
534 668 }
535 669 }
536 670
537 - $loading = __( 'Loading, please wait', DFRAPI_DOMAIN );
538 - $add = __( 'add filter', DFRAPI_DOMAIN );
671 + $loading = __( 'Loading, please wait', 'datafeedr-api' );
672 + $add = __( 'add filter', 'datafeedr-api' );
539 673 return "
540 674 <div id='dfrapi_search_form'>
541 675 <input type='hidden' id='dfrapi_useSelected' value='{$this->useSelected}' />
542 676 <div id='dfprs_loading_content' style='display:none'>
@@ -625,9 +759,17 @@
625 759 switch($fname) {
626 760 case 'any':
627 761 case 'name':
628 762 case 'brand':
763 + case 'color':
764 + case 'material':
765 + case 'size':
766 + case 'gender':
767 + case 'sku':
768 + case 'condition':
629 769 case 'description':
770 + case 'merchant':
771 + case 'source':
630 772 case 'category':
631 773 $s = $this->fulltextFilter($operator, $value);
632 774 if(!is_null($s[0])) {
633 775 $filters []= "{$fname} {$s[0]} {$s[1]}";
@@ -640,17 +782,19 @@
640 782 case 'currency':
641 783 $op = ($operator == 'is') ? '=' : '!=';
642 784 $filters []= "{$fname} $op {$value}";
643 785 break;
644 - case 'id':
645 - $op = ($operator == 'is') ? 'IN' : '!IN';
646 - $filters []= "{$fname} $op {$value}";
647 - break;
786 + case 'id':
787 + case 'barcode':
788 + $op = ($operator == 'is') ? 'IN' : '!IN';
789 + $filters []= "{$fname} $op {$value}";
790 + break;
648 791 case 'price':
649 792 case 'finalprice':
650 793 case 'saleprice':
651 794 case 'salediscount':
652 - $conv = $fname == 'salediscount' ? 'intval' : 'dfrapi_price_to_int';
795 + case 'stockquantity':
796 + $conv = in_array( $fname, [ 'salediscount', 'stockquantity' ] ) ? 'intval' : 'dfrapi_price_to_int';
653 797 $value = $conv($value);
654 798 switch($operator) {
655 799 case 'between':
656 800 $value2 = $conv($value2);
@@ -690,17 +834,32 @@
690 834 case 'onsale':
691 835 $value = ($operator == 'yes') ? '1' : '0';
692 836 $filters []= "{$fname} = {$value}";
693 837 break;
694 - case 'direct_url':
838 + case 'instock':
839 + if ( $operator == 'yes' ) {
840 + $filters [] = "{$fname} = 1";
841 + break;
842 + } elseif ( $operator == 'no' ) {
843 + $filters [] = "{$fname} = 0";
844 + break;
845 + } else {
846 + $filters [] = "{$fname} > 0";
847 + break;
848 + }
849 + case 'direct_url':
695 850 $operator = ($operator == 'yes') ? '!EMPTY' : 'EMPTY';
696 851 $filters []= "{$fname} {$operator}";
697 852 break;
698 853 case 'image':
699 - case 'thumbnail':
700 - $operator = ($operator == 'yes') ? '!EMPTY' : 'EMPTY';
701 - $filters []= "image {$operator}";
702 - break;
854 + case 'thumbnail':
855 + $operator = ($operator == 'yes') ? '!EMPTY' : 'EMPTY';
856 + $filters []= "image {$operator}";
857 + break;
858 + case 'has_barcode':
859 + $operator = ( $operator === 'yes') ? '!EMPTY' : 'EMPTY';
860 + $filters []= "barcode {$operator}";
861 + break;
703 862 case 'time_updated':
704 863 $value = @date('Y-m-d H:i:s', strtotime($value));
705 864 switch($operator) {
706 865 case 'between':
@@ -742,9 +901,9 @@
742 901 return '
743 902 <div class="dfrapi_search_tip">
744 903 <span class="dashicons dashicons-lightbulb"></span>
745 904 <p>
746 - <strong>' . __( 'TIP:', DFRAPI_DOMAIN ) . '</strong> ' .
905 + <strong>' . __( 'TIP:', 'datafeedr-api' ) . '</strong> ' .
747 906 $tip . '
748 907 </p>
749 908 </div>
750 909 ';
@@ -754,10 +913,10 @@
754 913 return '
755 914 <p>
756 915 <span class="dashicons dashicons-info"></span>
757 916 <em>
758 - <a href="https://v4.datafeedr.com/node/620" target="_blank">' . __('Learn more', DFRAPI_DOMAIN ) . '</a> ' .
759 - __('about advanced uses of this field.', DFRAPI_DOMAIN ) . '
917 + <a href="https://datafeedrapi.helpscoutdocs.com/article/216-search-operators" target="_blank">' . __('Learn more', 'datafeedr-api' ) . '</a> ' .
918 + __('about advanced uses of this field.', 'datafeedr-api' ) . '
760 919 </em>
761 920 </p>
762 921 ';
763 922 }
@@ -766,145 +925,206 @@
766 925
767 926 $help = array();
768 927
769 928 // Any
770 - $help['any'] = '<h3>' . __('Any Field', DFRAPI_DOMAIN ) . '</h3>';
771 - $help['any'] .= '<p>' . __( 'Search all indexed text fields at once to return a broad set of results.', DFRAPI_DOMAIN ) . '</p>';
772 - $help['any'] .= '<p>' . __( 'The fields listed below are indexed as text fields and searchable using Any Field. Image, currency, and price fields are not searched.', DFRAPI_DOMAIN ) . '</p>';
773 - $help['any'] .= '<p><em>' . __( '*Note that not all merchants and networks provide every field. ', DFRAPI_DOMAIN ) . '</em></p>';
774 - $help['any'] .= '<p>' . __( 'Fields searched using Any Field:', DFRAPI_DOMAIN ) . '</p>';
775 - $help['any'] .= '<table width="100%" border="0" style="margin-bottom:20px"><tr><td width="33%" valign="top">accommodationtype<br />address<br />artist<br />author<br />bestsellers<br />brand<br />category<br />city<br />color<br />commissiontype<br />condition<br />country<br />county<br />description<br />destination<br />discount</td><td width="33%" valign="top">discounttype<br />ean<br />fabric<br />featured<br />flavour<br />gender<br />genre<br />isbn<br />language<br />location<br />manufacturer<br />manufacturerid<br />material<br />model<br />mpn<br />name</td><td width="33%" valign="top">offercode<br />offertype<br />platform<br />productnumber<br />promo<br />publisher<br />rating<br />region<br />size<br />sku<br />stars<br />state<br />subcategory<br />tags<br />upc<br />weight</td></tr></table>';
929 + $help['any'] = '<h3>' . __('Any Field', 'datafeedr-api' ) . '</h3>';
930 + $help['any'] .= '<p>' . __( 'Search all indexed text fields at once to return a broad set of results.', 'datafeedr-api' ) . '</p>';
931 + $help['any'] .= '<p>' . __( 'The fields listed below are indexed as text fields and searchable using Any Field. Image, currency, and price fields are not searched.', 'datafeedr-api' ) . '</p>';
932 + $help['any'] .= '<p><em>' . __( '*Note that not all merchants and networks provide every field. ', 'datafeedr-api' ) . '</em></p>';
933 + $help['any'] .= '<p>' . __( 'Fields searched using Any Field:', 'datafeedr-api' ) . '</p>';
934 + $help['any'] .= '<table width="100%" border="0" style="margin-bottom:20px"><tr><td width="33%" valign="top">accommodationtype<br />address<br />artist<br />author<br />bestsellers<br />brand<br />category<br />city<br />color<br />commissiontype<br />condition<br />country<br />county<br />description<br />destination<br />discount</td><td width="33%" valign="top">discounttype<br />ean<br />fabric<br />featured<br />flavour<br />gender<br />genre<br />isbn<br />language<br />location<br />manufacturer<br />manufacturerid<br />material<br />size<br />gender<br />model<br />mpn<br />name</td><td width="33%" valign="top">offercode<br />offertype<br />platform<br />productnumber<br />promo<br />publisher<br />rating<br />region<br />size<br />sku<br />stars<br />state<br />subcategory<br />tags<br />upc<br />weight</td></tr></table>';
776 935 $help['any'] .= $this->help_operators();
777 936
778 937 // Name
779 - $help['name'] = '<h3>' . __('Product Name', DFRAPI_DOMAIN ) . '</h3>';
780 - $help['name'] .= '<p>' . __( 'Search by product name to narrow your results.', DFRAPI_DOMAIN ) . '</p>';
781 - $help['name'] .= $this->help_tip( __( 'Some merchants include color, size, gender, product codes, sale information and promotions in the product name field.', DFRAPI_DOMAIN ) );
938 + $help['name'] = '<h3>' . __('Product Name', 'datafeedr-api' ) . '</h3>';
939 + $help['name'] .= '<p>' . __( 'Search by product name to narrow your results.', 'datafeedr-api' ) . '</p>';
940 + $help['name'] .= $this->help_tip( __( 'Some merchants include color, size, gender, product codes, sale information and promotions in the product name field.', 'datafeedr-api' ) );
782 941 $help['name'] .= $this->help_operators();
783 942
943 + // ID
944 + $help['id'] = '<h3>' . __('Product ID', 'datafeedr-api' ) . '</h3>';
945 + $help['id'] .= '<p>' . __( 'Search by Product ID to find specific products.', 'datafeedr-api' ) . '</p>';
946 + $help['id'] .= $this->help_tip( __( 'Separate each product ID with a comma "," to search for multiple products by their IDs.<br /><br />Example: <strong>4088900432286084, 8177000167015036, 2651801988581531</strong>', 'datafeedr-api' ) );
947 + $help['id'] .= '<p>' . __( 'Product IDs are assigned by Datafeedr and are not related to any IDs merchants use to identify their products. Each product in the Datafeedr product database has a unique Product ID.', 'datafeedr-api' ) . '</p>';
948 +// $help['id'] .= $this->help_operators();
949 +
950 + // Barcode
951 + $help['barcode'] = '<h3>' . __('Barcode', 'datafeedr-api' ) . '</h3>';
952 + $help['barcode'] .= '<p>' . __( 'Search for products by their barcode (ie. EAN, UPC or GTIN value).', 'datafeedr-api' ) . '</p>';
953 + $help['barcode'] .= $this->help_tip( __( 'Separate each barcode with a comma "," to search for multiple products by their barcodes.<br /><br />Example: <strong>889169871993, 889169900167, 889169488559</strong>', 'datafeedr-api' ) );
954 + $help['barcode'] .= '<p>' . __( 'The Barcode search filter ignores leading zeros. Therefore, searching for <strong>889169871993</strong> and searching for <strong>00889169871993</strong> will return the same results.', 'datafeedr-api' ) . '</p>';
955 +
784 956 // Brand
785 - $help['brand'] = '<h3>' . __('Brand', DFRAPI_DOMAIN ) . '</h3>';
786 - $help['brand'] .= '<p>' . __( 'Search by brand name to get specific results. Not every item has a brand name.', DFRAPI_DOMAIN ) . '</p>';
787 - $help['brand'] .= $this->help_tip( __( 'Enter the shorter version of a brand name in this field. Omit words such as "Incorporated", "Limited" and their abbreviations like Inc., Ltd. and so on.', DFRAPI_DOMAIN ) );
957 + $help['brand'] = '<h3>' . __('Brand', 'datafeedr-api' ) . '</h3>';
958 + $help['brand'] .= '<p>' . __( 'Search by brand name to get specific results. Not every item has a brand name.', 'datafeedr-api' ) . '</p>';
959 + $help['brand'] .= $this->help_tip( __( 'Enter the shorter version of a brand name in this field. Omit words such as "Incorporated", "Limited" and their abbreviations like Inc., Ltd. and so on.', 'datafeedr-api' ) );
788 960 $help['brand'] .= $this->help_operators();
789 961
962 + // Color
963 + $help['color'] = '<h3>' . __('Color', 'datafeedr-api' ) . '</h3>';
964 + $help['color'] .= '<p>' . __( 'Search by color to get specific results. Not every item has a color field.', 'datafeedr-api' ) . '</p>';
965 +
966 + // Material
967 + $help['material'] = '<h3>' . __('Material', 'datafeedr-api' ) . '</h3>';
968 + $help['material'] .= '<p>' . __( 'Search by material to get specific results. Not every item has a material field.', 'datafeedr-api' ) . '</p>';
969 +
970 + // Size
971 + $help['size'] = '<h3>' . __('Size', 'datafeedr-api' ) . '</h3>';
972 + $help['size'] .= '<p>' . __( 'Search by size to get specific results. Not every item has a size field.', 'datafeedr-api' ) . '</p>';
973 +
974 + // Gender
975 + $help['gender'] = '<h3>' . __('Gender', 'datafeedr-api' ) . '</h3>';
976 + $help['gender'] .= '<p>' . __( 'Search by gender to get specific results. Not every item has a gender field.', 'datafeedr-api' ) . '</p>';
977 +
978 + // SKU
979 + $help['sku'] = '<h3>' . __('SKU', 'datafeedr-api' ) . '</h3>';
980 + $help['sku'] .= '<p>' . __( 'Search by SKU to get specific results. Not every item has a SKU field.', 'datafeedr-api' ) . '</p>';
981 +
982 + // Condition
983 + $help['condition'] = '<h3>' . __('Condition', 'datafeedr-api' ) . '</h3>';
984 + $help['condition'] .= '<p>' . __( 'Search by condition to get specific results. Not every item has a condition field.', 'datafeedr-api' ) . '</p>';
985 +
790 986 // Description
791 - $help['description'] = '<h3>' . __('Description', DFRAPI_DOMAIN ) . '</h3>';
792 - $help['description'] .= '<p>' . __( 'Search the description field for product attributes such as size, color, material, or usage.', DFRAPI_DOMAIN ) . '</p>';
793 - $help['description'] .= $this->help_tip( __( 'Most merchants provide a product description. Some product details may only appear in the description and not in any other field. However, some merchants duplicate the product name or product code in the description field without supplying additional details or leave the product description blank.', DFRAPI_DOMAIN ) );
987 + $help['description'] = '<h3>' . __('Description', 'datafeedr-api' ) . '</h3>';
988 + $help['description'] .= '<p>' . __( 'Search the description field for product attributes such as size, color, material, gender or usage.', 'datafeedr-api' ) . '</p>';
989 + $help['description'] .= $this->help_tip( __( 'Most merchants provide a product description. Some product details may only appear in the description and not in any other field. However, some merchants duplicate the product name or product code in the description field without supplying additional details or leave the product description blank.', 'datafeedr-api' ) );
794 990 $help['description'] .= $this->help_operators();
795 991
796 992 // Tags
797 - $help['tags'] = '<h3>' . __('Tags', DFRAPI_DOMAIN ) . '</h3>';
798 - $help['tags'] .= '<p>' . __( 'Limit search results based on product tag and keyword information.', DFRAPI_DOMAIN ) . '</p>';
799 - $help['tags'] .= $this->help_tip( __( 'This field contains data from various keyword-related fields provided by the merchant. This field does not always exist.', DFRAPI_DOMAIN ) );
993 + $help['tags'] = '<h3>' . __('Tags', 'datafeedr-api' ) . '</h3>';
994 + $help['tags'] .= '<p>' . __( 'Limit search results based on product tag and keyword information.', 'datafeedr-api' ) . '</p>';
995 + $help['tags'] .= $this->help_tip( __( 'This field contains data from various keyword-related fields provided by the merchant. This field does not always exist.', 'datafeedr-api' ) );
800 996
801 997 // Category
802 - $help['category'] = '<h3>' . __('Category', DFRAPI_DOMAIN ) . '</h3>';
803 - $help['category'] .= '<p>' . __( 'Limit search results based on category information.', DFRAPI_DOMAIN ) . '</p>';
804 - $help['category'] .= $this->help_tip( __( 'This field contains data from various category-related fields provided by the merchant. This field does not always exist.', DFRAPI_DOMAIN ) );
998 + $help['category'] = '<h3>' . __('Category', 'datafeedr-api' ) . '</h3>';
999 + $help['category'] .= '<p>' . __( 'Limit search results based on category information.', 'datafeedr-api' ) . '</p>';
1000 + $help['category'] .= $this->help_tip( __( 'This field contains data from various category-related fields provided by the merchant. This field does not always exist.', 'datafeedr-api' ) );
805 1001 $help['category'] .= $this->help_operators();
806 1002
807 1003 // Type
808 - $help['type'] = '<h3>' . __('Product Type', DFRAPI_DOMAIN ) . '</h3>';
809 - $help['type'] .= '<p>' . __( 'Limit your search results to one type of item, either Product or Coupon.', DFRAPI_DOMAIN ) . '</p>';
810 - $help['type'] .= $this->help_tip( __( 'In order to use this filter, you must have already selected merchants that provide that type of item. For example, if you choose "Product type: Coupon" but have not selected any merchants that offer coupons, your search will return an error.', DFRAPI_DOMAIN ) );
1004 + $help['type'] = '<h3>' . __('Product Type', 'datafeedr-api' ) . '</h3>';
1005 + $help['type'] .= '<p>' . __( 'Limit your search results to one type of item, either Product or Coupon.', 'datafeedr-api' ) . '</p>';
1006 + $help['type'] .= $this->help_tip( __( 'In order to use this filter, you must have already selected merchants that provide that type of item. For example, if you choose "Product type: Coupon" but have not selected any merchants that offer coupons, your search will return an error.', 'datafeedr-api' ) );
811 1007
812 1008 // Currency
813 - $help['currency'] = '<h3>' . __('Currency', DFRAPI_DOMAIN ) . '</h3>';
814 - $help['currency'] .= '<p>' . __( 'Limit your search results to items with a specific currency code.', DFRAPI_DOMAIN ) . '</p>';
815 - $help['currency'] .= $this->help_tip( __( 'Selecting a currency code is one way to limit your search results to items from a specific country. However, not every item has been given a currency code value by the merchant. Items without a currency code will be excluded from your search results.', DFRAPI_DOMAIN ) );
1009 + $help['currency'] = '<h3>' . __('Currency', 'datafeedr-api' ) . '</h3>';
1010 + $help['currency'] .= '<p>' . __( 'Limit your search results to items with a specific currency code.', 'datafeedr-api' ) . '</p>';
1011 + $help['currency'] .= $this->help_tip( __( 'Selecting a currency code is one way to limit your search results to items from a specific country. However, not every item has been given a currency code value by the merchant. Items without a currency code will be excluded from your search results.', 'datafeedr-api' ) );
816 1012
817 1013 // Price
818 - $help['price'] = '<h3>' . __('Price', DFRAPI_DOMAIN ) . '</h3>';
819 - $help['price'] .= '<p>' . __( 'Filter your search results based on price. Return products less than, greater than, or within a price range that you set.', DFRAPI_DOMAIN ) . '</p>';
820 - $help['price'] .= $this->help_tip( __( 'This field does not search on sale price. If you set a price range to less than 30, you will exclude an item with a regular price of 40 that is on sale for less than 30.', DFRAPI_DOMAIN ) );
1014 + $help['price'] = '<h3>' . __('Price', 'datafeedr-api' ) . '</h3>';
1015 + $help['price'] .= '<p>' . __( 'Filter your search results based on price. Return products less than, greater than, or within a price range that you set.', 'datafeedr-api' ) . '</p>';
1016 + $help['price'] .= $this->help_tip( __( 'This field does not search on sale price. If you set a price range to less than 30, you will exclude an item with a regular price of 40 that is on sale for less than 30.', 'datafeedr-api' ) );
821 1017
822 1018 // Sale Price
823 - $help['saleprice'] = '<h3>' . __('Sale Price', DFRAPI_DOMAIN ) . '</h3>';
824 - $help['saleprice'] .= '<p>' . __( 'Filter your search results based on sale price. Return items less than, greater than, or within a sale price range that you set.', DFRAPI_DOMAIN ) . '</p>';
825 - $help['saleprice'] .= $this->help_tip( __( 'This field does not search on regular price. If you set a sale price range to between 50 and 100, an item with a sale price of 40 will be excluded even if it\'s regular price matches the range you set.', DFRAPI_DOMAIN ) );
1019 + $help['saleprice'] = '<h3>' . __('Sale Price', 'datafeedr-api' ) . '</h3>';
1020 + $help['saleprice'] .= '<p>' . __( 'Filter your search results based on sale price. Return items less than, greater than, or within a sale price range that you set.', 'datafeedr-api' ) . '</p>';
1021 + $help['saleprice'] .= $this->help_tip( __( 'This field does not search on regular price. If you set a sale price range to between 50 and 100, an item with a sale price of 40 will be excluded even if it\'s regular price matches the range you set.', 'datafeedr-api' ) );
826 1022
827 1023 // Final Price
828 - $help['finalprice'] = '<h3>' . __('Final Price', DFRAPI_DOMAIN ) . '</h3>';
829 - $help['finalprice'] .= '<p>' . __( 'Filter your search results based on the final price. Return items less than, greater than, or within a sale price range that you set.', DFRAPI_DOMAIN ) . '</p>';
830 - $help['finalprice'] .= $this->help_tip( __( 'The final price is the lower price when comparing the regular price and sale price field.', DFRAPI_DOMAIN ) );
1024 + $help['finalprice'] = '<h3>' . __('Final Price', 'datafeedr-api' ) . '</h3>';
1025 + $help['finalprice'] .= '<p>' . __( 'Filter your search results based on the final price. Return items less than, greater than, or within a sale price range that you set.', 'datafeedr-api' ) . '</p>';
1026 + $help['finalprice'] .= $this->help_tip( __( 'The final price is the lower price when comparing the regular price and sale price field.', 'datafeedr-api' ) );
831 1027
1028 + // Discount
1029 + $help['salediscount'] = '<h3>' . __('Discount', 'datafeedr-api' ) . '</h3>';
1030 + $help['salediscount'] .= '<p>' . __( 'Limit your search results to items with a specified discount. Enter the number in terms of percentage (1 - 100) to indicate a discount less than, greater than, or between a given range. You do not need to enter the percentage sign.', 'datafeedr-api' ) . '</p>';
1031 + $help['salediscount'] .= $this->help_tip( __( 'To display, for example, only products that are on sale for a discount of 20% or more, choose the "greater than" operator and type "19".', 'datafeedr-api' ) );
1032 +
832 1033 // Network
833 - $help['source_id'] = '<h3>' . __('Network', DFRAPI_DOMAIN ) . '</h3>';
834 - $help['source_id'] .= '<p>' . __( 'Limit your search results to items from one or more affiliate networks.', DFRAPI_DOMAIN ) . '</p>';
835 - $help['source_id'] .= $this->help_tip( __( 'Affiliate networks are generally country-specific. Using the Network filter is one way to limit your search results by country.', DFRAPI_DOMAIN ) );
1034 + $help['source_id'] = '<h3>' . __('Network', 'datafeedr-api' ) . '</h3>';
1035 + $help['source_id'] .= '<p>' . __( 'Limit your search results to items from one or more affiliate networks.', 'datafeedr-api' ) . '</p>';
1036 + $help['source_id'] .= $this->help_tip( __( 'Affiliate networks are generally country-specific. Using the Network filter is one way to limit your search results by country.', 'datafeedr-api' ) );
836 1037
837 1038 // Merchant
838 - $help['merchant_id'] = '<h3>' . __('Merchant', DFRAPI_DOMAIN ) . '</h3>';
839 - $help['merchant_id'] .= '<p>' . __( 'Limit your search results to items from one or more merchants.', DFRAPI_DOMAIN ) . '</p>';
840 - $help['merchant_id'] .= $this->help_tip( __( 'Using the Merchant filter is a quick way to exclude unrelated products and reduce the number of API requests made when building a Product Set. For example, if you are creating a Product Set related to cat products, exclude all merchants that only sell dog products.', DFRAPI_DOMAIN ) );
1039 + $help['merchant_id'] = '<h3>' . __('Merchant', 'datafeedr-api' ) . '</h3>';
1040 + $help['merchant_id'] .= '<p>' . __( 'Limit your search results to items from one or more merchants.', 'datafeedr-api' ) . '</p>';
1041 + $help['merchant_id'] .= $this->help_tip( __( 'Using the Merchant filter is a quick way to exclude unrelated products and reduce the number of API requests made when building a Product Set. For example, if you are creating a Product Set related to cat products, exclude all merchants that only sell dog products.', 'datafeedr-api' ) );
841 1042
842 1043 // On Sale
843 - $help['onsale'] = '<h3>' . __('On Sale', DFRAPI_DOMAIN ) . '</h3>';
844 - $help['onsale'] .= '<p>' . __( 'Set this field to "<strong>yes</strong>" to return only items which are on sale. To exclude products which are on sale, set this field to "<strong>no</strong>".', DFRAPI_DOMAIN ) . '</p>';
1044 + $help['onsale'] = '<h3>' . __('On Sale', 'datafeedr-api' ) . '</h3>';
1045 + $help['onsale'] .= '<p>' . __( 'Set this field to "<strong>yes</strong>" to return only items which are on sale. To exclude products which are on sale, set this field to "<strong>no</strong>".', 'datafeedr-api' ) . '</p>';
845 1046
1047 + // In Stock
1048 + $help['instock'] = '<h3>' . __('In Stock', 'datafeedr-api' ) . '</h3>';
1049 + $help['instock'] .= '<p>' . __( 'This allows you to filter products by stock status.', 'datafeedr-api' ) . '</p>';
1050 + $help['instock'] .= '<p>' . __( '<strong>yes or unknown</strong>: This will return products which are explicitly set as "in-stock" or products which have no field containing stock-related information.', 'datafeedr-api' ) . '</p>';
1051 + $help['instock'] .= '<p>' . __( '<strong>yes</strong>: This will only return products which are explicitly set as "in-stock".', 'datafeedr-api' ) . '</p>';
1052 + $help['instock'] .= '<p>' . __( '<strong>no</strong>: This will only return products which are explicitly set as NOT "in-stock".', 'datafeedr-api' ) . '</p>';
1053 + $help['instock'] .= $this->help_tip( __( 'Not all products contain stock-related information. Therefore selecting "yes or unknown" is the recommended choice when you want to find products which are "in-stock".', 'datafeedr-api' ) );
1054 +
1055 + // Stock Quantity
1056 + $help['instock'] = '<h3>' . __('Stock Quantity', 'datafeedr-api' ) . '</h3>';
1057 + $help['instock'] .= '<p>' . __( 'This allows you to filter products by the number of products in stock.', 'datafeedr-api' ) . '</p>';
1058 + $help['instock'] .= '<p>' . __( '<strong>NOTE</strong>: Not all products have a "Stock Quantity" value. Therefore, searching for a product with a stock quantity greater than or equal to "0" will eliminate all products which have an unknow "Stock Quantity".', 'datafeedr-api' ) . '</p>';
1059 + $help['instock'] .= '<p>' . __( 'To search for products which either have a stock quantity in a specific range AND also include products which do not have a stock quantity value, use the "between" search option and enter "-1" for the first option and enter the upper limit (ie. 100) for the second value.', 'datafeedr-api' ) . '</p>';
1060 +
846 1061 // Has Direct URL
847 - $help['direct_url'] = '<h3>' . __('Has Direct URL', DFRAPI_DOMAIN ) . '</h3>';
848 - $help['direct_url'] .= '<p>' . __( 'Limit your search results to items which have a direct URL (or which don\'t).', DFRAPI_DOMAIN ) . '</p>';
849 - $help['direct_url'] .= $this->help_tip( __( 'A "Direct URL" is a URL directly to the product page on the merchant\'s website. By default, the "Direct URL" is never used as the URL in your "Buy" links. However, if you need the products in your store to contain a "Direct URL" to the product page on the merchants\' websites, then you should use this filter. This is most useful if you are using Skimlinks (or similar service) to generate your affiliate links instead of the affiliate networks.', DFRAPI_DOMAIN ) );
1062 + $help['direct_url'] = '<h3>' . __('Has Direct URL', 'datafeedr-api' ) . '</h3>';
1063 + $help['direct_url'] .= '<p>' . __( 'Limit your search results to items which have a direct URL (or which don\'t).', 'datafeedr-api' ) . '</p>';
1064 + $help['direct_url'] .= $this->help_tip( __( 'A "Direct URL" is a URL directly to the product page on the merchant\'s website. By default, the "Direct URL" is never used as the URL in your "Buy" links. However, if you need the products in your store to contain a "Direct URL" to the product page on the merchants\' websites, then you should use this filter. This is most useful if you are using Skimlinks (or similar service) to generate your affiliate links instead of the affiliate networks.', 'datafeedr-api' ) );
850 1065
851 - // Discount
852 - $help['salediscount'] = '<h3>' . __('Discount', DFRAPI_DOMAIN ) . '</h3>';
853 - $help['salediscount'] .= '<p>' . __( 'Limit your search results to items with a specified discount. Enter the number in terms of percentage (1 - 100) to indicate a discount less than, greater than, or between a given range. You do not need to enter the percentage sign.', DFRAPI_DOMAIN ) . '</p>';
854 - $help['salediscount'] .= $this->help_tip( __( 'To display, for example, only products that are on sale for a discount of 20% or more, choose the "greater than" operator and type "19".', DFRAPI_DOMAIN ) );
1066 + // Has Image
1067 + $help['image'] = '<h3>' . __('Has Image', 'datafeedr-api' ) . '</h3>';
1068 + $help['image'] .= '<p>' . __( 'Limit your search results to items which have an image (or which don\'t).', 'datafeedr-api' ) . '</p>';
1069 + $help['image'] .= $this->help_tip( __( 'Sometimes the image URL in the merchant\'s data feed is broken. Items with broken images will still return in search results even though there appears to be no image.', 'datafeedr-api' ) );
855 1070
856 - // Has Image
857 - $help['image'] = '<h3>' . __('Has Image', DFRAPI_DOMAIN ) . '</h3>';
858 - $help['image'] .= '<p>' . __( 'Limit your search results to items which have an image (or which don\'t).', DFRAPI_DOMAIN ) . '</p>';
859 - $help['image'] .= $this->help_tip( __( 'Sometimes the image URL in the merchant\'s data feed is broken. Items with broken images will still return in search results even though there appears to be no image.', DFRAPI_DOMAIN ) );
1071 + // Has Barcode
1072 + $help['has_barcode'] = '<h3>' . __('Has Barcode', 'datafeedr-api' ) . '</h3>';
1073 + $help['has_barcode'] .= '<p>' . __( 'Limit your search results to products which have a barcode (ie. a UPC, EAN or GTIN value).', 'datafeedr-api' ) . '</p>';
860 1074
861 - // Last Updated
862 - $help['time_updated'] = '<h3>' . __('Last Updated', DFRAPI_DOMAIN ) . '</h3>';
863 - $help['time_updated'] .= '<p>' . __( 'Filter products by the last time they were updated by the merchant. Enter an English textual datetime description using PHP\'s <a href="http://www.php.net/strtotime" target="_blank">strtotime()</a> function.', DFRAPI_DOMAIN ) . '</p>';
864 - $help['time_updated'] .= '<h3>' . __('Examples', DFRAPI_DOMAIN ) . '</h3>';
1075 + // Last Updated
1076 + $help['time_updated'] = '<h3>' . __('Last Updated', 'datafeedr-api' ) . '</h3>';
1077 + $help['time_updated'] .= '<p>' . __( 'Filter products by the last time they were updated by the merchant. Enter an English textual datetime description using PHP\'s <a href="http://www.php.net/strtotime" target="_blank">strtotime()</a> function.', 'datafeedr-api' ) . '</p>';
1078 + $help['time_updated'] .= '<h3>' . __('Examples', 'datafeedr-api' ) . '</h3>';
865 1079 $help['time_updated'] .= '<p>';
866 - $help['time_updated'] .= '<tt>' . __('last week', DFRAPI_DOMAIN ) . '</tt><br />';
867 - $help['time_updated'] .= '<tt>' . __('2 days ago', DFRAPI_DOMAIN ) . '</tt><br />';
868 - $help['time_updated'] .= '<tt>' . __('1 month ago', DFRAPI_DOMAIN ) . '</tt>';
1080 + $help['time_updated'] .= '<tt>' . __('last week', 'datafeedr-api' ) . '</tt><br />';
1081 + $help['time_updated'] .= '<tt>' . __('2 days ago', 'datafeedr-api' ) . '</tt><br />';
1082 + $help['time_updated'] .= '<tt>' . __('1 month ago', 'datafeedr-api' ) . '</tt>';
869 1083 $help['time_updated'] .= '</p>';
870 - $help['time_updated'] .= '<p>' . __( '', DFRAPI_DOMAIN ) . '</p>';
871 - $help['time_updated'] .= $this->help_tip( __( 'An item\'s Last Updated date will not change if the merchant does not change any product information during a data feed update.', DFRAPI_DOMAIN ) );
1084 + $help['time_updated'] .= '<p>' . __( '', 'datafeedr-api' ) . '</p>';
1085 + $help['time_updated'] .= $this->help_tip( __( 'An item\'s Last Updated date will not change if the merchant does not change any product information during a data feed update.', 'datafeedr-api' ) );
872 1086
873 1087 // Limit
874 - $help['limit'] = '<h3>' . __('Limit', DFRAPI_DOMAIN ) . '</h3>';
875 - $help['limit'] .= '<p>' . __( 'Limit the number of items returned in your search results. The maximum number of products that can be returned is 10,000.', DFRAPI_DOMAIN ) . '</p>';
876 - $help['limit'] .= $this->help_tip( __( 'Limiting the number of products returned helps reduce the number of API requests made during searching and updating Product Sets.', DFRAPI_DOMAIN ) );
1088 + $help['limit'] = '<h3>' . __('Limit', 'datafeedr-api' ) . '</h3>';
1089 + $help['limit'] .= '<p>' . __( 'Limit the number of items returned in your search results. The maximum number of products that can be returned is 10,000.', 'datafeedr-api' ) . '</p>';
1090 + $help['limit'] .= $this->help_tip( __( 'Limiting the number of products returned helps reduce the number of API requests made during searching and updating Product Sets.', 'datafeedr-api' ) );
877 1091
1092 + // Merchant Limit
1093 + $help['merchant_limit'] = '<h3>' . __('Merchant Limit', 'datafeedr-api' ) . '</h3>';
1094 + $help['merchant_limit'] .= '<p>' . __( 'Limit the number of items returned per merchant. The number must be between 1 and 10.', 'datafeedr-api' ) . '</p>';
1095 + $help['merchant_limit'] .= $this->help_tip( __( 'This is useful to use when you have one merchant which has many products that match your search but other merchants have fewer of those same products and you want equal distribution between all merchants.', 'datafeedr-api' ) );
1096 +
878 1097 // Sort By
879 - $help['sort'] = '<h3>' . __('Sort By', DFRAPI_DOMAIN ) . '</h3>';
880 - $help['sort'] .= '<p>' . __( 'Change the sort criteria by which items are displayed in your search results.', DFRAPI_DOMAIN ) . '</p>';
881 - $help['sort'] .= $this->help_tip( __( 'By default, search results are sorted by relevance. You can change that to sort by price, sale price, discount, or last updated date in ascending order (lowest to highest) or descending order (highest to lowest). You can also sort by merchant, which lists items alphabetically by merchant name.', DFRAPI_DOMAIN ) );
1098 + $help['sort'] = '<h3>' . __('Sort By', 'datafeedr-api' ) . '</h3>';
1099 + $help['sort'] .= '<p>' . __( 'Change the sort criteria by which items are displayed in your search results.', 'datafeedr-api' ) . '</p>';
1100 + $help['sort'] .= $this->help_tip( __( 'By default, search results are sorted by relevance. You can change that to sort by price, sale price, discount, or last updated date in ascending order (lowest to highest) or descending order (highest to lowest). You can also sort by merchant, which lists items alphabetically by merchant name.', 'datafeedr-api' ) );
882 1101
883 1102 // Exclude Duplicates
884 - $help['duplicates'] = '<h3>' . __('Exclude Duplicates', DFRAPI_DOMAIN ) . '</h3>';
885 - $help['duplicates'] .= '<p>' . __( 'Exclude items that contain identical product names, image URLs, etc. Enter one or more terms from the list below. Separate terms by a space (meaning AND) or | (pipe symbol, meaning OR).', DFRAPI_DOMAIN ) . '<br />';
886 - $help['duplicates'] .= '<p>' . __( 'Enter one of these terms to exclude duplicates matching these fields:', DFRAPI_DOMAIN ) . '<br />';
887 - $help['duplicates'] .= '<tt>' . __('name', DFRAPI_DOMAIN ) . '</tt><br />';
888 - $help['duplicates'] .= '<tt>' . __('brand', DFRAPI_DOMAIN ) . '</tt><br />';
889 - $help['duplicates'] .= '<tt>' . __('currency', DFRAPI_DOMAIN ) . '</tt><br />';
890 - $help['duplicates'] .= '<tt>' . __('price', DFRAPI_DOMAIN ) . '</tt><br />';
891 - $help['duplicates'] .= '<tt>' . __('saleprice', DFRAPI_DOMAIN ) . '</tt><br />';
892 - $help['duplicates'] .= '<tt>' . __('source_id', DFRAPI_DOMAIN ) . '</tt><br />';
893 - $help['duplicates'] .= '<tt>' . __('merchant_id', DFRAPI_DOMAIN ) . '</tt><br />';
894 - $help['duplicates'] .= '<tt>' . __('onsale', DFRAPI_DOMAIN ) . '</tt><br />';
895 - $help['duplicates'] .= '<tt>' . __('image', DFRAPI_DOMAIN ) . '</tt><br />';
896 - $help['duplicates'] .= '<tt>' . __('thumbnail', DFRAPI_DOMAIN ) . '</tt>';
1103 + $help['duplicates'] = '<h3>' . __('Exclude Duplicates', 'datafeedr-api' ) . '</h3>';
1104 + $help['duplicates'] .= '<p>' . __( 'Exclude items that contain identical product names, image URLs, etc. Enter one or more terms from the list below. Separate terms by a space (meaning AND) or | (pipe symbol, meaning OR).', 'datafeedr-api' ) . '<br />';
1105 + $help['duplicates'] .= '<p>' . __( 'Enter one of these terms to exclude duplicates matching these fields:', 'datafeedr-api' ) . '<br />';
1106 + $help['duplicates'] .= '<tt>' . __('name', 'datafeedr-api' ) . '</tt><br />';
1107 + $help['duplicates'] .= '<tt>' . __('brand', 'datafeedr-api' ) . '</tt><br />';
1108 + $help['duplicates'] .= '<tt>' . __('description', 'datafeedr-api' ) . '</tt><br />';
1109 + $help['duplicates'] .= '<tt>' . __('currency', 'datafeedr-api' ) . '</tt><br />';
1110 + $help['duplicates'] .= '<tt>' . __('price', 'datafeedr-api' ) . '</tt><br />';
1111 + $help['duplicates'] .= '<tt>' . __('saleprice', 'datafeedr-api' ) . '</tt><br />';
1112 + $help['duplicates'] .= '<tt>' . __('source_id', 'datafeedr-api' ) . '</tt><br />';
1113 + $help['duplicates'] .= '<tt>' . __('merchant_id', 'datafeedr-api' ) . '</tt><br />';
1114 + $help['duplicates'] .= '<tt>' . __('direct_url', 'datafeedr-api' ) . '</tt><br />';
1115 + $help['duplicates'] .= '<tt>' . __('onsale', 'datafeedr-api' ) . '</tt><br />';
1116 + $help['duplicates'] .= '<tt>' . __('image', 'datafeedr-api' ) . '</tt><br />';
1117 + $help['duplicates'] .= '<tt>' . __('thumbnail', 'datafeedr-api' ) . '</tt>';
897 1118 $help['duplicates'] .= '</p>';
898 - $help['duplicates'] .= '<h3>' . __('Examples', DFRAPI_DOMAIN ) . '</h3>';
1119 + $help['duplicates'] .= '<h3>' . __('Examples', 'datafeedr-api' ) . '</h3>';
899 1120 $help['duplicates'] .= '<p>';
900 - $help['duplicates'] .= '<tt>' . __('image</tt> - Exclude items which have the same image URL.', DFRAPI_DOMAIN ) . '<br />';
901 - $help['duplicates'] .= '<tt>' . __('name image</tt> - Exclude items with the same name AND the same image URL.', DFRAPI_DOMAIN ) . '<br />';
902 - $help['duplicates'] .= '<tt>' . __('name|image</tt> - Exclude items with the same name OR the same image URL.', DFRAPI_DOMAIN ) . '<br />';
903 - $help['duplicates'] .= '<tt>' . __('merchant_id name|image</tt> - Exclude items which have the same merchant id AND (product name OR image URL).', DFRAPI_DOMAIN ) . '<br />';
1121 + $help['duplicates'] .= '<tt>' . __('image</tt> - Exclude items which have the same image URL.', 'datafeedr-api' ) . '<br />';
1122 + $help['duplicates'] .= '<tt>' . __('name image</tt> - Exclude items with the same name AND the same image URL.', 'datafeedr-api' ) . '<br />';
1123 + $help['duplicates'] .= '<tt>' . __('name|image</tt> - Exclude items with the same name OR the same image URL.', 'datafeedr-api' ) . '<br />';
1124 + $help['duplicates'] .= '<tt>' . __('merchant_id name|image</tt> - Exclude items which have the same merchant id AND (product name OR image URL).', 'datafeedr-api' ) . '<br />';
904 1125 $help['duplicates'] .= '</p>';
905 - $help['duplicates'] .= $this->help_tip( __( 'By excluding duplicates, you will eliminate all but one item. For example, if 20 products have identical image URLs and you exclude duplicates matching the <strong>image</strong> field, <em>one</em> item will be returned and 19 items will be excluded.', DFRAPI_DOMAIN ) );
906 -
1126 + $help['duplicates'] .= $this->help_tip( __( 'By excluding duplicates, you will eliminate all but one item. For example, if 20 products have identical image URLs and you exclude duplicates matching the <strong>image</strong> field, <em>one</em> item will be returned and 19 items will be excluded.', 'datafeedr-api' ) );
907 1127
908 1128 if (isset($help[$field])) {
909 1129 return $help[$field];
910 1130 } else {