Commit Graph

21224 Commits

Author SHA1 Message Date
Claudio Sanches 29ccfd961b
Revert "Use %1$s instead of %s on regen description" 2021-01-15 20:27:03 -03:00
Claudio Sanches b462b3c8ee
Merge pull request #28401 from bordoni/patch-2
Use %1$s instead of %s on regen description
2021-01-15 20:21:03 -03:00
Claudio Sanches 5ca7c51714
Merge pull request #28712 from woocommerce/add/config_merchant_email_notifications
Added merchant email note switch
2021-01-15 13:32:02 -03:00
Claudio Sanches e698ed72fd
Merge pull request #28801 from liquidweb/refactor/shipping-zone-read
Refactor the WC_Shipping_Zone_Data_Store::read() method
2021-01-15 12:58:36 -03:00
Peter Fabian 02a2bbad71
Merge pull request #28799 from woocommerce/fix/issue-27789
Add notice to deprecate old reports closes #27789
2021-01-14 19:05:44 +01:00
jonathansadowski e8552094c2
Merge pull request #28809 from woocommerce/fix/issue-27791
Prevent duplicate new order email from being sent when changing order…
2021-01-14 09:36:30 -06:00
roykho 5b4e3a2e2e
Add margin 2021-01-14 05:25:26 -08:00
vedanshujain 2e4f2ef478 Add migration function for fixing existing product review counts. 2021-01-14 18:35:14 +05:30
vedanshujain 23618b06ed Add utility function for getting review counts in bulk for convinience.
Also refactors get_review_count_for_product to use the new method so that we only would have to maintain one method.
2021-01-14 18:27:41 +05:30
Néstor Soriano b36a06ca08
Merge pull request #27844 from woocommerce/php8/use-custom-phpunit-7
[PHP 8] Use a custom version of PHPUnit 7 for PHP 8 compatibility
2021-01-14 11:46:01 +01:00
Nestor Soriano 8b0bd248d6 Attach hook for adjust_download_permissions from within init_hooks
The DownloadPermissionsAdjuster class hooks to adjust_download_permissions
from within its init method. However this method is executed only
if the class is resolved, otherwise the hooks doesn't get attached
and then the scheduled action is not serviced.

To solve this, the class is resolved from WooCommerce::init_hooks.
This requires a change in DownloadPermissionsAdjuster::init
to use wc_get_container()->get( LegacyProxy::class )->get_instance_of
instead of WC()->get_instance_of, since WC() can't be used from
WooCommerce::construct (which invokes init_hooks).
2021-01-14 11:40:11 +01:00
Nestor Soriano c9ea5922e2 Add a comment to wc_ascii_uasort_comparison explaining why setlocale is needed. 2021-01-14 11:16:42 +01:00
budzanowski f9cbc0ccac Remove filters that we don't need yet. 2021-01-14 10:24:39 +01:00
roykho 218c799811
Prevent duplicate new order email from being sent when changing order status closes #27791 2021-01-13 14:13:57 -08:00
Roy Ho 0d2f478eab
Merge pull request #28690 from kevinruscoe/fix/28652
Ensure the orders status is reverted correctly when restoring it.
2021-01-13 13:54:26 -08:00
Kevin Ruscoe a78c1ec99e wp_untrash_post_status should be static as pointed out by roykho 2021-01-13 21:22:30 +00:00
Claudio Sanches 1f321f4a79
Merge pull request #28719 from raicem/update/featured-products-endpoint
Add Auth token for search/featured extensions requests
2021-01-13 18:13:25 -03:00
raicem eb3ba820da Use "wp_safe_remote_get" for sending search requests 2021-01-13 23:53:53 +03:00
Claudio Sanches 889e83e64c
Merge pull request #28698 from woocommerce/fix/28697
Add transient and action for proxying WC plugin activation hook
2021-01-13 16:49:51 -03:00
roykho 8e7a59d959
Change location of the notice so it shows up in all reports 2021-01-13 07:00:37 -08:00
Ilyas Foo 0e5596d1fc Transient and action passes plugin filename 2021-01-13 09:52:17 +08:00
Steve Grunwell 8d3803452d Refactor the WC_Shipping_Zone_Data_Store::read() method
This commit re-works the `WC_Shipping_Zone_Data_Store::read()` method in the following ways:

