Commit Graph

525 Commits

Author SHA1 Message Date
Jeffrey Pearce bf8662bf67 Adds structure for Twenty Twenty One default theme support. Issue #27766
- New class class-wc-twenty-twenty-one.php
- New stylesheet twenty-twenty-one.scss
- Updates checks for default themes in theme_support_includes() and wc_is_wp_default_theme_active()
2020-11-16 06:41:39 -06:00
vedanshujain 3dd80d6d65 Add polyfill for wp_cache_get_multiple 2020-11-10 14:23:44 +05:30
Néstor Soriano c15488d840
Merge pull request #27830 from woocommerce/php8/fix-round-function-with-non-numeric-argument 2020-10-09 08:01:44 +02:00
Nestor Soriano 52eed70f04 Add a 'NumberUtil' class with a 'round' method.
There's a number of places in the WooCommerce codebase where the
built-in function 'round' is executed passing a non-numeric value
(not a number and not a string that can be parsed as a number),
for example round(''). In PHP 7 this yields a value of 0, but in
PHP 8 this throws an error.

This commit adds a 'NumberUtil' class with a static 'round' method,
this method checks if the passed value is numeric and if so it just
executes the built-in function, otherwise it returns 0. And all the
calls to 'round' in the codebase are replaced with 'NumberUtil::round'.
2020-10-01 11:08:51 +02:00
Ron Rennick bb6ded857d phpcs fixes 2020-09-21 13:34:14 -03:00
Ron Rennick 57fa6aff83 update taxonomy template names from `_` to `-` 2020-09-21 13:30:29 -03:00
Claudio Sanches ed1a59b39b
Merge pull request #27416 from woocommerce/fix/27415
Fixed country list sorting
2020-09-17 10:35:43 -03:00
Claudio Sanches b5d8d94bc8 Use reference in wc_asort_by_locale 2020-09-10 16:02:39 -03:00
jonathansadowski 53c22ba4e4
Merge pull request #27508 from woocommerce/fix/27419
Fix filter by attribute widget now working for "Any..." attributes
2020-09-02 13:32:54 -05:00
Nestor Soriano 53351fcc2f Update wc_product_attribute_uasort_comparison to accept null entries
When set_attributes is used on WC_Product to remove existing attributes
the wc_product_attribute_uasort_comparison ends up being called
with a null argument, and this breaks tests in PHP 7.4 since
null is used as an array. This commit modifies the function so that
if null is passed no array access is attempted.
2020-08-31 16:49:29 +02:00
Claudio Sanches 5240682f38 Improve choice of words 2020-08-25 18:03:03 -03:00
Claudio Sanches 47aaac8600 Introduced wc_asort_by_locale() function 2020-08-19 20:22:18 -03:00
Claudio Sanches e547cb84e5 Reverted changes on wc_ascii_uasort_comparison 2020-08-19 20:02:14 -03:00
Claudio Sanches 74e94f86d0 Use WP remove_accents() instead of iconv 2020-08-19 18:58:45 -03:00
Nestor Soriano 29cf161415 Small changes after review feedback:
- Method and class renames.
- Removed unnecessary autoloader registration.
- Add a unit test for classes with non-object type hints
  in constructor arguments.
