Commit Graph

68 Commits

Author SHA1 Message Date
Mike Jolley 6f693d4d1a Upgrade routine 2017-11-07 19:16:44 +00:00
Mike Jolley db4e630600 Replace thumbnail names 2017-11-07 18:48:51 +00:00
Gerhard Potgieter 8045596ed7 Add get_tax_class tests for WC_Product_Variation. Will ensure #17147 never happens again. 2017-10-12 14:46:28 +02:00
mitraval192 2ee59801c2 added secure link 2017-09-11 17:24:55 +05:30
Mike Jolley 1e9e6c461f Unit test for #16653 2017-08-31 11:42:19 +01:00
Mike Jolley 5e2ce54530 update tests 2017-08-07 17:19:19 +01:00
claudiulodro e1fad0d7eb Bring up to date with master 2017-07-28 14:27:19 -07:00
claudiulodro e335724c50 Finalize product query 2017-07-28 11:59:44 -07:00
claudiulodro b2e42fb55f Add visibility test 2017-07-27 08:57:44 -07:00
claudiulodro ec6d11bd67 Just needs visibility support and cleanup 2017-07-25 10:01:24 -07:00
claudiulodro cdbead8961 Clean up and tests 2017-07-24 15:05:23 -07:00
claudiulodro f66198c37d Initial working wc_get_products 2017-07-14 09:50:20 -07:00
claudiulodro 7be2c7dc55 More tests 2017-07-12 14:18:51 -07:00
claudiulodro 753979ec49 WC_Product_Query 2017-07-12 13:58:39 -07:00
Mike Jolley 022c528b3e Remove value renaming code 2017-07-12 15:18:05 +01:00
Mike Jolley 21300951f1 Fix tests due to generated names 2017-05-31 13:48:28 +01:00
Timon Davis af308da6b9 Fix bug #15103 where site operator cannot assign a variation with value of '0' as the default choice on the customer facing form.
The WC_Product::set_default_attributes function uses an array_filter (using the default callback for filtration)
to remove null and false values from the defaults array for a given product.  The issue here is that, in the above use case,
the array_filter will evaluate '0' as 0 and therefore as false.  Ultimately, array_filter then prevents the value from being
recorded, moving forward.

I've added a new filter callback to includes/wc-attribute-functions which will disregard all FALSE PHP equivalents except for
'0' (as a a string).  Also, I've updated the filter_array call in WC_Product::set_default_attributes so that it uses this new callback,
instead of the PHP default. Finally, I've added a phpunit test to assert that, when storing default variations / attributes on a product,
the false/true PHP synonyms are evaluating and storing like one would normally expect, with the exception that (string) '0'
evaluates as true in this special case.

This solution could potentially be broadened to facililate similar rules elsewhere, but the need raised in the bug is specific and
this is a specific solution.
2017-05-18 02:43:14 -07:00
Mike Jolley 24fe8db5eb Fix test 2017-05-08 19:14:33 +01:00
Claudio Sanches e208e35e33 Fixed coding standards in tests 2017-04-20 01:34:58 -03:00
Mike Jolley 5cfed7569c Simplify wc_is_attribute_in_product_name and change separator 2017-04-11 21:12:30 +01:00
Claudiu Lodromanean 715656921d wc_is_attribute_in_product_name 2017-04-10 14:35:16 -07:00
Claudiu Lodromanean 903b176b99 Attribute title tweaks 2017-04-10 13:16:58 -07:00
Claudio Sanches 42ca7bda3d Merge pull request #13989 from woocommerce/fix/product-meta-save_post
Fix saving meta when using `save_post`.
2017-04-06 14:38:16 -03:00
Justin Shreve 08537218b1 mend 2017-04-05 14:46:17 -07:00
Justin Shreve 15bf1da7d5 Call save_meta_data before wp_update_post for data stores that use it, and refresh meta cache after. 2017-04-05 14:39:41 -07:00
Claudiu Lodromanean 160d394070 Clean up test 2017-04-05 11:13:31 -07:00
Claudiu Lodromanean 5389844a1b Use parent data for sold_individually 2017-04-05 11:02:26 -07:00
Mike Jolley 9aabe1ff44 Revert "sync before test"
This reverts commit 45ab4733d5.
2017-03-28 14:32:56 +01:00
Mike Jolley 29d6f69a87 Revert "Clear parent transients on variation save"
This reverts commit 0694312cc9.
2017-03-28 14:32:52 +01:00
Mike Jolley 0694312cc9 Clear parent transients on variation save 2017-03-28 13:51:22 +01:00
Mike Jolley 45ab4733d5 sync before test 2017-03-28 12:51:32 +01:00
Claudiu Lodromanean 89128da8ba Fix child_has_dimensions 2017-03-27 11:52:03 -07:00
Claudio Sanches 59c2849736 Changed version 2.7 to 3.0 2017-03-15 13:36:53 -03:00
Mike Jolley d195aa6117 Fix unit tests 2017-03-13 20:35:04 +00:00
Claudio Sanches e97c21c1cc Fixed unit tests 2017-03-03 16:36:53 -03:00
Claudiu Lodromanean 07a021760a 13320 Delete cached object when updating stock 2017-02-23 12:56:34 -08:00
Mike Jolley 4b4597524b Added unit tests for wc_product_force_unique_sku 2017-02-23 10:05:46 +00:00
Claudiu Lodromanean 469210b02b Minor formatting cleanup 2017-02-13 11:47:28 -08:00
Claudiu Lodromanean a8b491b55b Handle product titles with no attributes 2017-02-13 11:45:25 -08:00
Claudiu Lodromanean b6b3f0c217 Modify product title logic 2017-02-10 10:19:05 -08:00
Claudiu Lodromanean a3f9207839 Add logic to variation title generation 2017-02-09 14:03:00 -08:00
Claudio Sanches 9e1e9783d2 Fixed unit tests in PHP 5.2 2017-02-09 11:33:18 -02:00
Claudiu Lodromanean 8ce5356943 13106 Dont round values in get_on_sale_products 2017-02-07 13:46:00 -08:00
Jon Surrell 4000ba6aea Use strict `assertTrue` and `assertFalse` over `assertEquals( true|false )` 2016-12-20 23:33:35 +01:00
Mike Jolley 47fbae4d26 Product Visibility Taxonomies (#12527)
* Convert visibility and featured to taxonomy

* Comment

* Add missing tax_queries

* Only check SKU after read.

* Added visibility term for outofstock products to speed those queries up al

* wc_bool_to_string
2016-12-08 10:56:45 +00:00
Mike Jolley 9087a45f29 Remove attribute_ prefix rather than add so that get_attributes has better return values, and don't show duplicate data in cart. 2016-11-24 14:20:48 +00:00
Claudio Sanches 1c9c26cda6 Fixed syntax for old versions of PHP 2016-11-23 12:56:08 -02:00
Claudio Sanches 8d19832937 Fixed coding standards 2016-11-22 23:47:13 -02:00
Mike Jolley cecfac6318 Product false test 2016-11-22 10:52:18 +00:00
Kevin Killingsworth 919fdb7aed Add a test for variation attributes on update
This adds a test to exhibit issue #12416, which strips attributes from a
variation upon update from the CRUD object.
2016-11-21 01:45:17 -06:00