Commit Graph

175 Commits

Author SHA1 Message Date
Christopher Allford 070954c888 Revert #28187
The default functionality within the `ThemeSupport` class has an unintended
side-effect of breaking the existing default functionality within the
`wc_get_theme_support()` function. Since the default set in the support
class is prioritized over the one given to `ThemeSupport::get_option()`,
the WordPress options set in the Customizer are never used for images.
2021-05-21 12:10:15 -07:00
Vedanshu Jain 6667233eb1
Merge pull request #29762 from woocommerce/fix/29502
Update restock logic during refunds closes #29502
2021-05-21 22:53:22 +05:30
jonathansadowski 692ddaf4f2
Merge pull request #29318 from woocommerce/fix/rounding
Make rounding more accurate when prices are entered more than 2dp
2021-05-12 17:43:29 -05:00
roykho b808d9a24f
Fix merge conflicts 2021-05-11 08:53:03 -07:00
roykho 8c3e90b3ce
Initialize _restock_refunded_items meta on order update 2021-05-11 08:35:48 -07:00
vedanshujain f53e9dde44 Use edit context to get unformatted price. 2021-05-07 14:59:14 +05:30
vedanshujain 6c2f30132d Add clear cart call to prevent side effects from tests. 2021-05-07 14:30:45 +05:30
vedanshujain 162588c42d Add test for when product prices has more precision than is displayed. 2021-05-07 14:30:44 +05:30
vedanshujain c834dfb98b Add test for when entered price has more precision than displayed price. 2021-05-07 14:30:44 +05:30
vedanshujain 2930057847 Add tests to make sure discounts are rounded properly in cart. 2021-05-07 14:30:44 +05:30
Nestor Soriano 9dcdfddc15
Fix table creation detection in DataRegeneratorTest 2021-05-05 11:50:43 +02:00
Nestor Soriano f53f959d03
Fix the usage of FakeQueue in DataRegeneratorTest.
Also update the doc comment of FakeQueue itself on how to use it.
2021-05-05 11:11:36 +02:00
Nestor Soriano c4e7074c70
Add unit tests for the DataRegenerator class 2021-05-04 16:15:16 +02:00
Nestor Soriano 4d13b0ca07
ExtendedContainer::replace now allows registering anonymous classes. 2021-05-04 16:14:34 +02:00
roykho 2e3156d436
Use proper skip test method instead of return 2021-05-03 06:33:09 -07:00
Nestor Soriano 42245ed92a
Add unit tests for LookupDataStore::update_data_for_product (variable products) 2021-05-03 11:14:33 +02:00
Nestor Soriano 467af94b1d
Add unit tests for LookupDataStore::update_data_for_product (simple products)
Also:

- Add the FakeQueue class
- Fix LookupDataStore, it was using a hardcoded "wp_" lookup table name
2021-04-30 12:10:25 +02:00
roykho 87047c77df
Limit the new refund restock logic to order version 5.4+ 2021-04-29 06:30:53 -07:00
Nestor Soriano 10adec6b88
Improvements in the engine behind the debug tools page.
Two new optional keys have been added to the tool definition array:

- 'disabled': when true the tool button will appear disabled.
- 'needs_refresh': when running a tool, by default the tool definitions
  are retrieved first, then the selected tool is executed,
  then the definitions previously retrieved are rendered.
  When this key is true the tool definitions are retrieved again
  after execution, useful for cases where the tool description
  or button enable/disable state changes after the tool execution.

Also now if a tool execution throws an exception a notice will be
shown with the execption message, previously the exception
was unhandled.
2021-04-28 10:24:23 +02:00
roykho b69f46d7d2
Add unit tests 2021-04-27 09:29:24 -07:00
Roy Ho 03d4d4893e
Merge pull request #28187 from woocommerce/fix/25900-take-2
Fix: image size customisation controls not shown when theme doesn't define them but Woo core does
2021-04-22 05:41:57 -07:00
Nestor Soriano 3a895c9eed
Move ThemeSupport class to Internal namespace, and use in 2021 theme. 2021-04-21 12:57:56 +02:00
Roy Ho e4fec5b914
Merge pull request #29721 from woocommerce/fix/29525
Modify wc_get_low_stock_amount function to always return a number
2021-04-20 11:56:27 -07:00
Nestor Soriano b88eb4c981
Rename "assertIsInt" to "assertIsInteger" and make it static
- Renaming to prevent conflicts with the existing method in
  the newer PHPUnit used in PHP 8.
- Making it static because "assertIsInt" is static too, so it'll be
  easier to replace in the future.