1. Remove a confusing conditional (`if ( 0 !== $zone->get_id() || '0' !== $zone->get_id() ) { ... }`)
2. Return early if we're dealing with Zone 0, eliminating additional conditional steps
3. Add documentation for the "woocommerce_shipping_zone_loaded" action hook
2021-01-12 12:53:22 -05:00
roykho 6041c10ea3
Add notice to deprecate old reports closes #27789 2021-01-12 07:37:00 -08:00
Nestor Soriano 10eb9f832e Remove one of the duplicate handlers for 'adjust_download_permissions' 2021-01-12 10:15:53 +01:00
Roy Ho d8b0a8558e
Merge pull request #28586 from idofri/phpdoc
Corrected data-types in phpdoc @param
2021-01-11 06:52:11 -08:00
Menaka S 950bfcdf39 Deprecate public function and remove private functions 2021-01-11 18:38:17 +05:30
Ido F 4be88bea4b corrected token-id data-type 2021-01-10 16:40:24 +02:00
Menaka S 415e1e7bbf Use site's posts_per_page size 2021-01-10 15:21:06 +05:30
Menaka S 003f4a0acb Paginate while getting orders to calculate tracker data 2021-01-10 15:17:21 +05:30
Kevin Ruscoe 91ea67d94c Clean array to make the list a little easier to understand 2021-01-09 15:11:25 +00:00
Kevin Ruscoe 0f7de7e7bf Add 'product_variation' to the list of restored post types 2021-01-09 15:08:51 +00:00
Kevin Ruscoe dd934afc2e Add product to the list of post types that should revert their status upon being restored. 2021-01-09 14:49:29 +00:00
Roy Ho 9ebf70bf8d
Merge pull request #28646 from tivnet/patch-7
abstract_wc_order:add_product() - removed `throws`
2021-01-08 10:24:37 -08:00
Roy Ho d4849c598c
Merge pull request #28692 from woocommerce/fix/28582
Add protective check to make sure WC()->session is initialized before  loading the data store.
2021-01-08 07:55:35 -08:00
Menaka S baace44f19 Remove the functio to get orders count by payment method 2021-01-08 19:45:46 +05:30
raicem f0166fcc56 Fix indentation errors as per WordPress code style guides 2021-01-07 15:14:38 +03:00
vedanshujain f8bcf6271d Revert order and product controllers to use WP Post queries directly.
This commit revert some of the changes added in #27735 because wc_get_products and wc_get_orders is not fully compitable with API controller queries. Since we are close to release 4.9, its better to revert and fix them properly then rush a fix. This undones some the performance improvements we acheived in 27735, in favor of more stability, hopefully we will be able to restore this soon.
2021-01-07 16:47:54 +05:30
Rodrigo Primo 007f3ec8aa
Merge pull request #28706 from paulochang/patch-1
Remove post code from Guatemala
2021-01-06 17:58:23 -03:00
Ron Rennick 6d402c96c8
Merge pull request #28017 from woocommerce/fix/25643
Fix E2E variable product test
2021-01-06 14:39:19 -04:00
Lee Willis a6334370a8 Fix visibility of checkout field settings in customizer 2021-01-06 16:01:37 +00:00
budzanowski 1cf09eb063 Simplify. 2021-01-06 15:30:13 +01:00
budzanowski d5babd800a Review refactor. 2021-01-06 15:28:51 +01:00
Bartosz Budzanowski ca3cd5fd7e
Update includes/blocks/class-wc-blocks-utils.php
Co-authored-by: Darren Ethier <darren@roughsmootheng.in>
2021-01-06 15:25:15 +01:00
vedanshujain 27b22d3aaa Move the logic to set stock_status from V2 to V3. 2021-01-06 17:55:56 +05:30
budzanowski 0b4eb9aa36 Ups. 2021-01-06 11:35:27 +01:00
budzanowski 29837c42ff Refactor. 2021-01-06 11:33:28 +01:00
vedanshujain 2ae6c5b543 Also fetch dependencies for fields which are computed from other fields. 2021-01-06 15:09:50 +05:30
vedanshujain 0d43aecebd Also fetch in_stock when stock_status requested in V2.
When called from V3, controller calls V2s get_product_data method, where stock_status was did not existed and was renamed. In V3 controller, we compute it based on V2 in_stock field.
2021-01-06 14:14:59 +05:30
budzanowski 325f72afe1 Merge branch 'master' into fix/woocommerce-gutenberg-products-block-issues-3565 2021-01-06 09:01:17 +01:00
roykho fac6d3a246
Remove do_update_woocommerce query arg to prevent actions taken on it 2021-01-05 14:16:46 -08:00
Roy Ho c6f6d04c2e
Merge pull request #28558 from tyrann0us/patch-2
Invert “if” statement to reduce nesting
2021-01-05 12:02:01 -08:00
jonathansadowski 1e267980e8
Merge pull request #28723 from woocommerce/feature/issue-27208
Feature/issue 27208
2021-01-05 14:00:55 -06:00
roykho b25f01d2f3
Add unit tests 2021-01-05 08:14:39 -08:00
Nestor Soriano 1d0b6b7cd9 Fix wc_ascii_uasort_comparison for PHP 8
In PHP 8 "iconv( 'UTF-8', 'ASCII//TRANSLIT')" doesn't work as expected:
instead of returning a proper substitute for non-ASCII characters
it returns "?". Temporarily changing the locale to C.UTF-8
fixes the issue.
2021-01-05 15:54:49 +01:00
raicem 7b67977a31 Reduce "wc_addons_featured" transient cache duration
The featured extension list was static but now it's fetched from
WooCommerce.com and may change more frequently. Reducing the
cache duration to allow users to see changes much more quickly.
2021-01-05 17:45:34 +03:00
raicem c70eee2a0a Send auth token when sending search and featured extension requests 2021-01-05 17:40:58 +03:00
Ron Rennick eca159ecab phpcs fixes, on sale dates should be displayed in local time 2021-01-05 13:19:49 +01:00
Ron Rennick 0d2a5ac5e9 Fixes needed for variable product E2E test
- Jest/Puppeteer sometimes will not find an element on page load when that element is outside the initial viewport
- There were duplicate .variation_tab classes which confused Jest/Puppeteer
- Add function for opening and verifying new product page
- Update test sequence for changes in flow in markup and Jest/Puppeteer
2021-01-05 13:19:49 +01:00
Vedanshu Jain 7d4cf1b8bf
Merge pull request #28677 from woocommerce/fix/request-request-arg-api
Add protection around `func_get_arg` method for backward compatibility.
2021-01-05 17:45:31 +05:30
vedanshujain 3a7e3fda34 Use `!empty` for consistency with other usages. 2021-01-05 16:37:39 +05:30
raicem c628c15ac6 Update featured products endpoint
WooCommerce.com will provide this list of products.
2021-01-05 12:43:17 +03:00
vedanshujain 80f5d35311 Apply coding standards w.r.t PR #28677 2021-01-05 13:47:16 +05:30
roykho 7b091485a2
Create product tags if they don't exists closes #27208 2021-01-04 14:59:28 -08:00
Ron Rennick 82fb9f106d
Merge pull request #27137 from woocommerce/issue_26959
Modify the logic for deleting variations
2021-01-04 13:06:24 -04:00
Paulo Chang 41f853fbc1
Remove post code from Guatemala
Guatemala has no real working postal service. We therefore don't use postal codes. Address and department is enough.
2020-12-31 22:41:51 +01:00
Ilyas Foo 0e590d1bdb Add transient and action for proxying WC plugin activation hook 2020-12-31 14:30:29 +08:00
Fernando Marichal 543f1e1307 Fixed copy 2020-12-30 12:13:39 -03:00
vedanshujain f945f9a015 Add protective check to make sure WC()->session is initialized before loading the data store. 2020-12-30 19:20:51 +05:30
Fernando Marichal f2648d76cf Turned merchant email notifications on by default
This commit adds the code to turn email notifications on by default
2020-12-30 10:42:53 -03:00
Kevin Ruscoe 64c4805109 Ensure the orders status is reverted correctly when restoring it. 2020-12-30 13:25:40 +00:00
Fernando Marichal 5a21a4f71c Added merchant email note configuration
This commit adds a merchant email note configuration option
2020-12-29 14:31:46 -03:00
budzanowski 32c1c9c963 Print missing block info in the status page. 2020-12-28 16:27:31 +01:00
budzanowski c81df313b2 Add block information for woocommerce pages report. 2020-12-28 16:19:51 +01:00
vedanshujain 818e24d5c5 Add protection around `func_get_arg` method for backward compatibility.
We are using func_get_arg method to receive argument in a backward compatible way since we cannot modify function signature to add more params even with default params. Earlier I was hoping to use DI to create another child class with modified signature and load it depending upon where we are executing from, however since we had to revert DI, we add this workaround to unblock #27735.
2020-12-28 14:10:22 +05:30
Menaka S 88dd6473d4 Some fixes for coding standards 2020-12-23 17:05:17 +05:30
Menaka S 092c36b71b Get order total values 2020-12-23 17:05:10 +05:30
Menaka S e9804ea717 Add order counts by gateway 2020-12-23 17:05:03 +05:30
Menaka S 1a6835019a Add order counts by status 2020-12-23 17:04:54 +05:30
Menaka S 0aee0a0848 Use wc_get_orders() to add order dates for tracker 2020-12-23 17:04:32 +05:30
Menaka S 8d83b47c27 Check if post_type is shop_order 2020-12-23 17:04:14 +05:30
Menaka S 36d6ff4c52 Add a function to get order counts by payment method 2020-12-23 17:04:02 +05:30
Vedanshu Jain f46af1160f
Merge pull request #28537 from garyc40/fix/update-callback-named-parameter
[PHP 8] Fix Unknown named parameter error when running database update routines
2020-12-23 14:28:54 +05:30
Claudio Sanches ba37b7332a
Merge pull request #28650 from woocommerce/prep/master
Prep master for 5.0.0
2020-12-22 20:30:26 -03:00
Ron Rennick 33eb98c80c
Merge pull request #28612 from woocommerce/fix/26092
Price calculation: fix documented return types
2020-12-22 14:43:47 -04:00
vedanshujain 44705386a4 Prep master for 5.0.0. 2020-12-22 19:01:56 +05:30
Vedanshu Jain 800c6a61b7
Merge pull request #28620 from woocommerce/fix/28505
Stock management regression fixes
2020-12-21 22:36:53 +05:30
Gregory Karpinsky 6cb569047a
abstract_wc_order:add_product() - removed `throws`
Exception 'WC_Data_Exception' is never thrown in the function
2020-12-21 11:26:50 -05:00
Claudio Sanches 8cc953950e
Merge pull request #28624 from woocommerce/fix/27688
Also include empty string and comment types for backward compat.
2020-12-21 12:11:09 -03:00
vedanshujain b4b03f3b46 Merge branch 'master' into fix/28505 2020-12-21 15:42:04 +05:30
vedanshujain f248276a89 Use correct syntax for translators comments. 2020-12-21 15:33:10 +05:30
vedanshujain 39c200bf2d Merge branch 'master' into fix/27673 2020-12-21 15:29:55 +05:30
Omkar Bhagat 00831c707c Revert functon's @since version num back to 3.0 2020-12-21 09:48:34 +05:30
mfs-mindsize 8c0b94619c removed - is declared but not used. 2020-12-18 13:05:31 -05:00
mfs-mindsize 6496e00428 method: remove_order_item(), added: do_action( 'woocommerce_ajax_order_items_removed', , , , ); 2020-12-18 13:04:05 -05:00
Timmy Crawford dc6b44fc6f Add woo version as global track prop. 2020-12-18 09:37:10 -08:00
vedanshujain 1bc2ea8754 Also include empty string and comment types for backward compat. 2020-12-18 18:08:33 +05:30
Omkar Bhagat 34563c22bb Inline doc for the new filter
Updated @since to 4.9 and added an inline doc for the new filter
'woocommerce_delete_variations_on_product_type_change'
2020-12-18 17:04:27 +05:30
vedanshujain 934b10fb8c Use wc_get_orders for consistency intead of custom query 2020-12-18 14:40:20 +05:30
vedanshujain 089994c618 Dont fetch optional fields unless asked to improve performance 2020-12-18 14:40:20 +05:30
vedanshujain 04f948951a Fetch product attrs only when needed 2020-12-18 14:40:20 +05:30
vedanshujain 13bee82ed9 Cover missed cases 2020-12-18 14:40:20 +05:30
vedanshujain 54dd5550e5 Pass request in backward compatible way 2020-12-18 14:40:20 +05:30
vedanshujain e62169a4b5 Cache return fields for perfromance 2020-12-18 14:40:20 +05:30
vedanshujain 2e65b8cec4 Fetch expensive fields only when required for performance 2020-12-18 14:40:20 +05:30
mfs-mindsize 361d0acc46 also added filter: woocommerce_cancel_unpaid_orders_interval_minutes to wc_format_option_hold_stock_minutes() which is used while the admin settings form is saved 2020-12-17 12:55:07 -05:00
vedanshujain 892b7caa37 Stock managment fixes:
1. Use $already_reduced_stock instead of also considering $refunded_item_quantity while deleting orders. This will bring back part of #27504 again, but for now this seems to be the best solution for countering #28605. It needs discussion whether deleting a line item completely should also undo any refund related changes on it or not.

