-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
readme.txt
478 lines (330 loc) · 21.4 KB
/
readme.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
=== PLUGIN_TITLE ===
Contributors: iworks
Donate link: https://ko-fi.com/iworks?utm_source=omnibus&utm_medium=readme-donate
Tags: WooCommerce, omnibus, price, shop, e-commerce
Requires at least: PLUGIN_REQUIRES_WORDPRESS
Tested up to: PLUGIN_TESTED_WORDPRESS
Stable tag: PLUGIN_VERSION
Requires PHP: PLUGIN_REQUIRES_PHP
License: GPLv3 or later
PLUGIN_TAGLINE
== Description ==
This plugin allows your site to be compliant with the Directive of the European Parliament and of the Council (EU) 2019/2161 of November 27, 2019, known as the "Omnibus Directive."
This plugin:
* Saves the current price and keeps it.
* Adds two additional fields in the product or course edit view: the lowest price and the effective date.
* Display information on the item (product, course, etc).
Omnibus plugin support plugins:
* **[WooCommerce](https://wordpress.org/plugins/woocommerce/)**
* [Easy Digital Downloads](https://wordpress.org/plugins/easy-digital-downloads/)
* [LearnPress](https://wordpress.org/plugins/learnpress/)
* [Tutor LMS](https://wordpress.org/plugins/tutor/) with WooCommerce
* [YITH WooCommerce Product Bundles](https://wordpress.org/plugins/yith-woocommerce-product-bundles/)
* [Debug Bar](https://wordpress.org/plugins/debug-bar/)
= Directive (EU) 2019/2161 of the European Parliament =
> Article 6a
> 1. Any announcement of a price reduction shall indicate the prior price applied by the trader for a determined period of time prior to the application of the price reduction.
> 2. The prior price means the lowest price applied by the trader during a period of time not shorter than 30 days prior to the application of the price reduction.
Read more: [Directive 2019/2161](https://eur-lex.europa.eu/eli/dir/2019/2161/oj).
= See room for improvement? =
Great! There are several ways you can get involved to help make PLUGIN_TITLE better:
1. **Report Bugs:** If you find a bug, error or other problem, please report it! You can do this by [creating a new topic](https://wordpress.org/support/plugin/omnibus/) in the plugin forum. Once a developer can verify the bug by reproducing it, they will create an official bug report in [GitHub](PLUGIN_GITHUB_WEBSITE) where the bug will be worked on.
2. **Suggest New Features:** Have an awesome idea? Please share it! Simply [create a new topic](https://wordpress.org/support/plugin/omnibus/) in the plugin forum to express your thoughts on why the feature should be included and get a discussion going around your idea.
3. **Issue Pull Requests:** If you're a developer, the easiest way to get involved is to help out on [issues already reported](PLUGIN_GITHUB_WEBSITE/issues) in GitHub. Be sure to check out the [contributing guide](PLUGIN_GITHUB_WEBSITE/blob/master/contributing.md) for developers.
Thank you for wanting to make PLUGIN_TITLE better for everyone!
== Installation ==
There are 3 ways to install this plugin:
= 1. The super-easy way =
1. Navigate to WPA > the Plugins and click the `Add New` button.
1. Search for `PLUGIN_TITLE`.
1. Click to install.
1. Activate the plugin.
1. WooCommerce: Check the configuration by going to WPA > WooCommerce > Settings > Omnibus.
1. LearnPress: Check the configuration by going to WPA > LearnPress > Settings > Courses > Omnibus Directive Settings.
= 2. The easy way =
1. Download the plugin (.zip file) on the right column of this page.
1. Navigate to WPA > the Plugins and click the `Add New` button.
1. Select the button `Upload Plugin`.
1. Upload the .zip file you just downloaded.
1. Activate the plugin.
1. WooCommerce: Check the configuration by going to WPA > WooCommerce > Settings > Omnibus.
1. LearnPress: Check the configuration by going to WPA > LearnPress > Settings > Courses > Omnibus Directive Settings.
= 3. The old and reliable way (FTP) =
1. Upload the `omnibus` folder to the `/wp-content/plugins/` directory.
1. Activate the plugin through the 'Plugins' menu in WordPress.
1. WooCommerce: Check the configuration by going to WPA > WooCommerce > Settings > Omnibus.
1. LearnPress: Check the configuration by going to WPA > LearnPress > Settings > Courses > Omnibus Directive Settings.
== Frequently Asked Questions ==
= How can I display the Omnibus message anywhere? =
You can use the `omnibus_price_message` shortcode:
Just edit your product and insert it into the content:
`
[omnibus_price_message]
`
If you need the Omnibus message outside of a product, you have to add the `id` param with the product ID.
`
[omnibus_price_message id="example-id"]
`
= How can I use an action to display the Omnibus message anywhere? =
Use the `iworks_omnibus_wc_lowest_price_message` action with the product ID or on a single product page.
For a single product:
`
do_action( 'iworks_omnibus_wc_lowest_price_message' );
`
For any WooCommerce product:
`
do_action( 'iworks_omnibus_wc_lowest_price_message', $product_ID );
`
= I have a problem with the plugin, or I want to suggest a feature. Where can I do this? =
You can do it on [Support Threads](https://wordpress.org/support/plugin/omnibus/#new-topic-0), but please add your ticket to [Github Issues](PLUGIN_GITHUB_WEBSITE/issues).
= How can I avoid saving the price log? =
When you want to skip saving a price during the insert or update product, you can use `iworks_omnibus_add_price_log_skip` filter to avoid price logging.
`
<?php
add_filter( 'iworks_omnibus_add_price_log_skip', '__return_false' );
?>
`
= How can I get lowest price log data? =
You should use `iworks_omnibus_wc_get_lowest_price` filter to get array.
On single product page, without product ID:
`
<?php
$lowest_price_log = apply_filters( 'iworks_omnibus_wc_get_lowest_price', array() );
?>
`
Anywhere with the product ID:
`
<?php
$lowest_price_log = apply_filters( 'iworks_omnibus_wc_get_lowest_price', array(), $product_ID );
?>
`
= How can I strip HTML from a shortcode message? =
Please set the "strip_tags" parameter to "yes":
`
[omnibus_price_message strip_tags="yes"]
`
= How can I use my own template in the shortcode message? =
Please add `template` param with needed format:
`
[omnibus_price_message template="This is price: {price}!"]
`
= How can I remove all this plugin related data? =
To remove all data saved by this plugin, you should use the SQL command.
Warning: This operation can be undone.
Please be sure you have the database backup before you try to use the command below:
`
delete from {$wpdb->postmeta} where meta_key in (
'_iwo_price_lowest_is_short',
'_iwo_last_price_drop_timestamp',
'_iwo_price_last_change',
'_iwo_price_lowest'
);
`
= What is the minimum WooCommerce version required? =
The minimum WooCommerce version required is 5.5.0.
== Screenshots ==
1. A simple WooCommerce product on the front end.
1. A simple WooCommerce product on the admin panel.
1. A variable WooCommerce product on the front end.
1. A variable WooCommerce product on the front end.
1. A variable WooCommerce product on the admin panel.
1. A Tutor LMS course on the front end.
1. A LearnPress course on the front end.
1. A YITH WooCommerce Product Bundle on the front end.
1. The WooCommerce configuration.
== Changelog ==
Project maintained on github at [iworks/omnibus](PLUGIN_GITHUB_WEBSITE).
= 3.0.3 (2024-xx-xx) =
* The omnibus price for variant in admin panel has been fixed.
= 3.0.2 (2024-03-14) =
* The general omnibus price for variable products has been fixed. Props for [Bartek Konopka](https://wordpress.org/support/users/bartekkonopka/).
* The translators strings where been added.
* The function `date()` has been replaced by the function `gmdate()`.
* The output sanitization where been added.
* The [iWorks Rate](https://github.com/iworks/iworks-rate) module has been updated to 2.1.9.
= 3.0.1 (2024-03-12) =
* The zero variant price has been fixed.
= 3.0.0 (2024-01-19) =
* A new way of logging changes - more efficient, faster, more flexible. Complete overhaul of the way changes are saved.
* A support for promotion schedule has been added.
* Price history chart has been added to [Debug Bar] panel.
* The [iWorks Rate](https://github.com/iworks/iworks-rate) module has been updated to 2.1.8.
= 2.5.7 (2024-01-16) =
* An extra check for the product has been added.
= 2.5.6 (2024-01-16) =
* Issue with price display when tax rates are not defined has been fixed [#24](https://github.com/iworks/omnibus/issues/24). Props for [stalica](https://github.com/stalica).
* The [iWorks Rate](https://github.com/iworks/iworks-rate) module has been updated to 2.1.7.
= 2.5.5 (2024-01-10) =
* In some configurations with taxes, it was an issue to display the previous price with or without tax. Props for [Agata Wiatrowska](https://www.facebook.com/agatawiatr).
= 2.5.4 (2024-01-09) =
* The unexpectedly growing database has been fixed. [#22](https://github.com/iworks/omnibus/issues/22). Props for [Karol](https://wordpress.org/support/users/lewshop/).
= 2.5.3 (2024-01-05) =
* Fixed problem on quick edit screen. [#21](https://github.com/iworks/omnibus/issues/21). Props for [Igorjup](https://github.com/Igorjup).
* Names of integration classes has been changed.
= 2.5.2 (2024-01-03) =
* Extra admin CSS has been improved.
* Handling "Short Term Products" has been fixed. Props for [Mychal](https://wordpress.org/support/users/mychal/).
* The action `iworks_omnibus/wc/save_price_history/action` has been added. It can be used to insert a price history change element.
* The option "I don't have this type of products" for "Short Term Products" has been added.
* The "Short Term Product" for variants has been added.
= 2.5.1 (2024-01-02) =
* Checking before price comparison has been added. [#17](https://github.com/iworks/omnibus/issues/17). Props for [Niko Vittaniemi](https://wordpress.org/support/users/nikov/).
* The `data-iwo-product_id` for the price message has been added. [#14](https://github.com/iworks/omnibus/issues/14).
* The `data-iwo-variation_id` for the price message has been added. [#14](https://github.com/iworks/omnibus/issues/14).
* The function `check_ajax_referer()` has been added for checking expanded variant edits.
* The function `strip_tags()` has been replaced by the function `wp_strip_all_tags()`.
* The integration with the [Debug Bar] for variants has been improved.
* The [iWorks Rate](https://github.com/iworks/iworks-rate) module has been updated to 2.1.6.
= 2.5.0 (2023-11-19) =
* The ability to show the regular price as the last one available before the promotion was introduced.
* The check for function `get_current_screen()` has been added. Props for [mic22info](https://wordpress.org/support/users/mic22info/).
* The integration with the [Debug Bar] plugin has been added.
= 2.4.1 (2023-11-09) =
* The critical error on product edit page has been removed.
= 2.4.0 (2023-11-09) =
* Visibility of very old price has been fixed.
* Prices changes logging has been added.
* The [iWorks Rate](https://github.com/iworks/iworks-rate) module has been updated to 2.1.3.
= 2.3.9 (2023-06-22) =
* Proper handling of the `$content` param has been added to the `omnibus_price_message` shortcode.
* The data `date-iwo-diff-in-days` has been added.
* A warning during editing has been removed. Props for [slkaz](https://wordpress.org/support/users/slkaz/).
= 2.3.8 (2023-06-14) =
* The product check added in version 2.3.5 has been removed.
= 2.3.7 (2023-06-13) =
* The issue with missing Omnibus price has been fixed. Props for [Adrian](https://wordpress.org/support/users/cometto/).
= 2.3.6 (2023-06-13) =
* The unnecessary extra argument from the `get_price()` function has been removed.
= 2.3.5 (2023-06-12) =
* A full log of price changes has been added.
* An extra check for WooCommerce integration has been added to avoid critical errors when a shortcode is called with the wrong post type. Props for (wapozon11)[https://wordpress.org/support/users/wapozon11/].
* The critical error for old PHP has been fixed. Props for [mlodyno](https://github.com/mlodyno). [Issue #2](https://github.com/iworks/omnibus/issues/2).
* The deprecated `get_product` function has been updated with the `wc_get_product` function. Props for [kanlukasz](https://github.com/kanlukasz).
* The handling of products in the shortcode has been improved.
* The [iWorks Rate](https://github.com/iworks/iworks-rate) module has been updated to 2.1.2.
* The settings link on the plugins screen has been changed.
* The user ID has been added to the price log.
* Unnecessary use of the function `sprintf()` has been fixed. Props for [Aleksander Mirecki](https://geekroom.pl/).
= 2.3.4 (2023-02-04) =
* Checking for the WooCommerce version has been added. The minimum WooCommerce version required is 5.5.0.
= 2.3.3 (2023-02-03) =
* The fatal error on the options page has been fixed. Props for [nekodo88](https://wordpress.org/support/users/nekodo88/).
= 2.3.2 (2023-01-27) =
* The `iworks_omnibus_add_price_log_data` filter has been added to allow for the modification of logged data.
* The `iworks_omnibus_wc_get_lowest_price` filter has been added to allow getting the lowest price log entry.
* The `strip_tags` param has been added to the `omnibus_price_message` to allow stripe HTML tags.
* The `template` param has been added to the `omnibus_price_message` to allow users to use their own message template.
= 2.3.1 (2023-01-25) =
* An issue with the inform message when taxes are enabled has been fixed. Props for [Niko Vittaniemi](https://wordpress.org/support/users/nikov/).
* The `_iwo_price_last_change` custom field has been added.
= 2.3.0 (2023-01-24) =
* The configuration for WooCommerce has been heavily remodeled.
* The plugin configuration has been moved from "WooCommerce/Settings/Products/Omnibus Directive" to "WooCommerce/Settings/Omnibus."
* The `iworks_omnibus_message_template` filter has been added to allow changing the message template.
* The `iworks_omnibus_add_price_log_skip` filter has been added to allow skip logging of prices.
* The short format for the admin products list page has been added.
* An issue with the shortcode ignoring configuration settings has been fixed. Props for [marktylczynski](https://wordpress.org/support/users/marktylczynski/).
* The integration with the "Tutor LMS" plugin has been improved.
= 2.2.3 (2023-01-12) =
* To avoid incorrect filter calls without a second parameter, the `woocommerce_duplicate_product_exclude_meta` filter function now has a default value for the second parameter.
* Unquoted attribute values in HTML have been fixed. Props for [Michał](https://wordpress.org/support/users/mkrawczykowski/).
= 2.2.2 (2023-01-10) =
* When browsing the products, the plugin will try to complete the data; if it is missing, it will save the current price with the date of the last modification of the product.
* The filter `orphan_replace` from the [Orphans](https://wordpress.org/plugins/sierotki/) plugins has been added to the price message.
= 2.2.1 (2023-01-10) =
* An issue with ignoring taxes by price is replaced by a placeholder. Props for [Agniesz Kalukoszek](https://wordpress.org/support/users/agnieszkalukoszek/).
= 2.2.0 (2023-01-09) =
* Placeholders: `{price}`, `{timestamp}`, `{days}` and `{when}` has been added to the price message.
* A few new message display positions have been added.
* An issue with saving the last price change has been fixed. It was saved only when the sale price was changed, not always when the price was changed. Props for [Rafał Bieleniewicz](https://wordpress.org/support/users/bielen2k/).
= 2.1.6 (2023-01-08) =
* In order to reduce confusion, the default displayed data for a product in the admin panel that does not have a previous price saved has been changed.
* Resolved an issue with retrieving Omnibus price for variant. Props for [Mychal](https://wordpress.org/support/users/mychal/).
* The ability to toggle the Omnibus message when we do not have enough previous data available has been added. By default, it shows the current price.
= 2.1.5 (2023-01-08) =
* Resolved an issue with retrieving Omnibus price for variants. Props for [Mychal](https://wordpress.org/support/users/mychal/).
* The ability to toggle the Omnibus message on WooCommerce Cart Page has been added. By default is hidden.
* The settings screen has been slightly improved.
= 2.1.4 (2023-01-07) =
* Missing check for content has been fixed. Props for [kowaliix](https://wordpress.org/support/users/kowaliix/).
* Resolved an issue with retrieving Omnibus data for variants. Props for [Mychal](https://wordpress.org/support/users/mychal/).
* The action `omnibus/loaded` has been added. It is fired at the and of `plugins_loaded` action.
* The "do not show" option has been added for anybody who wants to use the action or the shortcode.
= 2.1.3 (2023-01-05) =
* Fixed issue with getting ID. Props for [shamppi](https://wordpress.org/support/users/shamppi/).
= 2.1.2 (2023-01-05) =
* Fixed typo.
= 2.1.1 (2023-01-05) =
* The wrong default for the "Display only for the product on sale" field has been fixed. Props for [krzyszt](https://wordpress.org/support/users/krzyszt/).
= 2.1.0 (2023-01-05) =
* Default values from the LearnPress configuration have been added.
* Exclude meta keys from WooCommerce product duplication has been added.
* The LearnPress plugin configuration has been added.
* The LearnPress plugin configuration has been removed from the WooCommerce configuration.
* The link to the LearnPress Omnibus configuration has been added to the plugin row actions.
* The link to the WooCommerce Omnibus configuration has been added to the plugin row actions.
= 2.0.2 (2023-01-04) =
* Price-checking so as not to log it if it's not there has been added.
* The regular price is saved now when the on-sale price is empty.
= 2.0.1 (2023-01-04) =
* Resolved a problem with empty prices in history.
= 2.0.0 (2023-01-04) =
* Adequate implementation of Directive (EU) 2019/2161 - Article 6a.
* Custom tax-related messages have been removed.
* Data saving has been restricted to only published items.
* The `get_sale_price()` function has been used instead of `get_price()`.
= 1.2.6 (2023-01-03) =
* Renamed the plugin "Omnibus — show the lowest price" instead of "Omnibus — Show the lowest price of a product."
* The ability to configure custom messages has been added.
* The options have been reordered.
= 1.2.5 (2023-01-03) =
* The ability to handle product prices with or without taxes has been added.
* The ability to toggle the Omnibus message only for products on sale has been added. This is turned off by default.
* Two tax-related versions of the message have been added.
= 1.2.4 (2023-01-02) =
* Clarified the meaning of the "Shop Page" setting.
* The ability to toggle the Omnibus message in any other place has been added. By default is hidden.
* The `is_main_query()` function check has been added to checking `is_single()`.
= 1.2.3 (2023-01-02) =
* The ability to toggle the Omnibus message on any loop has been added. By default is hidden.
* The `omnibus_price_message` shortcode has been added.
= 1.2.2 (2023-01-02) =
* A warning in the related products loop check has been fixed. Props for [pietrzyk25](https://wordpress.org/support/users/pietrzyk25/).
* If no data is available, displaying the current price as the lowest has been added.
= 1.2.1 (2023-01-02) =
* Corrected a critical error that occurred while adding a new product. Props for [rask44](https://wordpress.org/support/users/rask44/).
= 1.2.0 (2023-01-02) =
* Added support for the "Easy Digital Downloads" plugin.
* Renamed the plugin "Omnibus — Show the lowest price of a product" instead of "Omnibus."
* The `iworks_omnibus_days` filter has been added to the number of days amount.
* The `iworks_omnibus_integration_woocommerce_price_lowest` filter has been added.
* The `iworks_omnibus_message` filter has been added to the message.
* The `iworks_omnibus_show` filter has been added.
* The `iworks_omnibus_wc_lowest_price_message` action has been added to show the Omnibus message by product ID.
* The ability to toggle the Omnibus message on the taxonomy page has been added. By default is hidden.
* The ability to toggle the Omnibus message when the price was not changed has been added. By default is shown.
= 1.1.1 (2022-12-31) =
* The ability to toggle the Omnibus message in related products has been added. By default is hidden.
* On the shop page, you can now toggle the Omnibus message. By default is hidden.
* Fixed a typo in the "Where to display" option.
= 1.1.0 (2022-12-30) =
* Control over where Omnibus messages appear has been added. By default is after the price.
* Added the ability to toggle the Omnibus message when editing an admin product. By default is shown.
* Added the ability to toggle the Omnibus message on the admin products list. By default is shown.
* The ability to toggle the Omnibus message on a single product has been added. By default is shown.
* The ability to toggle the Omnibus message on variable products has been added. By default is shown.
* The ability to toggle the Omnibus message on the variant has been added. By default is shown.
* Added support for the "YITH WooCommerce Product Bundles" plugin.
= 1.0.1 (2022-12-29) =
* Support for the "Tutor LMS" plugin has been added.
* Support for the "LearnPress" plugin has been added.
= 1.0.0 (2022-12-29) =
* Support for the "WooCommerce" plugin has been added.
* Init.
== Upgrade Notice ==
= 2.5.0 =
* The ability to show the regular price as the last one available before the promotion was introduced. Check it on WordPress Admin -> WooCommerce -> Settings -> Omnibus -> Messages.
= 2.1.0 =
Better integration with the LearnPress plugin has been added.
= 2.0.0 =
The most important change is the correct implementation of the directive, which says that the last lowest price from 30 days after the activation of the promotion should be presented. This means that the price may be earlier than the last 30 days and may be higher than the current promotional price.