Commit Graph

19570 Commits

Author SHA1 Message Date
Rodrigo Primo 62d6b05b58 Fix Generic.Formatting.MultipleStatementAlignment violations
This commit fixes all violations of the Generic.Formatting.MultipleStatementAlignment sniff automatically using phpcbf.
2019-12-20 14:21:08 -03:00
Rodrigo Primo 179dd7003e Fix Generic.Arrays.DisallowShortArraySyntax violations
This commit fixes all violations of the
Generic.Arrays.DisallowShortArraySyntax sniff automatically using
phpcbf.
2019-12-20 14:18:04 -03:00
Rodrigo Primo 94373f78ea Fix WordPress.Arrays.MultipleStatementAlignment errors automatically using phpcbf 2019-12-20 13:51:26 -03:00
Rowayda.Khayri f6574e3f91 fix a typo 2019-12-20 18:45:34 +02:00
Justin Shreve a5ee52a6c6 Add WP version check before recommending WooCommerce Admin 2019-12-18 09:29:21 -05:00
vedanshujain ad2f76275a Applied coding standards 2019-12-17 19:13:19 +05:30
vedanshujain ba2d825800 Use DB timestamp to ensure consistency between servers. 2019-12-17 19:13:19 +05:30
vedanshujain 9b7343d23b Applied coding standards 2019-12-17 19:13:19 +05:30
vedanshujain 47ba1d49da Cascade to return null to prevent notice when array is empty.
Another situation where this change is required when there are two coupons in an order but only one coupon has limit. In this case array will be present but one of the coupon will not have a corresponding record which will throw a notice.
2019-12-17 19:13:19 +05:30
vedanshujain 53bfcea110 Use same filter for stocks and coupon for consistency. 2019-12-17 19:13:19 +05:30
vedanshujain 72545c44b7 Add support for `_held_for_checkout` records to improve performance.
This will also improve transactional stability and avoid race conditions by providing a way to lock usage counts.
2019-12-17 19:13:19 +05:30
Rodrigo Primo ae1717cd4f Fix PHPCS violations automatically using PHPCBF 2019-12-13 17:51:14 -03:00
Rodrigo Primo f06ad5d78a Replace removed WordPress.Security.NonceVerification.NoNonceVerification
WordPress Coding Standard 2.0 removed the sniff
WordPress.Security.NonceVerification.NoNonceVerification:

```
The WordPress.Security.NonceVerification sniff used the same error code for both an error as well as a warning.
The old error code NoNonceVerification is no longer used.
The error now uses the Missing error code, while the warning now uses the Recommended error code.
```

(from
d45f5e5cf3/CHANGELOG.md (200-rc1---2018-12-31))