2. Also mark `stock_reduced` flag on order if any of the line item has any `_reduced_stock` flag. This will allow for stock restoring logic to work properly when order is cancelled.

3. Only adjust line item stock when order is in `processing`, `completed` or `on-hold` status state, because we need to reduce stocks on these status only. Stock adjustments in refunds or when changing statuses is already taken care of by their specific hooks.
2020-12-17 22:28:21 +05:30
mfs-mindsize cd725af6e2 also added filter: woocommerce_cancel_unpaid_orders_interval_minutes to wc install process 2020-12-17 11:44:53 -05:00
mfs-mindsize 9dc87f629a added filter: woocommerce_cancel_unpaid_orders_interval_minutes (default 5 mins) that separates interval for checking cancelsfrom option: woocommerce_hold_stock_minutes 2020-12-17 11:41:50 -05:00
Leif Singer bc3e6a8532 Price calculation: fix documented return types
Fixes #26092.
2020-12-17 15:35:07 +01:00
Claudio Sanches 6c132c1e25
Merge pull request #28543 from woocommerce/fix/27521
Fix issue where customer could checkout although mandatory field "Country" was not given
2020-12-16 17:01:10 -03:00
Claudio Sanches d523f5aad2
Merge pull request #28538 from woocommerce/fix/remove-gb-from-eu-vat
Remove GB and IM from EU VAT countries
2020-12-16 16:59:02 -03:00
vedanshujain 6fa77b3d8e Fixup for myaccount page logic, it should be > 0 ot be considered as set. 2020-12-16 19:48:09 +05:30
vedanshujain 6b550ffb23 Better error messages for when coupon are held in other transactions.
Earlier, we were just showing an "Usage limit reached message", however in some cases, specially when user is logged in, we can also ask them to go to MyAccount page and cancel order if they'd like to (to free up the coupon). This will hopefully make for a better user experience.
2020-12-16 15:19:40 +05:30
vedanshujain 507e7a27b2 Better error messages when coupons are stuck in a pending order.
We hold coupons when payment is failed if the setting "hold stock for checkout" is enabled for some minutes. This is to allow the customers to try again if they want, and to give time to complete payment for gateways where it could take some time.

Unfortunately this cause for some bad UX user retries by starting the order from scratch again, and then if they apply the coupon, usage limit gets hit because the earlier coupon is still held and is counted towards the usage. This commit improves the error message in these cases when usage is applied per customer and is hit, by stating to go to my account to complete/cancel payment (in case of logged in user) or to wait for some time in case of guest users.
2020-12-15 16:01:14 +05:30
Ido F 703d474e52 corrected data-types in phpdoc @param 2020-12-14 13:31:52 +02:00
Vedanshu Jain 4339aee35f
Merge pull request #27352 from juliquiron/fix/slow-wc-customer-get-operations
Added cache and filter for wc-customer get operations.
2020-12-14 09:43:04 +05:30
Philipp Bammes 19d978ce1c
Invert “if” statement to reduce nesting 2020-12-11 08:23:22 +01:00
Nestor Soriano f0b834d1ec Move the download permissions adjustment process to a scheduled action.
Also, move all the new code from the 'WC_Product_Data_Store_CPT' class
to a new separate 'DownloadPermissionsAdjuster' class.
2020-12-10 15:40:38 +01:00
Rodrigo Primo 93dae948b2 Add placeholder text to country select field in the checkout page
This commit adds the 'Select a country / region...' text as a placeholder text displayed in the country select field indicating to the user that they need to select a country. This is only needed when the option ¨Default customer location" is set to "No location by default".
2020-12-10 11:12:39 -03:00
Rodrigo Primo 5554f9c6f9 Revert "Sets Select a country option element value attribute to default."
This reverts commit 9faee1d909 as it causes issues during checkout (see #27521).
2020-12-10 10:09:02 -03:00
Peter Fabian 60e8082398 Isle of Man will probably also stop being part of EU VAT area. 2020-12-10 09:59:26 +01:00
Peter Fabian 135294dfdd Removed GB from EU VAT zone. 2020-12-10 09:46:24 +01:00
Gary Cao e6a7f0f40a
Fix Unknown named parameter error on PHP 8 2020-12-10 15:21:34 +09:00
Néstor Soriano 15315d2468
Merge pull request #28499 from woocommerce/fix/26494
Remove deprecated PayPal Standard "Page style" setting
2020-12-09 12:32:37 +01:00
Nestor Soriano 8944792a69 Create additional download permissions on product save if needed
When a simple product with downloads gets converted into a variable
product all the existing download permissions for past orders become
invalid. This commit adds an extra verification procedure to the
product save code:

- Get all the existing download permissions for the product and all
  the children (variations)
- For each download permission for the parent product, if there's a
  variation that offers the same file for download (same file URL)
  AND an equivalent download permission doesn't exist (equivalent means
  same file URL, same order id and same user id), then create it.

