Commit Graph

528 Commits

Author SHA1 Message Date
Mike Jolley 380201be33
Merge pull request #22417 from woocommerce/fix/21175
Sort countries using new ascii comparison function
2019-01-22 14:47:41 +00:00
Gerhard 4fa2856d86 Renamed vars so need to used the new vars. 2019-01-22 15:39:17 +02:00
Gerhard 1664181a63 Wrap iconv usage in function_exists for compatibility. 2019-01-22 15:26:40 +02:00
Mike Jolley c830d429ef
Merge pull request #22435 from zJesusJavier/patch-2
Updating Venezuelan Currency
2019-01-21 15:01:18 +00:00
Mike Jolley 0cf82b8937 Use fixed transient naming in wc_get_shipping_method_count 2019-01-21 12:05:58 +00:00
Claudiu Lodromanean 7f78cc3acc
Merge pull request #22334 from Prospress/fix/22326
add gutenberg block preprocessor filter to shop page content
2019-01-18 09:29:28 -08:00
Ron Rennick dad1ffb4c9 use function_exists instead of version_compare 2019-01-17 16:14:53 -04:00
Jesús Ramirez 4c8662c7f1
Update wc-core-functions.php 2019-01-16 16:51:07 -04:00
Ron Rennick 9337ca51e4 add WP version check for short description block filter 2019-01-16 12:49:25 -04:00
Jesús Ramirez 7e1ef44b02
Update wc-core-functions.php 2019-01-16 08:49:17 -04:00
Jesús Ramirez 88335691cd
Updating Venezuelan Currency
The new Venezuelan currency is Bs S
2019-01-13 10:01:37 -04:00
Gerhard f8dfac9f48 Add wc_ascii_uasort_comparison function to compare values based on ascii values 2019-01-11 13:18:59 +02:00
Mike Jolley a69ce0bfcb
Merge pull request #21764 from leewillis77/wc_get_template_filter
Allow plugins to filter located template location before failing
2019-01-08 14:23:58 +00:00
Mike Jolley cb95d31066 Remove repetition from wc_get_customer_default_location and add validity check 2019-01-07 15:01:46 +00:00
Mike Jolley 864e0237c7 Merge remote-tracking branch 'origin' into pr/22125 2019-01-07 14:14:50 +00:00
JeroenSormani f4775ccd90 Use shipping method instead of property through magic + doc return statements 2019-01-04 12:41:38 +00:00
Ron Rennick 0be3c5c690 add gutenberg block preprocessor filter to shop page content 2019-01-03 16:22:55 -04:00
Will Gorham 329d415cfd When selling to a single country, force user location to that country 2018-12-04 14:47:04 -05:00
Rodrigo Primo b3bfb77edb fix phpcs error 2018-11-22 10:58:55 -02:00
Rodrigo Primo 12bac0f2b6 Merge branch 'master' into fix/21790 2018-11-22 10:57:47 -02:00
Rodrigo Primo 2c8d006c37 Update PHPCompatibility sniff names
The name of some sniffs changed in the most recent PHPCompatiblity version. This commit update all instances where those names are used in WooCommerce codebase.
2018-11-21 11:08:26 -02:00
Rodrigo Primo e467737653 phpcs fixes 2018-11-21 11:06:42 -02:00
claudiulodro ebea6b96be When only selling to one country set customer location to that country 2018-11-20 12:07:57 -08:00
Ron Rennick c911d90614 use lower case for Croatian Kuna symbol 2018-11-15 13:36:36 -04:00
claudiulodro 0488bcd324 fix typo 2018-11-06 15:53:11 -05:00
roykho 800ed5fe73
Check priority index before comparing 2018-11-03 08:13:14 -07:00
Lee Willis b826a80e93 Allow plugins to filter located template location before failing 2018-10-31 09:48:29 +00:00
Gerhard c356f3d053 Sort checkout fields using PHP and not JS on initial page load as it causes issues as per #20640
Co-authored-by pierrebuet
2018-10-31 08:14:50 +02:00
Gerhard 7d060949ad Convert wc_product_attribute_uasort_comparison to use wc_uasort_comparison 2018-10-31 07:41:01 +02:00
Gerhard f844582976 Convert wc_shipping_zone_method_order_uasort_comparison to use wc_uasort_comparison 2018-10-31 07:40:08 +02:00
Gerhard 21ad281850 Add new wc_uasort_comparison function 2018-10-31 07:38:38 +02:00
Kim Helge Frimanslund fece37f814 Prevent extract from polluting hook arguments 2018-10-28 15:36:13 +01:00
dyszczo 7f5122d502 Fix for warning in wc_get_logger when woocommerce_logging_class returns valid logger instance 2018-09-26 12:56:59 +02:00
Gerhard Potgieter f0bd830502 Do not return or store user agent in lower case as HTTP header fields values are case sensitive as per rfc2616 2018-07-11 13:54:14 +02:00
Mike Jolley 38e3e3f570
Merge pull request #20425 from rnaby/070618-130531-wc-core-functions-wc_get_logger
Simplified and Early Returned | wc_get_logger refactored
2018-06-07 10:34:51 +01:00
Khan M Rashedun-Naby 76a9e19471 wc_get_logger refactored 2018-06-07 13:46:06 +06:00
Khan M Rashedun-Naby 964435a34b @access tag removed 2018-06-07 12:31:35 +06:00
Ismail El Korchi 4b2b654749
Update wc_maybe_define_constant doc 2018-05-26 03:16:44 +00:00
Mike Jolley c31cd4d962
Merge pull request #20234 from woocommerce/fix/20228
Check plugin properties exist when listening to auto_update_plugin hook
2018-05-25 12:29:17 +01:00
Mike Jolley f1bed0d97b
Merge pull request #20231 from woocommerce/fix/20227
Wrapper function to get full mysql version string with mariadb handling
2018-05-25 12:29:05 +01:00
Mike Jolley d0d87b5e39 Check plugin properties exist 2018-05-25 12:07:12 +01:00
TheDramatist 29a6a7a494 wc_add_number_precision_deep logic simplified (#20211)
* wc_add_number_precision_deep logic simplified

* Early return
2018-05-25 11:18:49 +01:00
Mike Jolley 0bfd675238 Wrapper function to get full mysql version string with mariadb handling 2018-05-25 11:15:30 +01:00
Mike Jolley 2a10ef31fa
Merge pull request #20212 from rnaby/240518-225308-wc-core-functions-wc_remove_number_precision_deep
wc_remove_number_precision_deep logic simplified
2018-05-25 10:39:48 +01:00
Mike Jolley 571919936c
Merge pull request #20210 from rnaby/240518-223657-wc-core-functions-wc_rand_hash
wc_rand_hash logic simplified
2018-05-25 10:33:41 +01:00
Mike Jolley 54357733bd
Merge pull request #20202 from jamesckemp/patch-10
Allow HTML when using `wc_attribute_label()`
2018-05-24 20:45:45 +01:00
James Kemp 596e6e2271 Add filter to sanitize woocommerce_attribute_label 2018-05-24 19:32:32 +01:00
Khan M Rashedun-Naby 5b079343e8 Early return 2018-05-24 23:02:07 +06:00
Khan M Rashedun-Naby 2725cd56d4 wc_remove_number_precision_deep logic simplified 2018-05-24 22:55:00 +06:00
Khan M Rashedun-Naby cb7b853199 wc_rand_hash logic simplified 2018-05-24 22:42:56 +06:00
Mike Jolley f5343cf4c7
Merge pull request #20067 from rnaby/150518-000347
ElseIf and Else Statement Removed
2018-05-24 16:33:56 +01:00
Khan M Rashedun-Naby 651de82769 ElseIf and Else Statement Removed 2018-05-15 00:07:29 +06:00
Khan M Rashedun-Naby f09fd925e7 Removed Else Condition Check 2018-05-15 00:01:15 +06:00
Mike Jolley e807c6151f Merge branch 'master' into update/erasure-requests 2018-05-02 14:06:47 +01:00
Mike Jolley e8f3bac6c8 Implement log cleanup cron job (woocommerce_cleanup_logs) 2018-05-01 16:37:14 +01:00
Mike Jolley c765ce644d Inactive account handling 2018-04-30 15:38:45 +01:00
Mike Jolley d381330a91
Merge pull request #19705 from woocommerce/fix/19619
Handling of PHP's automatic array key conversion to int
2018-04-18 15:40:31 +01:00
Peter Fabian 4538f3fa8f Moved wc_selected to core functions. 2018-04-18 15:54:57 +02:00
claudiulodro f9e45bea91 Bring up-to-date with master and resolve merge conflicts 2018-04-17 13:27:39 -07:00
Peter Fabian 55632d0703 Switched Georgian Lari to correct UTF symbol 2018-04-04 11:11:05 +02:00
Mike Jolley 38c29204d4 Include US in US dollar dropdown so it's searchable 2018-03-27 18:35:15 +01:00
Mike Jolley 7a568e2f68 Personal data removal experiment 2018-03-16 13:53:18 +00:00
Claudio Sanches 53cde6f317 Fixed conflicts in cart functions and fixed PHPCS violations on core funcitons 2018-03-09 12:46:20 -03:00
Claudio Sanches a9c1c2b096
Merge branch 'master' into update/core-functions-phpcs 2018-03-08 18:35:41 -03:00
Mike Jolley 0c10c28cd3
Merge pull request #18175 from woocommerce/update/17252
Rollback if payment complete or update status fails
2018-03-08 13:12:34 +00:00
Claudio Sanches 2b0a87b80f Fixed includes/wc-core-functions.php PHPCS violations 2018-03-07 18:37:32 -03:00
Chunkford c411c43fdf
Update wc-core-functions.php 2018-03-07 13:14:59 +00:00
Mike Jolley 3d4b1e6d4c Return new logger instance if class changes. 2018-03-01 16:24:53 +00:00
Mike Jolley 21d7dbc612 Merge branch 'master' into update/17252 2018-03-01 15:58:17 +00:00
Mike Jolley 48e1894258 code standards 2018-02-19 13:06:04 +00:00
Patrick Mladensich 1b290eae6d
Fix check for external resource 2018-02-16 22:51:06 +01:00
Mike Jolley 9f9e4027e9 Thumbnail mapping 2018-02-13 12:51:55 +00:00
Mike Jolley e39b6950a8 Notice when regeneration is happening 2018-02-13 12:02:24 +00:00
Mike Jolley c29da59edf Merge branch 'fix/18842-external-images-fix' into update/3.3-image-handling 2018-02-13 11:17:43 +00:00
Mike Jolley 9499b63e01 Register gallery_thumbnail size 2018-02-13 11:16:42 +00:00
Mike Jolley 7339511495 Height must be int 2018-02-09 14:12:19 +00:00
Mike Jolley 997e8aefde Typecast sizes to int and avoid 9999999999 2018-02-01 17:13:05 +00:00
Mike Jolley c9789a4743 Default should be 1:1 2018-02-01 17:13:05 +00:00
Mike Jolley 76a37fa0d2 Feedback 2018-01-25 15:14:02 +00:00
Mike Jolley e85338d8d3 Import ratio from old settings 2018-01-25 12:34:28 +00:00
Mike Jolley 371f504964 Helpers for theme support vars and error messages. 2018-01-08 18:48:57 +00:00
Mike Jolley 73d0c1062c Allow transactions to be forced on 2018-01-03 16:13:08 +00:00
claudiulodro 90dd9179ac Remove duplicate unautop 2017-12-21 10:43:02 -08:00
claudiulodro 9dc9fffc3a Process embed shortcode in short description 2017-12-21 10:19:15 -08:00
Mike Jolley 4eaf1afb88 Cleanup session callback. 2017-12-15 15:14:05 +00:00
Gerhard Potgieter 4ba9af1c2f Change WC::is_active_theme into a global function wc_is_active_theme. Clean up the conditional checks to read better. 2017-12-15 14:32:54 +02:00
claudiulodro 5aab643146 Fix parens 2017-12-13 09:56:01 -08:00
claudiulodro 2a17ad9a2b Flip arguments to prevent errors when key doesn't exist 2017-12-13 09:54:35 -08:00
Caleb Burks ea29af1ac4 Use woocommerce_thumbnail_cropping_custom_height 2017-12-11 21:08:48 -06:00
Claudio Sanches 2f6f6112c2 Merge branch 'master' into feature/webhook-crud 2017-12-07 18:21:52 -02:00
Claudiu Lodromanean 7c06e7d63d
Merge pull request #18008 from woocommerce/update/rounding-17970-17863
Rounding fixes/line item rounding
2017-12-07 08:34:15 -08:00
claudiulodro d60456cc73 Resolve conflicts and bring up to date with master 2017-12-04 13:56:59 -08:00
Mike Jolley 6b740671cc Change how precision is added
Some users have increased precision beyond the DP setting. Support this
by converting to cents and leaving some precision on the end.

e.g. 10.00 would be converted to cents (1000) and have 2 dp precision
on the end (1000.00).
2017-12-04 20:32:51 +00:00
Claudio Sanches 867f7dfc7a Fixed coding standards 2017-12-01 15:13:27 -02:00
Claudio Sanches b1fd3134c3 Introduces woocommerce_webhook_process_delivery hook 2017-12-01 14:33:30 -02:00
Claudio Sanches 270c0a200e Merge branch 'master' into feature/webhook-crud 2017-11-30 16:55:28 -02:00
Gerhard Potgieter 220abd97eb Pass all args of function to filter 2017-11-29 15:12:24 +02:00
Gerhard Potgieter be4a2553b1 Introduce woocommerce_cookie_httponly filter on the httponly param of setcookie. 2017-11-29 11:22:57 +02:00
Claudio Sanches c6f8e95b97 Merge branch 'master' into feature/webhook-crud 2017-11-28 15:09:10 -02:00
Mike Jolley c8d1a46315 Default rounding to true. 2017-11-20 16:37:44 +00:00
Mike Jolley 80ffcfb45d Add round param for `wc_add_number_precision`
Let’s us return the cent value without rounding to an integer.
2017-11-20 16:30:04 +00:00
Claudio Sanches 13978e496b
Merge branch 'master' into feature/webhook-crud 2017-11-20 10:34:35 -02:00
Gerhard Potgieter 3524ed2cf0 Merge branch 'master' of github.com:woocommerce/woocommerce into feature/webhook-delivery-logging 2017-11-15 14:28:14 +02:00
Mike Jolley 616d85f9cb Fix option names 2017-11-14 16:59:59 +00:00
Mike Jolley 79d918d33e Merge branch 'feature/unsupported-theme' into update/move-settings-to-customizer-17148
# Conflicts:
#	assets/css/admin-rtl.css
#	assets/css/admin.css
#	assets/css/woocommerce-rtl.css
#	assets/css/woocommerce.css
2017-11-14 16:02:02 +00:00
Mike Jolley bc16a85d22 Cropping settings 2017-11-14 16:01:36 +00:00
Gerhard Potgieter 016cfabb75 On the fly image regeneration. 2017-11-14 14:39:28 +02:00
Mike Jolley 220728544a
Merge pull request #17631 from woocommerce/update/page-caching-class
Page caching class
2017-11-10 14:12:13 +00:00
Gerhard Potgieter b11ab6d8d6 Convert comments to wc_logger logging, remove and deprecate unused functions and introduce a wc_get_log_file_name helper function. Still a couple of todos left regarding deprecating or removing filters related to comments. 2017-11-10 12:20:59 +02:00
Mike Jolley d765e2319c Added theme support vars for grid settings
- product_grid
   - min_rows
   - max_rows
   - min_columns
   - max_columns

If settings violate these, they will be updated.

If loop_shop_columns is defined, settings are hidden with a notice.
2017-11-09 18:11:35 +00:00
Mike Jolley 6e08ff0284
Merge pull request #17610 from woocommerce/update/17557
Theme support to declare image sizes
2017-11-09 16:04:22 +00:00
Mike Jolley 9f059e17a9 Add helper function instead of calling method, and restore old method for bw compat 2017-11-08 15:07:00 +00:00
Mike Jolley cf448398cd Update API 2017-11-07 19:08:06 +00:00
Mike Jolley e025caf177 Widths and aspect ratios 2017-11-07 18:32:43 +00:00
Mike Jolley 2fd540fdf6 Fix theme support checks 2017-11-07 12:33:58 +00:00
Mike Jolley 6701917e5a Remove need for wc_get_core_supported_themes 2017-11-07 12:17:03 +00:00
Mike Jolley fb8c6cd0d2 Add compat class for each wp default theme 2017-11-07 12:11:37 +00:00
Mike Jolley 2d2156aeca Fix setting retrievel 2017-11-07 11:46:25 +00:00
Mike Jolley dae70d9be2 Pull sizes from the theme if defined 2017-11-07 11:04:06 +00:00
MounirHamani 2c471d3662
Add new Belarusian ruble BYN 2017-11-07 03:24:01 +01:00
Mike Jolley cb61e9dd3d WC_TAX_ROUNDING_MODE auto to support switching in tests 2017-11-06 21:25:02 +00:00
Joel Rowley 390f46f7da Attempt to fix type conversion precision bug 2017-11-04 16:33:23 -04:00
Claudio Sanches 787bb7f0c0 Fixed permalink default values (#17385)
* Fixed permalink default values

`woocommerce_permalinks` may return a list with empty results like:

wp> get_option( 'woocommerce_permalinks', array() )
=> array(5) {
  ["product_base"]=>
    string(8) "/product"
  ["category_base"]=>
    string(16) ""
  ["tag_base"]=>
    string(11) ""
  ["attribute_base"]=>
    string(0) ""
  ["use_verbose_page_rules"]=>
    bool(false)
}

This override all placeholders declared with `wp_parse_args()`.

`wp_parse_args()` can apply default values only when missing, and not empty.

This PR removes all empty values in order to use the placeholders.

Fixes a bug introduced in #17352

* Moved array_filter() before wp_parse_args()
2017-10-26 13:57:40 +01:00
Mike Jolley e68f087659 When no permalinks are set, set the defaults and avoid switching locales 2017-10-24 16:29:04 +01:00
Mike Jolley 88ea1eaf7b Remove rounding in wc_remove_number_precision
Remove the rounding when removing precision so the cart can handle it.

For taxes, this means it can round down.

Fixes #17158

Tests are passing.
2017-10-12 15:16:48 +01:00
Mike Jolley d09d7d1358 wc_get_relative_url/wc_is_external_resource helpers 2017-09-08 12:20:03 +01:00
claudiulodro ccade24ce5 Only set some fields on new orders 2017-09-07 13:50:47 -07:00
Mike Jolley a8a33c8f0d Merge pull request #16717 from woocommerce/refactore/wc_maybe_define_constant
Use wc_maybe_define_constant() in all places
2017-09-07 12:16:13 +01:00
Claudio Sanches 4e9cf1c598 Restored WooCommerce->define access to private 2017-09-06 14:47:35 -03:00
Claudio Sanches f98aeb5b91 Use WC()->define() into wc_maybe_define_constant() 2017-09-05 16:51:09 -03:00
Mike Jolley 5c5a8f4e8e Helper functions 2017-09-05 11:54:04 +01:00
Anton Timmermans f73c198404
Cache currencies for performance 2017-09-01 18:30:08 +02:00
Mike Jolley d68291b3ac Merge pull request #16086 from woocommerce/improvement/versions
Extensions version check.
2017-08-21 18:18:04 +01:00
rspublishing 9ed2f7544f Updated XAF and XOF denominators 2017-08-20 21:48:18 +02:00
Claudio Sanches b93a95423f Use wc_strtolower() to format coupon code
Improves #16519
2017-08-18 14:11:33 -03:00
Mike Jolley f957546cc4 Format coupon code with mb_strtolower
Fixes #16497
2017-08-18 15:43:34 +01:00
Rami Yushuvaev 7ad61068e1 i18n: Simpler translation string with placeholders
Replace:

`The class <code>%s</code> provided by woocommerce_logging_class filter must implement <code>WC_Logger_Interface</code>.`

With:

`The class %1$s provided by %2$s filter must implement %3$s.`
2017-08-15 14:39:41 +03:00
Mike Jolley 7620473fa5 Support callback for index 2017-08-11 13:52:28 +01:00
Mike Jolley 140771e759 Merge branch 'master' into improvement/versions
# Conflicts:
#	assets/css/admin-rtl.css
#	assets/css/admin.css
#	assets/css/helper-rtl.css
#	assets/css/helper.css
#	assets/css/twenty-seventeen-rtl.css
#	assets/css/twenty-seventeen.css
#	assets/css/wc-setup-rtl.css
#	assets/css/wc-setup.css
2017-08-09 10:08:06 +01:00
Mike Jolley e9c3ebebdc Merge branch 'master' into feature/discounts-class
# Conflicts:
#	includes/abstracts/abstract-wc-data.php
#	woocommerce.php
2017-08-08 15:49:59 +01:00
Mike Jolley 862f67d98b wc_get_var helper method 2017-08-07 11:02:19 +01:00
claudiulodro c634ac6cf1 Prevent auto updates if dangerous. 2017-08-03 11:42:19 -07:00
Mike Jolley 306db69eaf Remove order subclass 2017-07-27 10:49:47 +01:00
Mike Angstadt 00e8c9a505 removed leading slashes
removed leading slashes
2017-07-11 08:45:06 -05:00
Mike Angstadt 2239ad6dcb updated based on reviewer feedback
Updated based on reviewer feedback.
2017-07-11 08:43:55 -05:00
Mike Angstadt fa4e4e40fd Explicitly set include path
If you override include_path and are including this file from outside this directory's context, performance will degrade as both those locations are incorrectly checked first getting an EOF before include() falls back to looking in this directory.

Explicitly setting the include path checks this directory first regardless of calling context location or include_path override so is ideal.
2017-07-10 21:33:42 -05:00
1do 344807bd15 changed misspelled filter name 2017-06-19 14:22:31 +03:00
Mike Jolley ccad987bac Allow state field to have the correct country set by passing it through
Fixes #15632
2017-06-16 11:45:53 +01:00
Mike Jolley 0d7614d44b Fix locale notice
Closes #15502
2017-06-07 14:31:09 +01:00
Mike Jolley d62aefba74 Merge branch 'master' into fix/15414
# Conflicts:
#	includes/wc-core-functions.php
2017-06-06 12:55:50 +01:00