This commit updates WooCommerce code and replaces all instances where WordPress.Security.NonceVerification.NoNonceVerification verification was used with either WordPress.Security.NonceVerification.Missing or
WordPress.Security.NonceVerification.Recommended. In a few cases WordPress.Security.NonceVerification.NoNonceVerification was used but was not needed, so instead of replacing the sniff, the line was removed. In two other cases, I removed other unrelated sniffs that were not needed.
2019-12-13 17:45:32 -03:00
Rodrigo Primo 9c4de8f5e7 Fix indentation 2019-12-13 16:48:17 -03:00
Rodrigo Primo d451b68488
Merge pull request #24929 from helgatheviking/feature/woocommerce_process_variation_object
Add woocommerce_admin_process_variation_object before $variation->save()
2019-12-13 16:46:22 -03:00
Rodrigo Primo 00c40dab1a
Add pay order product has enough stock filter (#25230)
* [#25021] Add filter when checking if product has enough stock while paying for order

* [#25021] Retain original < check, invert bool

* [#25021] Make filter more readable
2019-12-13 11:16:30 -03:00
Rodrigo Primo e963d7cfab Fix minor imprecision in wc_is_wp_default_theme_active() documentation 2019-12-13 09:59:20 -03:00
Peter Fabian 72925ef41c Centralize check for default themes.
This should make Storefront appear in the Setup Wizard again.
2019-12-11 18:35:04 +01:00
Claudio Sanches 2975b3a7b7 Rate limit feature 2019-12-11 01:38:19 -03:00
Claudio Sanches 589d8c4591 Updated WooCommerce::$version 2019-12-10 22:55:08 -03:00
Claudio Sanches f7632de06e
Merge pull request #25164 from om4james/webhook-delete-cache
Delete cached webhook data when a webhook is deleted
2019-12-10 22:45:42 -03:00
Claudio Sanches 02ae29c8fc Fixed support to older versions of WordPress 2019-12-10 22:12:50 -03:00
dsmithweb 5a17c63cc9 Update links 2019-12-10 18:41:55 -06:00
Claudio Sanches 57d5c88b13
Merge pull request #24876 from akshaya-rane/fix-product-bulk-edit
refs #24638 Fixed Stock status update on Bulk Edit
2019-12-10 12:29:48 -03:00
Peter Fabian d8f49787a4 Better reflect variable purpose with updated name. 2019-12-10 14:22:30 +01:00
Peter Fabian fd66112bb7 Add WP version number class to Setup Wizard/OBW body element. 2019-12-10 13:32:13 +01:00
Claudio Sanches 104f40c36e
Merge pull request #24281 from woocommerce/fix/24269
Handle multiple decimal points
2019-12-09 14:07:29 -03:00
Andrej Mernik d20d429e32 Add postcode validation for Slovenia (#25174)
Add postcode validation for Slovenia
2019-12-09 10:09:45 -03:00
Claudio Sanches 85635773e9 Fixed coding standards 2019-12-06 12:51:10 -03:00
Claudio Sanches 78e382e4d6 Fixed incorrect concatenation of variation sale prices with ".00" 2019-12-06 12:37:23 -03:00
Claudio Sanches 0d1d0d6653 Fixed coding standards 2019-12-06 11:18:13 -03:00
Claudio Sanches b4af5f3c89 Updated regex to allow only one decimal point 2019-12-06 11:11:47 -03:00
James Collins 0246b02a94 Merge branch 'master' into webhook-delete-cache 2019-12-06 08:57:54 +08:00
Khokan Sardar 51252a6f8e Fixed issue #24575 (#24586)
* Fixed issue #24575

* Fixed implementation for #24575
2019-12-05 21:23:40 -03:00
Juancho Pestana b8217fa080 Fix #24365: Prevent billing address from being updated on shipping update. (#24374)
* Prevent billing address from being updated on shipping update.

* Set billing address if empty.

* Fix coding standard issue.

* Fixed missing tab
2019-12-05 21:17:01 -03:00
Claudio Sanches 5dac360e8a
Merge pull request #24208 from woocommerce/fix/order-screen-tax-calculation-to-honor-rounding-setting
Honor tax rounding preference in edit item and refund flows
2019-12-05 20:52:48 -03:00
Claudio Sanches 2e94410dc4
Merge pull request #24683 from n-dawson/fix-archive-orderby-param
Refine static homepage check to exclude blog archive queries. Fixes #…
2019-12-05 20:41:59 -03:00
Claudio Sanches 4ea81923da
Merge pull request #24935 from woocommerce/fix/24845-wpcom-customizer
Do not run send_frame_options_header when on the customizer
2019-12-05 20:28:55 -03:00
Rodrigo Primo 27915dd696 Exception when WC_Product_Variation is instantiated with the wrong type
This commits changes WC_Product_Variation to raise an exception when the
class is instantiated with an ID that belongs to a post object that is
not a product variation.

This is necessary to avoid problems like the one described in #24956
where passing a variable product ID to WC_Product_Variation would result
in transparently modifying the variable product title and excerpt.
2019-12-05 15:45:48 -03:00
Rodrigo Primo 61a843679a Fix WPCS violations automatically using phpcbf 2019-12-05 15:45:12 -03:00
Claudio Sanches d7e2a98aaf
Merge pull request #24828 from woocommerce/fix/24695
Adds shared code between Orders and Cart calculation logic.
2019-12-05 12:39:50 -03:00
Peter Fabian 44d39c369e Fixed the PHPCS to reflect new rules. 2019-12-05 16:00:18 +01:00
Peter Fabian 4dfa68b62d More PHPCS fixes. 2019-12-05 15:46:13 +01:00
Peter Fabian 2e81f21e29 Improved variable naming and comments. 2019-12-05 15:37:33 +01:00
Peter Fabian 159199f254 Check the nonce before the rate limiting. 2019-12-05 15:36:50 +01:00
Peter Fabian 85c4a5beed PHPCS fixes. 2019-12-05 15:30:53 +01:00
Gerhard Potgieter 7d39222334
Merge pull request #25162 from woocommerce/fix/24018
Hid variable parent products from "Add Products" search on order page
2019-12-05 14:22:43 +02:00
Rodrigo Primo 6b61d5f025
Merge pull request #24934 from woocommerce/add/filter_invalid_variations_notice
Introduce show_invalid_variations_notice filter
2019-12-05 09:08:24 -03:00
Peter Fabian 0d3074a554 Added rate limiting to Add payment method. 2019-12-05 12:03:02 +01:00
Gerhard 216a86b558 Change filter name to woocommerce_show_invalid_variations_notice and also pass through the $product_object variable. 2019-12-05 08:08:07 +02:00
Christopher Allford b67d094601 Added support for comma-delimited lists of types to exclude 2019-12-04 14:39:41 -08:00
Rodrigo Primo 3af024fc5c
Merge pull request #25031 from woocommerce/feature/24956
Introduced wc_get_product_object() helper
2019-12-04 16:53:04 -03:00
Rodrigo Primo aaea7b1c55
Merge pull request #25001 from woocommerce/feature/inline-notices
Initial support to inline notices
2019-12-04 16:50:40 -03:00
Rodrigo Primo fe0c1c441e
Merge pull request #24852 from JacobMC/remove_function_causing_php_error
Refactor to remove PHP 7 Error
2019-12-04 16:29:11 -03:00
Claudio Sanches e3b2d9f10c Merge branch 'master' into feature/inline-notices 2019-12-04 16:26:10 -03:00
Claudio Sanches 5fdb880831
Merge branch 'master' into feature/24956 2019-12-04 16:18:39 -03:00
Claudio Sanches 8033d5751e Changed wc_get_product_classname function name to wc_get_product_object 2019-12-04 16:15:16 -03:00
Claudio Sanches a12c25862b
Revert "Add support for '_held_for_checkout` records to prevent race conditions." 2019-12-04 16:03:05 -03:00
Claudio Sanches 0686e6f1cd
Merge pull request #25000 from woocommerce/feature/pay-button-support
Initial support for "pay button"
2019-12-04 16:02:02 -03:00
Claudio Sanches f07ed76e43 Fixed coding standards 2019-12-04 15:53:48 -03:00
Rodrigo Primo 4af9a94129 PHPCS fixes 2019-12-04 15:52:20 -03:00
Claudio Sanches b76bebab8d Improved escaping and HTML formatting
Fixed coding standards
2019-12-04 15:52:00 -03:00
Claudio Sanches adbb4fd2d3
Merge pull request #24937 from jenkoian/wc-placeholder-attrs
Add support for custom attributes to wc_placeholder_img().
2019-12-04 15:42:41 -03:00
Claudio Sanches 24c473f932
Merge pull request #24991 from woocommerce/add/new-onboarding-ab-test
Onboarding - Show the new experience to 10% of new users
2019-12-04 11:00:23 -03:00
James Collins b29f8cc1bd Deleted cached webhook data when deleting a webhook 2019-12-04 12:04:35 +08:00
Christopher Allford d3a7266848 Hid variable product types from "Add Products" search on order management page 2019-12-03 14:17:51 -08:00
Christopher Allford d1e25c9118 Added support for excluding certain product types from AJAX product searches 2019-12-03 14:14:47 -08:00
Claudio Sanches 3519b5bd5c
Merge pull request #25049 from woocommerce/fix/24953
Prevent creating products before registering related post types and taxonomies.
2019-12-03 18:02:22 -03:00
Claudio Sanches 3beb581215
Merge pull request #25074 from woocommerce/fix/24959
Added Photoswipe and jQuery-UI CSS minification
2019-12-03 17:59:51 -03:00
Claudio Sanches 258066dc2b
Merge pull request #25077 from woocommerce/update/coupon-object-update-hook
Fix second param of action hook woocommerce_coupon_object_updated_props
2019-12-03 17:53:04 -03:00
Claudio Sanches 174a722adf
Merge pull request #25131 from woocommerce/remove-wccom-site-api-permalink-require
Remove permalink reliance
2019-12-03 17:48:23 -03:00
Claudio Sanches 924109b80c
Merge pull request #25160 from bgrgicak/update/wccom-6777
Fix PHP Notice:  Undefined index: folder_exists
2019-12-03 17:48:05 -03:00
Claudio Sanches 0c486785ad
Merge pull request #25089 from woocommerce/fix/24009
Add support for '_held_for_checkout` records to prevent race conditions.
2019-12-03 17:47:22 -03:00
Claudio Sanches 3d394dd72c Use wc_get_order() instead of "new WC_Order" 2019-12-03 16:43:00 -03:00
Claudio Sanches 988b72e461 Updated filter name to woocommerce_hold_stock_for_checkout
Also fixed coding standards
2019-12-03 16:38:17 -03:00
Bero df21888b59 check if isset folder_exists in move_product step 2019-12-03 20:03:17 +01:00
Claudio Sanches 8b64471f3a Remove extra variable 2019-12-03 15:35:06 -03:00
Claudio Sanches 6a395e2485
Merge pull request #25064 from woocommerce/fix/24315
Optimize variable product duplication slug generation
2019-12-03 15:28:55 -03:00
Claudio Sanches cd4b2ac5b8
Merge pull request #25084 from woocommerce/fix/25004
Fixed manual sorting for products shortcode
2019-12-03 15:15:30 -03:00
Christopher Allford 91877b8f42 Revert "Changed the default sorting for the products shortcode to "menu_order""
This reverts commit 4a8645c9b4.
2019-12-03 09:54:23 -08:00
Claudio Sanches 15ffaeee6b
Merge pull request #25101 from woocommerce/remove-call_user_func_array
Remove a few calls to func_get_args() and call_user_func_array()
2019-12-03 14:51:43 -03:00
Rodrigo Primo 02ae8d1206
Merge pull request #24292 from woocommerce/fix/24116
Prevent PHP notices in WooCommerce widgets using Gutenberg's Legacy Widget Block
2019-12-03 14:25:05 -03:00
Rodrigo Primo 123169baa5
Merge pull request #24892 from woocommerce/update/check-textdomain
Check text domains in libraries
2019-12-03 14:12:07 -03:00
Claudio Sanches cbeb95379e Fixed PHPCS warnings and code clean up 2019-12-03 14:04:15 -03:00
Gerhard da33f216ea PHPCS fixes 2019-12-03 16:22:13 +02:00
Gerhard 1f678767a9 Introduce woocommerce_order_payment_status_changed action and logic around it when an order progresess from a pending payment to a paid status, in prep for Order status work. 2019-12-03 16:20:24 +02:00
Justas Butkus 34f54071bb Revert "Build the REST API URL before checking for wccom-site"
This reverts commit 0674b421ec.
2019-12-03 09:20:28 +02:00
Claudio Sanches 3122d28472 Fixed text domains 2019-12-02 18:38:21 -03:00
Rodrigo Primo 7edd0561d3
Merge pull request #25098 from woocommerce/fix/wccom-back-url-encode
Url encode "wccom-back" param in in-app purchase product link
2019-12-02 18:00:55 -03:00
Claudio Sanches af849fbd8a
Merge pull request #25112 from woocommerce/add/wccom-installer-api-error-code
Improve error codes for plugin installer API authentication
2019-12-02 17:46:31 -03:00
Claudio Sanches 0674b421ec Build the REST API URL before checking for wccom-site 2019-12-02 17:37:48 -03:00
Rodrigo Primo 00896ffb11
Merge pull request #25026 from woocommerce/fix/25022
Made usage tracking link in setup more transparent
2019-12-02 17:19:10 -03:00
Rodrigo Primo 10e1c61731
Merge pull request #25071 from woocommerce/add/tracks-processing-orders
Include processing orders in tracker data.
2019-12-02 17:09:57 -03:00
Claudio Sanches 2133ae9acb
Merge pull request #25132 from woocommerce/fix/24812
Added empty categories to the product exporter admin view
2019-12-02 17:01:41 -03:00
Justas Butkus e0613db386 Account for early start-up phase
Using `$wp` doesn't work in certain scenarios, where the entire system
didn't complete bootstrapping.
The raw query, after escaping the values, should sufficiently cater for
the need.
2019-12-02 21:56:42 +02:00
Rodrigo Primo c86116a001
Merge pull request #24986 from woocommerce/fix-variation-missing-image-notice
Prevent notice in PHP 7.4 when a variable product has no images
2019-12-02 16:53:41 -03:00
Rodrigo Primo 86f59dff09
Merge pull request #24961 from woocommerce/fix/admin-caching-incr
Changed wp_cache invalidation from using increment to using microtime.
2019-12-02 15:32:17 -03:00
Claudio Sanches c6b2581a0c
Merge pull request #25140 from bgrgicak/update/wccom-6777
Return folder_exists error as success
2019-12-02 15:25:34 -03:00
Rodrigo Primo ebc9551c6e
Merge pull request #24849 from woocommerce/feature/24839
Introduced woocommerce_kses_notice_allowed_tags filter
2019-12-02 15:21:59 -03:00
Bero 33d9f33fa3 folder_exists plugin info added 2019-12-02 16:11:44 +01:00
4selin 8007c7c3a3 Address in shipping calculator malformed for Canada #25094 2019-11-30 19:55:35 +03:00
Christopher Allford baeae0652c Added a check to prevent variable product parents from being added to orders. 2019-11-29 17:06:50 -08:00
Christopher Allford 928ec871fa Code style fixes 2019-11-29 17:06:33 -08:00
Bero db112275c2 Return folder_exists error as success 2019-11-29 15:40:53 +01:00
Peter Fabian fa38299ad1 Added abstraction for checking the modus of order creation. 2019-11-29 15:32:38 +01:00
Peter Fabian 9a91341334 Only update the IP address when order gets created from admin.
This should prevent potential conflicts/race conditions with callbacks from payment gateways updating the order in parallel.
2019-11-28 15:10:33 +01:00
Peter Fabian 309c48ab0e Deprecated old cache function and replaced it with a new one. 2019-11-28 14:03:57 +01:00
Christopher Allford 44aed47f4d Added empty categories to the product exporter admin view 2019-11-27 12:08:56 -08:00
Justas Butkus dbc0c5ab85 Remove permalink reliance
Some sites don't have permalinks enabled (e.g. local dev environments) and
can't use the WC site API functionality.

The `rest_get_url_prefix` elsewhere is only used in permalink context (e.g.
`get_rest_url` uses it conditionally), while `$wp->query_vars` are always
populated, even in rewrite condition, thus making them more accessible.
2019-11-27 21:45:21 +02:00
Peter Fabian 278cf53f2f
Merge pull request #25125 from woocommerce/fix/25029.3
Fix select2 style and admin screen button alignments in WP 5.3
2019-11-27 17:58:46 +01:00
Peter Fabian 8379e46772
Merge pull request #24278 from woocommerce/fix/23299
Display schema for the latest 5 reviews inside product's schema
2019-11-27 17:56:54 +01:00
Peter Fabian 8a0a5805e4
Merge pull request #25085 from woocommerce/fix/24648
Improve WC & Twenty twenty compatibility
2019-11-27 17:54:44 +01:00
Viszt Péter 3d6c3b3551 Fixes for alignment issues on the settings screen introduced by WP 5.3 2019-11-27 13:05:20 +01:00
vedanshujain aaa85ac74c Use standard way to calculate total in `get_subtotal_to_display` for consistency.
We were calculating subtotal to display slightly differently then we would have calculated subtotal in the cart. This was affecting subtotal value in invoices and in order confirmation screen.

This patch updates how we calculate subtotal to display such that we calculate in same way.
2019-11-27 04:43:23 +05:30
vedanshujain 8c2c83d488 Use `wc_round_tax_total` to make it consistent with how we round taxes.
When price includes taxes, we round down. This patch uses the correct method to round taxes depending on the mode instead of plain rounding.
2019-11-27 03:13:39 +05:30
Peter Fabian f50d8ffdd1 Fixed PHPCS. 2019-11-26 20:54:04 +01:00
vedanshujain 2ac3a0dfc8 Code standard fixes. 2019-11-26 18:36:23 +05:30
vedanshujain 5ef41f1ecc Empty cart before test to make sure everything in cart exists 2019-11-26 18:21:24 +05:30
vedanshujain 1de30e8963 Refactor so that trait don't have class specific functions. 2019-11-26 01:30:45 +05:30
Denis Dvali 4bc4faf7af Adding new explicit error codes for WC.COM installer API authentication errors. 2019-11-25 19:32:10 +03:00
vedanshujain 60cd7b3651 Refactor Order Class to use shared calculation logic.
We added a trait to move shared logic betweem Orders and Cart. This commit refactors Order class to use that shared logic.
Also adds a test for a failing case.
2019-11-25 17:53:14 +05:30
vedanshujain bee7ea4490 Add trait which contains common total calc logic.
`WC_Abstract_Order` and `WC_Cart_Totals` have their own logic to calculate totals. This means that we would have to fix in two places. This commit adds a trait which can be used to place shared logic between above two classes.
2019-11-25 17:53:14 +05:30
Paul Dechov 7f65a33fe8 Honor tax rounding preference in edit item and refund flows
The default value ('no') of the setting to round taxes at subtotal was not being honored on the Edit Order screen, which resulted in off-by-one discrepancies between the checkout item total and the edited or refunded item total.

This change is to round to the proper precision (w.r.t. the 'woocommerce_tax_round_at_subtotal' setting) for the default value of the form, as well as when the values are dynamically recomputed.
2019-11-25 17:49:43 +05:30
Denis Dvali 234bb9139f Move "no permissions" error data (error code, message, http code) to
a constant within a dedicated error messages class.
2019-11-25 13:46:07 +03:00
Peter Fabian f3892359f3 Make thumbnail larger, improve shop layout. 2019-11-24 09:51:15 +01:00
Rodrigo Primo 36cdc3cf8f Simplify and modernize WC_Emails::queue_transactional_email()
This commit replaces calls to call_user_func_array() with the spread operation.
2019-11-22 15:25:44 -03:00
Rodrigo Primo 9bebc4e69e Simplify and modernize wc_walk_category_dropdown_tree()
This commit replaces calls to call_user_func_array() and func_get_args() with the spread operation. Both to make more explicit that this is a variadic function and to do argument unpacking when calling the walker method.
2019-11-22 15:25:44 -03:00
Rodrigo Primo 193395ddf5 Simplify and modernize two methods
This commit replaces calls to call_user_func_array() with argument unpacking using the spread operator that was added in PHP 5.6 in the following methods:

- WC_Admin_Setup_Wizard::run_deferred_actions()
- WC_Mail::send()
2019-11-22 15:25:08 -03:00
Peter Fabian 9c74bf79ea Rather than setting the background in CSS, use the color picked in the
customizer.

This also fixes the background in the block editor and tinymce.
2019-11-22 15:37:54 +01:00
Denis Dvali 0810c4a027 Url encode value of "wccom-back" GET param in product links on in-app marketplace. 2019-11-22 15:02:58 +03:00
Justin Shreve 1fabf2f145 Handle PR feedback 2019-11-21 12:23:05 -05:00
Christopher Allford a0c4d54b4a Updated NonceVerification code sniff suppressions
The suppressions come in two flavors, a warning and an error. The suppressions have been updated to respect those states accordingly.
2019-11-21 09:19:56 -08:00
Justin Shreve ff68f30c2c Update opt-in value to 'yes' 2019-11-21 12:00:05 -05:00
Justin Shreve 18925f2218 Adds an a/b test for the new onboarding experience 2019-11-21 12:00:04 -05:00
Christopher Allford 8066f43188 Merge branch 'master' into fix/25004 2019-11-21 08:14:03 -08:00
Rodrigo Primo e292e95542 Update WPCS rule name that was change after an update 2019-11-21 12:17:10 -03:00
Rodrigo Primo 49b1294494 Simplify and modernize wc_print_r()
Replaces a call to call_user_func_array() with argument unpacking using the spread operator.
2019-11-21 12:04:08 -03:00
Rodrigo Primo 6cd08dc7bd Use the spread operator instead of call_user_func_array() in WC_Data_Store
This commit replaces a call to call_user_func_array() in WC_Data_Store::__call() with argument unpacking using the spread operator which was introduced in PHP 5.6. This change should improve WooCommerce performance a tiny bit since WC_Data_Store::__call() is called somewhat frequently and call_user_func_array() has a bad performance reputation. I added one unit test to make sure this change doesn't break the functionality of the altered method.
2019-11-21 11:52:47 -03:00
vedanshujain 70a54d0639 Added Unit Tests for `held_for_checkout` records. 2019-11-21 18:11:37 +05:30
vedanshujain 882b441bfb Remove order_id param because order is not pending (see desc).
In the query inside method `wc_get_hold_stock_quantity` we have a clause of `status = wc_pending`. Call for this method here is already nested inside an `if` condition which checks that order is not pending. So this parameter is not needed here and only adds complexity to the final query.
2019-11-21 13:49:49 +05:30
Jacob McKinney 0d35e2e5eb Removed variable and set exception paramater to array containing the order id. 2019-11-20 22:52:04 -06:00
Christopher Allford 8fd99a74b9 Added descriptive text to the usage tracking documentation link in the setup wizard 2019-11-20 12:47:56 -08:00
vedanshujain e87024bb81 Add support for '_held_for_checkout` records to prevent race conditions.
When creating an order, if manage inventory is enabled then add a `_held_for_checkout` record with a expiry timestamp embedded. This is added in an atomic manner along with making a check whether we have current stock or not.
This record is removed when order status goes to either `processing` or `completed`.
2019-11-21 01:21:08 +05:30
Christopher Allford 661f2b7722
Added a comment clarifying the suffix substring when checking slug uniqueness 2019-11-20 10:02:34 -08:00
Christopher Allford 55f49ae26a Added an appropriate @since tag to the generate_unique_slug method 2019-11-20 09:55:35 -08:00
Christopher Allford 4a8645c9b4 Changed the default sorting for the products shortcode to "menu_order"
In order to take advantage of the "Sorting" admin feature, we need to make use of the menu order sorting. Initially we were using the title, which would ignore whatever the user set.
2019-11-20 09:19:54 -08:00
Christopher Allford b12574e9e4 Fixed code sniffs 2019-11-20 08:16:19 -08:00
Christopher Allford 358825f006 Added a transient clear when product ordering is changed 2019-11-20 06:50:32 -08:00
Gerhard 2a4a1a5842 Remove unused $updated_props variable 2019-11-20 14:47:44 +02:00
Michael Weichselgartner 2092da00c4 Fix second param of action hook woocommerce_coupon_object_updated_props
Changed second param from $updated_props to $this->updated_props
2019-11-20 14:42:09 +02:00
Gerhard Potgieter 95a0a4c0a4
Merge pull request #24930 from arnofo/feature/empty-cart-action-new-parameter
pass the clear persistent cart variable to the cart emptied actions
2019-11-20 12:52:36 +02:00
Gerhard Potgieter 3e116716cd
Merge pull request #24944 from AdelDima/patch-1
Update abstract-wc-csv-batch-exporter.php
2019-11-20 12:33:40 +02:00
Christopher Allford c2bc312e97 Added Photoswipe and jQuery-UI CSS minification 2019-11-19 10:40:28 -08:00
Peter Fabian daf4a53acf Make single images larger. 2019-11-19 19:36:10 +01:00
Peter Fabian bc04b8f45b Added basic declaration for WC support to Twentytwenty. 2019-11-19 17:58:16 +01:00
Rodrigo Primo 81187dc359
Merge pull request #25062 from itzmekhokan/fix/25056
Fixed issue #25056
2019-11-19 11:58:25 -03:00
Gerhard 3581a6c578 Include tracker fields for processing order totals and dates. 2019-11-19 15:10:43 +02:00
Christopher Allford 753f39ff27 Added unique slug generation for variable product duplication
The standard wp_unique_post_slug() function will run one query per name collision, leading to a large number of queries being made when a product template is duplicated repeatedly. We can avoid this by doing the unique generation ourselves.
2019-11-18 13:49:41 -08:00
Christopher Allford 7f44e23813 Resolved all of the phpcs errors 2019-11-18 13:43:03 -08:00
Rodrigo Primo 8675e26c28
Merge pull request #24884 from woocommerce/fix/24881
Return correct country code if default location isn't found
2019-11-18 17:10:35 -03:00
Rodrigo Primo 28bc4b242c
Merge pull request #25028 from woocommerce/feature/25019
Introduced hooks before and after settings form
2019-11-18 16:49:11 -03:00
Rodrigo Primo ec37b2bb27
Merge pull request #25041 from woocommerce/fix/25039
Fixed "Add payment method" menu highlight in My Account page
2019-11-18 15:57:52 -03:00
Rodrigo Primo 0a5ca3f144
Merge pull request #24756 from woocommerce/fix/24723
Changed thank you page text to follow PayPal guidelines
2019-11-18 15:29:59 -03:00
Claudio Sanches dd97b00815 Added "reviewBody" to review schema
Update get_comment_* functions args
2019-11-18 11:47:56 -03:00
khokan-cn 55e2a0e199 Fixed issue #25056 2019-11-18 18:03:59 +05:30
Gerhard Potgieter 822d1ebb40
Merge pull request #24879 from woocommerce/add_order_note_before_do_action
Add order note before do_action() to maintain order of notes
2019-11-18 14:02:03 +02:00
Gerhard Potgieter aaee28fe1e
Merge pull request #24798 from woocommerce/fix/24792
Do not set tracking cookie on ajax requests
2019-11-18 14:00:21 +02:00
Peter Fabian 38db309e07 Updated documentation. 2019-11-15 16:00:51 +01:00
Peter Fabian 45ca8eb867 Prevent creating products before registering related post types and taxonomies. 2019-11-15 15:50:18 +01:00
Rodrigo Primo dd54b73280
Merge pull request #24870 from woocommerce/update/formatted-address-filters
Pass "$this" to Order's formatted address filters
2019-11-14 17:38:12 -03:00
Rodrigo Primo 5ee7197c0f Fix PHPCS errors using PHPCBF 2019-11-14 17:32:24 -03:00
Rodrigo Primo 967fc364be
Merge pull request #24846 from woocommerce/fix/tracker-php-warning
[Tracker] Prevent PHP warning when order date is empty [part 2]
2019-11-14 17:28:15 -03:00
Claudio Sanches a7ba80a1f7 Fixed My Account menu highlight when adding payment methods 2019-11-14 09:51:49 -03:00
Claudio Sanches ba0773d12e Apply wc_get_product_classname() in the current code base 2019-11-13 15:30:09 -03:00
Claudio Sanches 24c5bf41c8 Set the ID in the current class 2019-11-13 15:30:06 -03:00
Claudio Sanches b7514b0bfc Fixed coding standards 2019-11-13 15:30:00 -03:00
Claudio Sanches 24560f93bf Introduced wc_get_product_classname function 2019-11-13 15:29:55 -03:00
Claudio Sanches 0f28a61910
Merge pull request #25017 from itzmekhokan/add/25016
woocommerce_upsells_display order filter added
2019-11-13 13:38:42 -03:00
Claudio Sanches 0624894462 Introduced hooks before and after settings form 2019-11-13 13:20:18 -03:00
Christopher Allford 357cd28b77 Made the usage tracking information link in the setup wizard more transparent 2019-11-12 13:27:31 -08:00
itzmekhokan 0716648c28 woocommerce_upsells_display order filter added 2019-11-11 22:35:32 +05:30
Luminus Olumide Alabi 36821c88a8 Add 8 more countries to the list 2019-11-09 10:54:09 +00:00
Luminus Olumide Alabi a09efed82e Update the list of non-EU countries using VAT 2019-11-08 17:14:18 +00:00
Claudio Sanches d8fed95403 Convert all notice data into HTML data 2019-11-07 20:34:49 -03:00
Claudio Sanches af4ef7ea0d Pass input ID to wc_add_notice() 2019-11-07 20:25:06 -03:00
Claudio Sanches 7024fc8483 Change notices to accept extra data 2019-11-07 20:23:30 -03:00
Claudio Sanches fdd391e10e Introduced wc_get_pay_buttons() function 2019-11-07 17:23:38 -03:00
Claudio Sanches d53b73b56c Added support for "pay button" feature 2019-11-07 17:22:33 -03:00
Luminus Olumide Alabi f8709ab83f Account for non-EU countries that collect VAT and rename tax to VAT on the frontend for them 2019-11-07 19:48:05 +00:00
David Stone 0d5c697123 Check that is really an attachment and not the global $post object.
Prevents Notices of Trying to access array offset on value of type bool because $src variables will be false.
2019-11-06 00:26:10 -07:00
Peter Fabian b3115bccc5 Changed caching invalidation by using increment to using microtime.
This is a similar problem that WP core faced in https://core.trac.wordpress.org/ticket/23448.
2019-11-03 14:14:53 +01:00
Peter Fabian a2cd974d79 Don't display Downloads section on refund emails. 2019-11-01 15:51:30 +01:00
itzmekhokan 3abae6db1b Fixed coding standards for this comment. 2019-11-01 15:35:23 +01:00
itzmekhokan 8b99e00b2d Fixed wordpress coding standard 2019-11-01 15:35:08 +01:00
itzmekhokan e9833c1ea0 Fixed issue #24430 2019-11-01 15:34:50 +01:00
Adel Tahri 859a041e80
Update abstract-wc-csv-batch-exporter.php
Update "Exit if accessed directly"
2019-10-31 15:58:54 +01:00
Ian Jenkins 2340f269cf Add support for custom attributes to wc_placeholder_img().
When displaying a list of images you often want a specific class to be
attached to each image, therefore you pass through a custom class using
the attr parameter. Unfortunately this doesn't get passed through to a
placeholder image should one be needed. This means that, for example, if
you're custom class center an image or something, it won't be honoured
for placeholders, which can lead to some wonky image listings.

You can work around this currently by leverging the
`woocommerce_product_get_image` filter, but it's a bit gnarly as you
need to do some regexing or string splitting or something and checking
class names and what not. This provides a much easier way, by
supporting custom attrs on placeholder images as is the case for non
placehodler images.
2019-10-30 15:08:19 +00:00
Gerhard 0cda53580f Do not run send_frame_options_header when on the customizer 2019-10-30 15:37:04 +02:00
Gerhard 40faecc8e7 Add show_invalid_variations_notice filter to hide the invalid variations notice. 2019-10-30 15:17:31 +02:00
Arnaud Faucon e8b1d617a1 pass the clear persistent cart variable to the cart emptied actions 2019-10-30 09:14:45 +01:00