2020-07-24 09:24:06 +02:00
Nestor Soriano d5d02a7175 Fix code sniffer errors in wc-core-functions.php 2020-07-24 09:23:05 +02:00
Claudio Sanches 1de6bf0c28
Merge pull request #26515 from koko-ng/patch-1
Fix error message in wc_get_template
2020-07-01 13:27:05 -03:00
Claudio Sanches 4d2bafcc49
Merge pull request #26219 from woocommerce/fix/wc-load-cart
`wc_load_cart` should load it's own dependencies and include required core files
2020-07-01 13:10:04 -03:00
Ron Rennick dd5cd361bc introduce wc_set_template_cache(), wc_clear_template_cache() 2020-06-11 14:06:56 -03:00
Claudio Sanches 9d8af073cf
Update since tag to 4.3.0 2020-05-29 13:45:00 -03:00
Peter Fabian 2394da73b4 Merge branch 'master' into refactor/23783 2020-05-28 11:19:03 +02:00
Albert Juhé Lluveras 9a34c4fe75 Update WC shipping settings so no shipping zones banner appears when all are deactivated 2020-05-15 16:32:12 +02:00
Albert Juhé Lluveras 973e50ab64 Add param to wc_get_shipping_method_count() 2020-05-15 11:22:28 +02:00
Albert Juhé Lluveras de7ca06b41 Set is_enabled=1 instead of is_enabled=true 2020-05-15 11:02:12 +02:00
Albert Juhé Lluveras 33b0bef8c5 Add is_enabled=true check in wc_get_shipping_method_count() 2020-05-15 11:02:12 +02:00
koko 54db5f07c4
Fix error message in wc_get_template
If the filtered template does not exist the error should report the filtered template, not the original
2020-05-14 17:10:06 +02:00
Claudio Sanches 8e21f10b3d
Update since tags 2020-05-06 14:07:46 -03:00
Mike Jolley 88c7ad1bd2 Don't "get" cart 2020-04-20 12:47:20 +01:00
Mike Jolley 232ae16940 Load dependencies in wc_load_cart 2020-04-20 12:30:44 +01:00
Christopher Allford 2fedf9306e Corrected the filter prefix for get_path_define_tokens 2020-04-07 10:25:57 -07:00
Christopher Allford b43ad106ef Added WPMU_PLUGIN_DIR and removed the path define token for ABSPATH
There's no need for the ABSPATH define since the WC plugin is always a child of a plugin directory anyway.
2020-04-06 07:17:01 -07:00
Christopher Allford a7c0dec33a Added a function to fetch all of the path define tokens that may be present in template paths 2020-04-05 13:21:50 -07:00
Christopher Allford 33e81654a9 Made the path tokenization deterministic
Since the tokens are replaced in a first-discovered first-replaced order, we may accidentally create tokenized paths like '{{ABSPATH}}/test' instead of the desired '{{WP_CONTENT_DIR}}test'. By ordering them according to specificity however, we ensure that we tokenize as much of the path as possible.
2020-04-05 12:41:39 -07:00
Christopher Allford e270dfce2e Extracted the template path tokenization so that it can be applied to more than one define more readily 2020-04-05 12:06:04 -07:00
Christopher Allford 91c608f38e Merge branch 'master' into refactor/23783 2020-04-05 10:55:00 -07:00
vedanshujain 8f3d8f0495 Also cache with WC_ABSPATH to account for when WC is out of ABSPATH.
We already substitute ABSPATH with {{ABSPATH}} token to make sure that exact template path is not cached to support deployment with multiple servers.

This patch also add tokenizing WC_ABSPATH to account for when WooCommerce is installed outside of ABSPATH.
2020-03-30 18:05:13 +00:00
Vedanshu Jain e35aaf1cff
Merge pull request #25885 from grigorijurasov/master
Change Serbian currency symbol from дин. to рсд, solves #25441
2020-03-17 19:02:17 +05:30
Rodrigo Primo 9b6d66cf1f
Merge pull request #25609 from SamirMahmudzade/patch-3
Update KZT (₸) symbol wc-core-function.php
2020-03-06 11:36:11 -03:00
grigorijurasov 06f44f386b Update wc-core-functions.php 2020-03-05 18:41:14 +01:00
Rodrigo Primo 05cfc7eece Add @since tag to get_woocommerce_currency_symbols()
See #25733
2020-03-04 16:26:07 -03:00
Rodrigo Primo 62d3a1fa44 Fix typo 2020-03-04 16:25:33 -03:00
Rodrigo Primo c529273973
Merge pull request #25733 from TimBHowe/fix/25732
Added the get_woocommerce_currency_symbols function to allow develope…
2020-03-04 16:23:50 -03:00
TimBHowe 34bec7d839 Added the get_woocommerce_currency_symbols function to allow developers to get an array of all the currency symbol registered with woocommerce 2020-02-23 13:51:19 -05:00
SamirMahmudzade 443429bd14
Update KZT (₸) symbol wc-core-function.php
Update the Kazakhstani tenge symbol KZT (₸) symbol wc-core-function.php
2020-02-07 18:23:36 +04:00
Peter Fabian 06d0bbefc4 Don't run setup wizard redirects from AS. 2020-02-07 00:20:42 +01:00
Christopher Allford c5e1fc6c45 Merge remote-tracking branch 'origin/master' into refactor/add-jetpack-constants 2020-02-03 11:50:16 -08:00
Christopher Allford 1d1413b4ee Replaced direct access of many constants with the Constants library 2020-01-31 22:18:47 -08:00
Christopher Allford 8a046ab0cd Cleaned up the template path replacement and fixed the wc_cache_set positioning 2020-01-30 16:24:07 -08:00
Christopher Allford e86efca828 Merge branch 'master' into refactor/23783 2020-01-30 13:29:21 -08:00
Christopher Allford 6ad091a9b7 Changed all of the constant accesses into corresponding Automattic\Jetpack\Constants usages 2020-01-28 21:21:29 -08:00