Additionally, a new WC_Customer_Download_Data_Store::create_from_data
method is added.
2020-12-09 09:29:31 +01:00
Roy Ho 7f4ad80cbd
Merge pull request #28204 from jlavoie13/add/pass-email-object-to-template-parts
Pass email object to header and footer templates
2020-12-08 15:02:37 -08:00
Roy Ho 593cd0ea5d
Merge pull request #27675 from woocommerce/fix/update-premium-support-link-href
Update href of premium support link
2020-12-08 13:46:44 -08:00
Roy Ho 018dbc251d
Merge pull request #28386 from abhishek-pokhriyal/remove/bc-check-determine-locale
Remove function_exists check for determine_locale
2020-12-08 13:15:22 -08:00
jlavoie13 27f9f1304c phpcs fixes 2020-12-08 14:32:28 -05:00
jlavoie13 8821bf41c5 pass email object to header and footer templates 2020-12-08 14:32:28 -05:00
Claudio Sanches 1c65696535
Merge pull request #27850 from matt-h/webhook-schedule-when-processing
Make next webhook not return a date when the webhook is already running.
2020-12-07 19:20:02 -03:00
Claudio Sanches 09d98a6fe0
Merge pull request #28468 from woocommerce/fix/28417
Use single quotes inside MySQL query to avoid issues with ANSI_QUOTES
2020-12-07 19:08:38 -03:00
Roy Ho aa89afcf95
Merge pull request #28332 from woocommerce/update/replace-jquery-click
Replace usages of depracted jQuery.fn.click() event shorthand
2020-12-07 06:03:56 -08:00
Rodrigo Primo 23af5478ec Fix JS coding standards 2020-12-05 11:11:56 -03:00
roykho 4a2943d452
Defer nonce creation until displayed by WC Admin closes #27424 2020-12-04 13:17:24 -08:00
Roy Ho 231ab353dd
Merge pull request #28469 from tyrann0us/patch-1
Simplify `reload_checkout` expression
2020-12-04 12:41:18 -08:00
Rodrigo Primo f854daea67 Remove deprecated PayPal Standard parameter
This commit removes the setting "Page style" from WooCommerce -> Settings -> Payments -> PayPal Standard. This setting was used to define the value of the parameter "page_style" passed to the PayPal Standard API, but PayPal deprecated this parameter and ignores it. According to PayPal in https://developer.paypal.com/docs/paypal-payments-standard/integration-guide/Appx-websitestandard-htmlvariables/?mark=page_style#deprecated-variables: "Deprecated variables are ignored when you pass them to PayPal". In the same link, you can see that "page_style" is included in the list of deprecated parameters.
2020-12-04 14:39:03 -03:00
Christopher Allford 57e0de341e
Merge branch 'master' into fix/27711 2020-12-03 12:11:29 -08:00
Christopher Allford 6780e3e07d Added appropriate postcode formatting for Puerto Rico 2020-12-03 11:57:30 -08:00
Rodrigo Primo 39b0d83b4d
Merge pull request #28358 from szepeviktor/patch-1
Fix types in WC_Payment_Gateway
2020-12-03 15:51:50 -03:00
Rodrigo Primo 076d0b7373
Merge pull request #28415 from zzap/patch-3
Make City and Postcode mandatory fields for Serbia
2020-12-02 11:42:24 -03:00
Néstor Soriano af3077bca9
Merge pull request #28467 from woocommerce/fix/28428
Update `lostpassword_post` action and add missing parameter
2020-12-02 15:31:21 +01:00
Néstor Soriano 43f735d0f8
Merge pull request #27558 from PlexusLLC/add_before_set_stock_action 2020-12-02 15:21:05 +01:00
Philipp Bammes c84f4600e3
Simplify `reload_checkout` expression 2020-12-02 15:01:07 +01:00
Rodrigo Primo de6d55eef9 Use single quotes inside MySQL query to avoid issues with ANSI_QUOTES
This commit replaces double quotes with single quotes inside a MySQL query to avoid a syntax error when the SQL mode ANSI_QUOTES is enabled in MySQL. When this mode is enabled, MySQL treats double quotes as identifiers (like the backtick character) instead of as string delimiters. Before this change, sites running with this mode enabled wouldn't be able to add products to orders created manually in the admin as the modified query would fail (other places that also use product search including variations would fail as well). The commit that introduced this issue shipped in WC 4.5.0 (see https://github.com/woocommerce/woocommerce/pull/27171).
2020-12-02 10:37:46 -03:00
Rodrigo Primo ba538147c1 Update `lostpassword_post` action and add missing parameter
`lostpassword_post` is a WP action that is duplicated in WooCommerce to replicate the functionality to retrieve user password in the 'My Account' pages. WP recently added the variable `$user_data` as a second parameter to this action (a6cecef42f). This commit simply copies this change to the version of the action that we maintain. Similar to what was done in 1a99235dc8 when a first parameter as added to the action in WP and we had to do the same in WC core.
2020-12-02 09:52:58 -03:00
pjv b4fdf17215
Update includes/data-stores/class-wc-product-data-store-cpt.php
Co-authored-by: Néstor Soriano <konamiman@konamiman.com>
2020-12-02 06:49:56 -06:00
Christopher Allford d59b47903f Fixed Puerto Rico address localization
* Renamed "City" to "Municipality"
* Made "State" not required and hidden
* Added ZIP code validation
2020-12-01 16:24:58 -08:00
Roy Ho acd78d43f6
Merge pull request #27451 from haydenw/fix-27339
Fix #27339
2020-12-01 13:28:54 -08:00
Roy Ho f698fbdeee
Merge pull request #28403 from bordoni/issue/28291
Prevent non-numeric values from throwing a Warning on PHP 7.4+
2020-12-01 10:43:13 -08:00
Gustavo Bordoni d6d68ed9cd
Remove white space. 2020-12-01 13:16:53 -05:00
Roy Ho 78e8fb00d2
Merge pull request #28440 from mathiasdb/patch-1
Update wc-formatting-functions.php
2020-11-30 07:37:44 -08:00
Roy Ho 89efae43a1
Merge pull request #28416 from woocommerce/fix/issue-27154
Fix/issue 27154
2020-11-30 06:14:15 -08:00
Roy Ho d795ecb6b9
Merge pull request #28351 from OlegApanovich/fix/27923
Fix toggle chevron issue in admin edit product data attribute section
2020-11-27 05:42:34 -08:00
OlegApanovich 26dae12279 Fix toggle chevron issue in admin edit product data attribute section #27923
After chevron clicking on attribute section complete edit product data section toggled insted cliackig area.
Key point issue is missing 'postbox' class of wordpress postbox.js library for a attribute block that we try to toggle.
2020-11-27 11:50:44 +02:00
Milana Cap 5fae30bea0
Make City and Postcode mandatory fields for Serbia
As these fields were mandatory for Serbia from the beginning, making them optional by default is causing shop owners additional effort to set them back to mandatory. This PR is making them mandatory by default.