2021-04-20 17:16:59 +02:00
Nestor Soriano d11a20b5b4
Merge branch 'trunk' into fix/25900-take-2 2021-04-20 16:08:45 +02:00
Nestor Soriano 76a613a5bb
Modify wc_get_low_stock_amount so that it always returns an integer.
Previously, if the product didn't have an explicit low stock value
amount the value of the woocommerce_notify_low_stock_amount option,
which is a string, was returned verbatim.

Also, update related unit tests to create the option value as a string,
and to check that the value returned by woocommerce_notify_low_stock_amount
is always an integer.
2021-04-20 10:17:50 +02:00
Nestor Soriano 1008835488
Fix code sniffer violations in stock functions and its tests 2021-04-20 09:42:07 +02:00
roykho c73ce8ea04
Convert to using internal DI container 2021-04-16 12:23:40 -07:00
roykho 427be84875
Add unit tests 2021-04-14 11:54:13 -07:00
Néstor Soriano 439d26be82
Merge pull request #29606 from woocommerce/fix/29545
Don't verify empty country codes on checkout
2021-04-08 12:40:13 +02:00
Nestor Soriano a37b2a7474
Don't verify empty country codes on checkout
PR #28849 introduced a verification of the posted country code
on checkout, so an invalid code will throw an error. However there
are cases when an empty code is legitimately received, for example
when using Paypal checkout directly from the product page and
the customer doesn't have an address in his Paypal profile.
2021-04-07 09:59:56 +02:00
𝓑𝓪𝓻𝓻𝔂 𝓗𝓾𝓰𝓱𝓮𝓼 095b3e9fb9 Merge latest changes from trunk. 2021-03-31 10:25:25 -07:00
Roy Ho e4502fe314
Merge pull request #29495 from woocommerce/fix/29472
Add "postcodes" and "cities" support for the REST API tax rate creation/update endpoint
2021-03-31 08:17:31 -07:00
Nestor Soriano 64e903f65f
Update REST API v3 taxes endpoint descriptions with deprecation/introduction information. 2021-03-31 12:41:53 +02:00
Nestor Soriano 8ff664e758
Fix "doing wrong wpdb::prepare" notice for REST API get taxes endpoint. 2021-03-31 12:09:20 +02:00
Nestor Soriano ccb8cbddac Adjust tests for WC_Admin_Dashboard_Setup (consider 'payments' task) 2021-03-29 17:39:58 +02:00
𝓑𝓪𝓻𝓻𝔂 𝓗𝓾𝓰𝓱𝓮𝓼 f0c164d2d4 Do not copy fields from the billing address to the shipping address. | #28759 2021-03-26 17:08:37 -07:00
Nestor Soriano b5e13bd771 Add support for "postcodes" and "cities" (arrays) fields to the
REST API endpoints for creating and updating taxes.
2021-03-25 14:56:40 +01:00
Peter Fabian 351c07d655 Improved tests, added save points, fixed comments. 2021-03-16 13:08:29 +01:00
Peter Fabian e6cdd74a79 Add parent's default for low stock if notthing is set on individual variation.
I.e. use variation low stock amount value, if not available, use parent product's value, if not available, use the store-wide default.
2021-03-15 18:31:31 +01:00
Peter Fabian 1b53b724b2 Fix existing tests. 2021-03-11 17:02:22 +01:00
Saggre 24167a5eed Fix typos in docs 2021-03-05 11:19:58 +02:00
Moon 00a272fa85
Merge pull request #29174 from woocommerce/add/28568-dashboard-widget-finish-setup
Add/28568 dashboard widget - setup
2021-03-02 16:46:51 -08:00
Timmy Crawford 64e934e79b Remove debug code in tests. 2021-02-25 15:19:27 -08:00
Timmy Crawford 5cf3c6be8c Fix tests. 2021-02-25 15:19:27 -08:00
Timmy Crawford c7a19b538a Updates per feedback. 2021-02-25 15:19:27 -08:00
Timmy Crawford 47a3d1bfb3 Tracker: Add tracking of woocommerce_admin_disabled usage. 2021-02-25 15:19:27 -08:00
Claudio Sanches c86b0c578a Fixed copy and paste 2021-02-23 19:55:54 -03:00
Claudio Sanches 76e1ba4bf0 Validate variation ID while adding products to the cart 2021-02-23 16:27:57 -03:00
Moon 5c99233905 Minor fixes
* Removed extra double quotation from the image tag

* Fixed typo in the init() method

* Moved init() method body into the constructor -- a separate method is not necessary
2021-02-22 20:33:02 -08:00