Fixes #28366
2020-11-25 22:36:44 +01:00
roykho 3981377809
Strip the tags from product description on all other select2 fields that performs searches 2020-11-25 13:32:50 -08:00
roykho 9f12b34237
Fix unwanted html tags showing when searching products in select2 closes #27154 2020-11-25 13:15:56 -08:00
Gustavo Bordoni 2909be0777
Prevent non-numeric values from throwing a Warning on PHP 7.4+
Resolves #28291
2020-11-25 00:10:04 -05:00
Gustavo Bordoni 05c7f336bc
Use %1$s instead of %s on regen description
Resolve #28297
2020-11-24 23:56:36 -05:00
Christopher Allford 686872a237
Merge pull request #28134 from woocommerce/add/2021-compat
Add support for Twenty Twenty-One theme
2020-11-24 16:26:34 -08:00
Claudio Sanches 918750fffb Validate variation ID while adding products to the cart 2020-11-24 19:32:58 -03:00
abhishek-pokhriyal 9abbd42d69 Remove function_exists check for determine_locale 2020-11-24 15:37:13 +05:30
Claudio Sanches 1547372f62
Merge pull request #28377 from woocommerce/fix/28254
Map all possible taxonomy templates
2020-11-23 21:40:48 -03:00
Claudio Sanches 76c0a2ce8e
Merge pull request #28378 from woocommerce/fix/28256
Display *-product_<cat|tag>.php template overrides in Status page
2020-11-23 21:19:01 -03:00
Claudio Sanches cba0cc4799
Revert "Load product category content with content-product-cat.php" 2020-11-23 20:52:27 -03:00
Claudio Sanches e8b2a9adab Display *-product_<cat|tag> template overrides in Status page 2020-11-23 20:12:38 -03:00
Claudio Sanches 4418e79d0a Map all possible taxonomy templates 2020-11-23 19:29:30 -03:00
Roy Ho 36108a2c83
Merge pull request #28322 from aheckler/patch-1
Return default date and time formats if options are empty
2020-11-23 13:52:00 -08:00
Viktor Szépe ac3acc3df0
Fix CS 2020-11-20 18:53:39 +01:00
Viktor Szépe 996fb293a8
Fix types in WC_Payment_Gateway 2020-11-20 18:37:45 +01:00
Mathias De Beyser 5f14472e5a
Update wc-formatting-functions.php
Issue
When changing the "low stock amount" on product level, a.k.a. setting a "low stock amount" for a specific product. The message on the single product page does not change from "%s in stock" to "Only %s left in stock". It only checks the global setting "low stock quantity" defined in WooCommerce > Products > Stock.
2020-11-19 21:29:57 +01:00
Rodrigo Primo 1fca8bb1b1 Replaces a few more instances of jQuery.fn.click() event shorthand
This commit replaces a few more instances of jQuery.fn.click() event shorthand that were missed in the previous commit. For more information see the commit message for 8ebead165e.
2020-11-18 16:31:17 -03:00
Rodrigo Primo ee31c791af Fix PHPCS violations 2020-11-18 15:33:36 -03:00
Rodrigo Primo 8ebead165e Replace usages of depracted jQuery.fn.click() event shorthand
This commit replaces all instances in WooCommerce codebase (except included third-party libraries) where jQuery.fn.click( handler ) event shorthand was used. This shorthand was deprecated in jQuery 3.3 (see https://github.com/jquery/jquery/issues/3214). The jQuery documentation was not updated yet (see https://github.com/jquery/jquery-migrate/issues/288 and https://github.com/jquery/api.jquery.com/issues/972).

jQuery.click() was not deprecated and so it was not replaced.
2020-11-18 15:27:46 -03:00
Rodrigo Primo 246710fce8 Merge branch 'master' into fix/28232 2020-11-17 14:47:33 -03:00
Adam Heckler b0580f0eb4
More code standards fixes 2020-11-17 12:31:17 -05:00
Adam Heckler c3487785d5
Code standards fixes 2020-11-17 10:54:53 -05:00
Adam Heckler 97eea98a23
Return default date/time formats if blank
Fixes #28319
2020-11-17 10:21:20 -05:00
Rodrigo Primo 0e319f3293
Merge pull request #28151 from woocommerce/add/requires-php-support
Add requires_php support
2020-11-17 10:39:12 -03:00
Christopher Allford 52354c95cd
Merge pull request #28277 from woocommerce/add/prepare-4.9
Prepared branch for 4.9
2020-11-16 08:42:29 -08:00
Jonathan Sadowski 67b3d1c5fb Fix stretched product admin images 2020-11-14 10:27:42 -05:00
Vedanshu Jain ae163eb28b
Merge pull request #27734 from woocommerce/enhancement/optimize-wc-order
Optimize function `wc_get_orders` by priming caches beforehand
2020-11-14 12:37:44 +05:30
Claudio Sanches f8f1417d72 Fixed function name 2020-11-13 17:57:29 -03:00
Claudio Sanches b506627528 Keep WC_Checkout::process_checkout() backwards compatible 2020-11-13 17:49:27 -03:00
Renatho De Carli Rosa c2b066edcb Fix requires_php check 2020-11-13 16:47:26 -03:00
Renatho De Carli Rosa 5cbcdcd92c Add requires_php support
With this check, we're able to avoid updates when the PHP version
is not supported
2020-11-13 16:47:26 -03:00
Christopher Allford bb38673dad Prepared branch for 4.9 2020-11-13 09:38:22 -08:00
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
Vedanshu Jain 13f429e80d
Merge pull request #28102 from woocommerce/fix/28100
Exclude user table columns as well while setting metadata props
2020-11-13 13:50:02 +05:30
Christopher Allford 03f65478f2
Merge pull request #28249 from woocommerce/add/composer-2
Update Composer to v2 (includes woocommerce-blocks 3.8.0 and woocommerce-admin 1.7.0)
2020-11-12 21:16:51 -08:00
Christopher Allford 2516414eb6
Merge pull request #28229 from woocommerce/add/wc-pay-extensions-screen
Add WooCommerce Payments banner to extensions screen
2020-11-12 14:21:01 -08:00
Christopher Allford 30d2e278b9 Replaced the deprecated `WC_Admin_Note` class 2020-11-12 13:26:30 -08:00
vedanshujain f1742e2298 Exclude user table columns as well
This is to prevent overwriting of original column data by a meta data if meta_key name is same as a column.
2020-11-13 01:02:15 +05:30
vedanshujain 00b7b40c37 Add method to get rates based on order.
This method will prioritize getting rates from billing/shipping address instead of `WC()->customer` which in irrevelant in context of editing order from admin screen.
2020-11-12 22:58:05 +05:30
vedanshujain 24a69fd249 Add return param comment 2020-11-12 22:58:05 +05:30
vedanshujain 74de152535 Use tax location from order while computing tax in discount.
We were not passing tax location while computing discount in orders, hence it was defaulting to shop's base address resulting in incorrect tax calculation.

This commit refactors `get_rates` method into another method that allows getting rates from location directly.
2020-11-12 22:57:56 +05:30
Rodrigo Primo 7659b984dc
Merge pull request #28058 from woocommerce/fix/27937
Replaces some jQuery deprecated code
2020-11-12 14:00:39 -03:00
roykho 5597f74e81
Merge branch 'master' into fix/issue-27972 2020-11-12 06:21:52 -08:00
vedanshujain fdceac9866 Delete refund cache for parent order when its deleted. 2020-11-12 10:01:15 +05:30
Claudio Sanches 6e2086e3eb Check if $product exists before using
And removed some PHP variables.
2020-11-11 19:55:59 -03:00
Claudio Sanches cb727736c0 Fixed placeholders and translators style 2020-11-11 19:47:03 -03:00
Claudio Sanches d77fc005d2
Merge pull request #28233 from woocommerce/fix/template-names
Load product category content with content-product-cat.php
2020-11-11 19:31:08 -03:00
Claudio Sanches 404bdbff48
Merge pull request #28242 from woocommerce/update/replace-usage-of-depracted-function
Replace call to deprecated woocommerce_reset_loop()
2020-11-11 19:30:02 -03:00
roykho 134786ada8 Fix stock reducing incorrect amount when order item is deleted after a refund closes #27504 2020-11-11 15:28:06 -06:00
Rodrigo Primo 2399668a05 Simplify code per reviewer suggestion
See https://github.com/woocommerce/woocommerce/pull/28058#pullrequestreview-519096925
2020-11-11 16:09:33 -03:00
Roy Ho e0204e04e4
Merge pull request #28241 from woocommerce/fix/27566
Add shipping, tax and fee lines to refund response for better information in refund REST API.
2020-11-11 08:11:56 -08:00
Rodrigo Primo 5d1435836d Replace call to deprecated woocommerce_reset_loop()
This commit simply replaces the single call in WooCommerce core codebase to the deprecated woocommerce_reset_loop() function with its replacement wc_reset_loop().
2020-11-11 10:26:56 -03:00
vedanshujain 62ae94d93e Add shipping, tax and fee lines to refund response for better information. 2020-11-11 18:47:48 +05:30
Claudio Sanches f1f2c3cfff Load product category content with content-product-cat.php 2020-11-10 20:54:59 -03:00
Gerhard Potgieter 6832dc96a4 Make wc shipping button also purple 2020-11-10 19:43:11 +02:00
Gerhard Potgieter 3c1352d36c Remember to break 2020-11-10 19:36:34 +02:00
Gerhard Potgieter caf2ea99fa Shorten title as per feedback 2020-11-10 19:26:44 +02:00
Gerhard Potgieter a0812d5009 Remove redirect as it does not work with the background installer 2020-11-10 18:28:47 +02:00
Gerhard Potgieter b5fb7c0104 Add purple woo button 2020-11-10 18:26:59 +02:00
Tom Hopcraft 296d912151
[typo] - fix 2020-11-10 15:46:20 +00:00
Gerhard Potgieter b5a4a1597f Fix current section check, phpcs linting errors. 2020-11-10 16:48:11 +02:00
Roy Ho 4954c17e89
Merge pull request #28177 from davefx/patch-11
Optimizing memory usage
2020-11-10 06:13:03 -08:00
vedanshujain 6ed8ffe850 Addressed PR review comments #27734 2020-11-10 14:23:45 +05:30
vedanshujain 3dd80d6d65 Add polyfill for wp_cache_get_multiple 2020-11-10 14:23:44 +05:30
vedanshujain 0b29232fe3 Prime caches only when needed. 2020-11-10 14:23:44 +05:30
vedanshujain eeb8851717 Minor fixups for PR #27734 2020-11-10 14:23:44 +05:30
vedanshujain 4599884dd0 Fix failing tests. 2020-11-10 14:23:43 +05:30
vedanshujain bb1e2f44ae Removed/reverted more unnecessary changes. 2020-11-10 14:23:43 +05:30
vedanshujain 12f69c2d2d Only set cache when neccessary.
This creates a tradeoff in optimizing repeated queries vs on off queries.

Another tradeoff is making more cache get calls as opposed to more SQL calls.
2020-11-10 14:23:43 +05:30
vedanshujain a5fb3178f0 Drop CacheHydration class and do it directly.
Primary reason for dropping the cache hydration is that seems like we can acheive the same results without it, so no need to add this additional complexity to our code.
2020-11-10 14:23:43 +05:30
vedanshujain 975783b2b4 Also support methods in case direct accessing key is deprecated.
For example, in case of refunds, directly accessing parent_id is deprecated, we should use get_parent_id instead.
2020-11-10 14:23:42 +05:30
vedanshujain 8ab9fd26ef Set key before trying to add values 2020-11-10 14:23:42 +05:30
vedanshujain d502407145 Use CacheHydration to speed up fetching Order data.
This also primes various caches by fetching data well in advance, this would have been individual SQL queries otherwise.
2020-11-10 14:23:42 +05:30
vedanshujain 44a226941d Refactor `read_meta` into filter_raw_data for better re-usability. 2020-11-10 14:23:41 +05:30
vedanshujain 4f514e79ad Add support to prime refund cache in wc_order class.
Fetching refunds call is an expensive query, so priming the cache where possible could be beneficial for better performance.
2020-11-10 14:23:41 +05:30
vedanshujain 9bd92205b0 Add support to use `cache_hydration` in wc_get_order.
This can be used to pre-load expensive to compute caches.
2020-11-10 14:23:40 +05:30
vedanshujain e9d97d97e7 Support for order_item to be init from obj with `order_item_id` prop.
Also set metadata cache if metadata prop is present in initial item.
2020-11-10 14:23:40 +05:30
vedanshujain 22212c7065 Add support for fetching order using a hydration object.
It will ultimately be on the datastore to effectively use the hydration object.
2020-11-10 14:23:40 +05:30
vedanshujain 4efc22f7d5 Refactor method to get individual class names for order and order-items.
This is done so that methods that fetch class names can be re-used.
2020-11-10 14:23:39 +05:30
vedanshujain f5d0275786 Refactor methods to break down into smaller units for re-usability.
This commit breaks down `read_meta_data` so that individual methods for cache key and setting raw meta data can be reused.

Also adds set_meta_data_from_raw_data to initialize metadata from manual cache.
2020-11-10 14:23:39 +05:30
Gerhard Potgieter 692dfa7fec Update banner copy 2020-11-09 15:21:38 +02:00
Gerhard Potgieter 8af8554770 Add functionality to handle woocommerce payments install 2020-11-09 14:48:49 +02:00
Gerhard Potgieter 7d33488d6b WooCommerce Services to WooCommerce Shipping 2020-11-09 14:22:20 +02:00
Gerhard Potgieter 78336781d1 Remember output_ in function name 2020-11-09 14:20:24 +02:00
Gerhard Potgieter b1d9363918 Add wc payments to extensions addons page. 2020-11-09 14:19:11 +02:00
Christopher Allford e711a447fe Fixed order account creation 2020-11-04 16:56:32 -03:00
Néstor Soriano 6e5cc0c2f2
Merge pull request #28052 from woocommerce/php8_tighten_non-strict_date_comparison
PHP 8.0 - Use strict comparison to compare post dates
2020-11-04 15:23:16 +01:00
Matt Harrison ebb8ced803
Make next webhook not return a date when the webhook is already running.
A potential fix for #26851

This does change the get_next functionality slightly but if the hook is
already running then the next state should trigger a new one anyway.
2020-11-04 09:10:28 -05:00
Néstor Soriano 09e066fc6e
Update includes/data-stores/class-wc-data-store-wp.php
Update `@since` in new function to 4.8.0
2020-11-04 13:09:52 +01:00
Nestor Soriano d620f1d232 Fix #25900 - image size customisation controls not shown
- Added the `ThemeSupport class`, with methods to add and get
  theme support options.
  - It also has a new `add_default_options` method that adds the
    options under a `_defaults` key.
- The `WC_Twenty_*` classes now use `ThemeSupport` instead of
  the `add_theme_support` function to define image and thumbnail sizes.
  - The values are defined as default options.
- The `WC_Shop_Customizer` class now uses `ThemeSupport` instead of
  `wc_get_theme_support` to check if image and thumbnail sizes UI
  should be rendered.
  - The check is made excluding default values.

With these changes the UI to change the image and thumbnail sizes
is hidden only if the options are added as non-defaults elsewhere.

Additional changes:

- The code of the `wc_get_theme_support` function is replaced with
  a simple call to `get_option` in `ThemeSupport`.
- Added the utility class `ArrayUtil`.
2020-11-04 13:01:53 +01:00
Nestor Soriano cd443581cf Fix code sniffer errors 2020-11-04 12:39:45 +01:00
David Marín c3ba17ae71
Fixing spaces in empty lines 2020-11-03 13:53:19 +01:00
David Marín 9c1de7ca96
Optimizing memory usage
Removing the potential undesired retrieval of hundreds or thousands of unreadable WC_Product objects into memory just to filter them out immediately.
This change prevented some out-of-memory situations in our site.
2020-11-03 11:34:34 +01:00
James Allan 82b68b4914 Use strict comparison to compare post dates
With PHP 8.0, non-strict comparisons between integers and strings containing
non-numeric characters are being tightened. This affects comparisons like:

0 < '0000-00-00 00:00:00'

PHP 8.0 that equates to true whereas prior to 8.0 it would be false.

More details of this change can be found at: https://wiki.php.net/rfc/string_to_number_comparison
2020-11-02 11:10:30 +10:00
jozeflambrecht 6c86950075
Update class-wc-validation.php
Add support for validation BE postcodes

https://github.com/woocommerce/woocommerce/issues/28144
2020-10-29 19:11:36 -04:00
Rodrigo Primo e38d0dfdb1
Merge pull request #28005 from woocommerce/fix/issue-27945
Replace jQuery.ready function with recommended way since jQuery 3.0 c…
2020-10-29 18:06:02 -03:00
Rodrigo Primo b612c4f041
Merge pull request #28064 from woocommerce/fix/27087
Improves i18n of string displayed during checkout
2020-10-29 17:55:02 -03:00
Néstor Soriano 604958c4a8
Merge pull request #28103 from woocommerce/fix/issue-27756
Fix/issue 27756
2020-10-28 10:06:55 +01:00
Roy Ho 5007d17596
Merge pull request #27514 from helgatheviking/has_options
Add woocommerce_product_has_options filter to has_options() method
2020-10-27 09:48:26 -07:00
roykho 4abdf2d78b
Remove underline tag and allow themes to style to their liking 2020-10-27 09:10:13 -07:00
Roy Ho 99fcafee8f
Merge pull request #28027 from woocommerce/pp_response_check_for_cart
Check the cart exists before emptying it after handling PayPal response
2020-10-27 08:54:56 -07:00
roykho 4c079ea99e
Update SSR version to check against major versions only closes #27972 2020-10-27 08:16:35 -07:00
roykho 3b022be68b
Prevent variable product from adding to cart when no variations are selected closes #27756 2020-10-26 11:21:28 -07:00
Shiki 94ecfcab34 Orders API: Add parent_name to schema 2020-10-26 13:28:04 -03:00
Shiki 48d595ed71 Orders API: Reorganize and place parent_name in a separate section 2020-10-26 13:28:04 -03:00
Shiki 52739ba9ee Orders API: Add parent_name to line_items for variable products 2020-10-26 13:28:04 -03:00
Claudio Sanches 19e4c7ac7c
Merge pull request #28094 from woocommerce/revert/27289
Revert changes introduced in #27289
2020-10-26 12:39:11 -03:00
Roy Ho c96a642e8a
Merge pull request #28067 from woocommerce/fix/27529
Fix: use the correct parameter when calling get_avatar()
2020-10-26 07:46:51 -07:00
Claudio Sanches c5ff759d61 Revert changes introduced in #27289 2020-10-26 10:26:29 -03:00
Rodrigo Primo 80c3f343a4
Merge pull request #28062 from PlexusLLC/fix-sorting-capability
Fix incorrect capability for product sorting link
2020-10-24 15:10:00 -03:00
Rodrigo Primo 1b40e13f99
Merge pull request #27856 from sudoshreyansh/fix/27831
Fixed update term message. Issue: #27831
2020-10-24 14:57:06 -03:00
Rodrigo Primo 92153ac3b3
Merge pull request #27723 from alexstewartja/master
Introduced fine-grained cultural adaptation for Jamaican-based WooCommerce stores
2020-10-24 14:44:07 -03:00
Rodrigo Primo 3ed300a4aa
Merge pull request #27607 from wpdesk/bugfix/cart-weight-float
Fixed cart weight return type.
2020-10-24 14:12:03 -03:00
Claudio Sanches 1427a39be1
Merge pull request #28074 from shahlin/master
Minor docblock grammar/typo/casing fixes
2020-10-23 17:33:41 -03:00
Roy Ho ecd08277f9
Merge pull request #28070 from NicholasMacedo/patch-1
Update class-wc-product-variable.php
2020-10-23 13:12:04 -07:00
pjv 49c85e9c5e Merge branch 'master' into add_before_set_stock_action 2020-10-23 13:59:02 -05:00
Peter Fabian 068cd6cd4a Delay the registration of data exporters and erasers.
This is because i18n is not initialized yet and incorrect translations could be loaded.
2020-10-23 19:02:10 +02:00
Shahlin Ibrahim e06466b2b7 Minor docblock grammar/typo/casing fixes 2020-10-23 17:27:39 +04:00
Nicholas Macedo 815fd01a98
Update class-wc-product-variable.php
Fix the typo on line 416 according to Issue  #28066
2020-10-22 20:37:36 -04:00
Rodrigo Primo 09faf8ba84 Fix: use the correct parameter when calling get_avatar()
`WC_Admin_Dashboard::recent_reviews()` was calling `get_avatar()` passing `$comment->comment_author` which is not one of the list of parameters that the function accepts to get the avatar. As a result, the widget that displays the recent reviews in the admin dashboard was never displaying the avatar of the user that left the review. This commit fixes this issue by passing `$comment->comment_email` instead. I opted to use `$comment->comment_author` as it should be available for reviews left both by authenticated and anonymous users and because getting the comment object wouldn't be so simple (either we need to perform an extra query for each review or deprecate the `woocommerce_report_recent_reviews_query_from` filter).
2020-10-22 17:43:59 -03:00
Rodrigo Primo e91872c1a8 PHPCS fixes 2020-10-22 17:34:47 -03:00
Rodrigo Primo 6bde9fd8a5 Replace WPCS deprecated syntax
Using the WPCS native whitelist comments is deprecated. So this PR just replaces all instances of `// WPCS: XSS ok.` found in `includes/wc-cart-functions.php` with the PHPCS native "// phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped". I found this while working on another issue in the same file.
2020-10-22 16:03:34 -03:00
Rodrigo Primo 4e5fb5724c Improves i18n of string displayed during checkout
This commit improves the i18n of a string displayed during checkout showing the total amount of the order when the store is configured to display prices inclusive of taxes.

Before string concatenation was used to build the final string which is almost always a bad practice from i18n point of view (https://codex.wordpress.org/I18n_for_WordPress_Developers#Best_Practices). This commit uses sprintf() and two separate strings to make translation easier.
2020-10-22 15:38:07 -03:00
pjv f03bfb85da Fix incorrect capability for product sorting link
Fixes #28049
2020-10-22 13:03:35 -05:00
Rodrigo Primo 05cc0882e5 Replace deprecated jQuery code in includes/emails/class-wc-email.php
This commit replaces a call to the now deprecated jQuery.fn.toggle(handler, handler...) (https://api.jquery.com/toggle-event/) with a jQuery.click(). The deprecated call was used in the page where admins can edit e-mail templates (example: wp-admin/admin.php?page=wc-settings&tab=email&section=wc_email_customer_on_hold_order) to show or hide the contents of the template and at the same time change the label of the button. We are now using jQuery.click() with a if statement inside to decide which label to use.
2020-10-22 09:28:06 -03:00
James Allan b1a2fa01a6 Check the cart exists before emptying it after PayPal response 2020-10-21 10:32:37 +10:00
Claudio Sanches f7ecbbeb35 Prepare default branch to 4.8 2020-10-20 15:20:52 -03:00
Claudio Sanches 631c06020c
Merge pull request #27800 from gbiorczyk/fix/field-label-escaping
Escaping output for field label
2020-10-19 20:26:38 -03:00
roykho 8c73c5f2f8
Replace jQuery.ready function with recommended way since jQuery 3.0 closes #27945 2020-10-19 06:47:55 -07:00
LuigiPulcini 64b0671008 Update class-wc-ajax.php 2020-10-19 11:11:30 +02:00
LuigiPulcini 494882c0f9 Merge branch 'master' of https://github.com/LuigiPulcini/woocommerce 2020-10-18 16:29:30 +02:00
LuigiPulcini 752d33ff67 Update class-wc-ajax.php 2020-10-18 16:26:52 +02:00
LuigiPulcini b43c75a68f
Merge branch 'master' into master 2020-10-18 16:23:29 +02:00
LuigiPulcini 020a061895 Update class-wc-ajax.php 2020-10-18 16:17:42 +02:00
LuigiPulcini 1dc4c8b8bf Update class-wc-ajax.php 2020-10-18 13:25:02 +02:00
Rodrigo Primo 0a81188e42
Merge pull request #27987 from woocommerce/php8/fix-required-parameters-after-optional-take-2
[PHP 8] Convert optional-before-required parameters into required parameters (take 2)
2020-10-17 09:42:20 -03:00
roykho e8bcd464db
Update escape based on suggestion 2020-10-16 06:00:34 -07:00
Nestor Soriano 63ced34e2d Convert optional-before-required arguments to required (take 2)
In PHP 8 required parameters after optional parameters in
function/method signatures trigger a deprecation notice. These type
of parameters are pointless since a value needs to always be
provided for them anyway, so they are actually de-facto required.

This commit converts all these not-so-optional parameters into
truly required parameters by removing their default values.
2020-10-16 13:08:31 +02:00
roykho 800cbdbc7e
Add missing escapes 2020-10-15 16:31:56 -07:00
roykho ace411aacd
Fix billing email being parsed as a URL link when beginning of email contains www closes #25099 2020-10-15 14:25:03 -07:00
Rodrigo Primo 9155a78043
Merge pull request #27858 from Rowayda-Khayri/fixes
Add punctuation mark to function's docblock
2020-10-15 15:09:21 -03:00
Néstor Soriano e4a109f0d1
Merge pull request #27763 from woocommerce/fix/27445
Remove protection as we already diff and update only if needed.
2020-10-15 10:01:34 +02:00
Claudio Sanches e34681dbb4
Merge pull request #27696 from woocommerce/fix/version-race-conditions
Fix some race conditions in WC_Install
2020-10-14 20:18:47 -03:00
Claudio Sanches d211f6ee5c
Merge pull request #27516 from KoolPal/patch-2
Renamed Postcode / ZIP to Pin code & renamed State / County to State for India
2020-10-14 19:51:46 -03:00
Claudio Sanches 0b41aff81b
Merge pull request #27546 from KoolPal/patch-1
Updated - Added postcode validation for India
2020-10-14 19:25:32 -03:00
Claudio Sanches e581ffce27
Fixed missing "break" 2020-10-14 19:22:19 -03:00
Claudio Sanches 136c6e2916
Merge pull request #27779 from zzap/patch-2
Update properties for Serbia.
2020-10-14 18:09:56 -03:00
Claudio Sanches 23fe4f71bb
Merge pull request #27842 from sudoshreyansh/fix/27839
Fixed </strong> closing tag position. Issue: #27839
2020-10-14 18:06:10 -03:00
Claudio Sanches 537ec5d0e9
Merge pull request #27893 from dominic-ks/update-needs-payment-check
issue #24631 - Updated needs payment check to use order
2020-10-14 16:29:25 -03:00
Claudio Sanches 27e4288eab
Merge pull request #27934 from woocommerce/remove_get_product_from_item
Remove the remaining uses of $order->get_product_from_item()
2020-10-14 16:18:29 -03:00
Claudio Sanches c530fc0d55
Merge pull request #27908 from woocommerce/fix/template-attachment-ids
restore $attachment_ids for product thumbnails template
2020-10-14 15:38:19 -03:00
Claudio Sanches 6ad79cf050 Fixed PHP notice
> PHP Notice: compact(): Undefined variable: gallery_image_ids in includes/wc-template-functions.php on line 1487
2020-10-14 15:37:12 -03:00
Claudio Sanches 47a7c6648a
Update includes/wc-template-functions.php 2020-10-14 15:29:24 -03:00
Vedanshu Jain f65491d1b2
Merge pull request #27898 from woocommerce/add/allow-customise-reset-password-page-title
Use "Set Password" page title for lost-password endpoint when setting a password
2020-10-14 23:24:27 +05:30
Claudio Sanches be4aacee93
Merge pull request #27483 from woocommerce/fix/27475
prevent regenerate image filter loop
2020-10-14 14:03:00 -03:00
Claudio Sanches 7d1ff1a655
Merge pull request #27310 from woocommerce/fix/27215
Fix deleting a tax class via WP CLI.
2020-10-14 14:00:33 -03:00
Ron Rennick 9cf2d81f60 Merge branch 'master' into fix/template-attachment-ids 2020-10-14 12:40:57 -03:00
Ron Rennick 8ec54fabe0 phpcs fixes 2020-10-14 10:27:58 -03:00
Ron Rennick cd20044b13 Merge branch 'master' into fix/27215 2020-10-14 10:16:36 -03:00
vedanshujain c01f32a390 Use default value if formatted value is not available 2020-10-14 14:51:19 +05:30
vedanshujain 8e12de5d3c Merge branch 'fix/api/229-unit-test' of https://github.com/shiki/woocommerce into fix/api/229 2020-10-14 13:53:03 +05:30
Rua Haszard 95f4b5b81e restore original comment (related changes are gone) 2020-10-14 12:35:32 +13:00
Rua Haszard 5e3713da75 check password-set user token before redirecting to set password form:
- this prevents the password reset process earlier (before the redirect)
- also now shows a notice informing the user that they need to log out
  of (other) account
2020-10-14 12:26:51 +13:00
Rua Haszard 1f5601f0fe ensure lost-password form only resets password for correct user:
- if a user is logged in, check their ID matches the ID in the reset
  key / token
2020-10-14 12:12:01 +13:00
Rua Haszard 5e5d06cfab show lost-password form when logged-in user:
- in the checkout signup use case, the user may be setting their
password in a logged-in browser session; they need to be able to set an
initial account password
2020-10-14 09:50:36 +13:00
Rua Haszard b34ad5be5c improve PHPdocs for get_endpoint_title and related hook:
- add @since (original since based on git blame)
- document all params
- add @since for newly-added params
- add docs for woocommerce_endpoint_{$endpoint}_title
2020-10-14 09:50:36 +13:00
Rua Haszard 6032962e59 use "Set password" title for lost-password endpoint for more actions:
- 'rp' and 'resetpass' are used in WordPress core
1079647d30/wp-login.php (L913)
- using 'newaccount' for checkout signup case
2020-10-14 09:50:36 +13:00
Rua Haszard 1eb02845aa support overriding/customising password reset page title via `action`:
- get_endpoint_title now takes an extra `action` param
  - this also is passed to the relevant hook (as an additional arg)
  - woocommerce_endpoint_{$endpoint}_title
- for `lost-password?action=rp`, use `Set password`
- pass action query param through when using get_endpoint_title
2020-10-14 09:50:36 +13:00
pjv 7909c3ca7c white space 2020-10-13 13:59:53 -05:00
pjv 98b0fcbdff add “before” stock change action hooks to CRUD transaction 2020-10-13 13:36:42 -05:00
Claudio Sanches e655b44717 Fixed coding standards 2020-10-13 22:32:32 +05:30
Shiki 2e165e7558 Orders: Make display_key and _value meta available for v3 and v3
This resolves the intentionally failing
WC_Tests_API_Orders_V2::test_get_item_with_line_items_meta_data.
2020-10-13 22:32:31 +05:30
Shiki a3f46e5526 Schema: Make display_key and *_value available for v3 and v2
This is just the schema and the actual functionality isn't implemented yet.
2020-10-13 22:32:30 +05:30
Shiki b9ae830da5 Fix formatting in Orders V2 unit test 2020-10-13 22:32:30 +05:30
Shiki f45e8b884b Orders V3: Reuse WC_Order_Item->get_formatted_meta_data
Previously, I was using my own function. This time, we're using the function
available in WC_Order_Item but sanitizing the results after.
2020-10-13 22:32:30 +05:30
Shiki 2e92460df2 Orders V3: Include display_key and display_value in item meta_data 2020-10-13 22:32:30 +05:30
Shiki d8ac282c80 Orders V3 Schema: Add display_key and display_value for meta props 2020-10-13 22:32:29 +05:30
James Allan 1fcedb5279 Removes the remaining uses of $order->get_product_from_item 2020-10-13 11:24:48 +10:00
sudoshreyansh f1d89e6e78
Fixed taxonomy term message 2020-10-09 13:16:40 +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
Rodrigo Primo 6861fdab5d Update @version in which a filter was added 2020-10-08 17:03:09 -03:00
Jon Campbell 0fedb0db7a
Added filter for low stock notification emails (#27819)
* Adding new filter for low stock notification

* Update class-wc-emails.php

fixing whitespace
2020-10-08 17:02:09 -03:00
Ron Rennick 4a8898dfbd restore $attachment_ids for product thumbnails template 2020-10-08 15:08:03 -03:00
Néstor Soriano e4b78cedbf
Merge pull request #27748 from woocommerce/remove-leftovers-from-improved-filtering-by-attribute-for-variations
Remove leftovers from the reverted improved filtering mechanism for variations
2020-10-08 15:45:09 +02:00
Rodrigo Primo 0771138604
Merge pull request #27707 from dd32/php8/warnings
PHP8 Warning: Change __wakeup() to a public method
2020-10-08 10:01:21 -03:00
Néstor Soriano ab529835fa
Merge pull request #27840 from woocommerce/php8/fix-required-parameters-after-optional
[PHP 8] Convert optional-before-required parameters into required parameters
2020-10-08 14:22:52 +02:00
Vedanshu Jain 8a9fa0d27b
Merge pull request #27587 from om4james/fix/26847-rest-api-auth
Fix HTTP 401 `woocommerce_rest_cannot_view` `Sorry, you cannot list resources` REST API response
2020-10-08 16:32:03 +05:30
Nestor Soriano b71f876cba Reintroduce the dependency injection related code.
After the League's Container package has been reintroduced, all the
code that implements the dependency injection mechanism in woocommerce
can be brought back as well.
2020-10-08 09:28:05 +02:00
James Collins 79dd557b77
Return true to indicate that authentication using this method was successful 2020-10-08 09:33:33 +08:00
Ron Rennick 175499b40a Merge branch 'master' into fix/27215 2020-10-07 15:59:19 -03:00
Ron Rennick 577494796c
Merge pull request #27736 from woocommerce/fix/27681
Update taxonomy template file names to `-`
2020-10-07 15:23:11 -03:00
Ron Rennick 24ec59cf26 fix merge conflict 2020-10-07 15:19:05 -03:00
Ron Rennick 67a54b3aa3
Merge pull request #27289 from woocommerce/fix/27222
use first gallery image on single product when image not assigned
2020-10-07 15:06:30 -03:00
Dominic Vermeulen-Smith c054a2803b issue #24631 - Updated needs payment check to use order 2020-10-06 17:38:07 +01:00