Commit Graph

47 Commits

Author SHA1 Message Date
Mike Jolley 599a2ad296 Product CRUD improvements (#12359)
* args is not used any more - remove todo

* Added test for attributes

* wc_get_price_excluding_tax usage

* parent usage

* Fix rating counts

* Test fixes

* Cleanup after tests

* Make sure status transition code runs even during API calls, not just in admin.

* Default visibility

* Fix attribute setting in API

* Use get name instead of get title

* variation id usage

* Improved cross sell templates

* variation_data

* Grouped product sync

* Notices

* Sync is not needed in API

* Delete

* Rename interfaces

* Update counts in data store
2016-11-16 12:17:00 +00:00
Justin Shreve 90e43d97de [Product CRUD] Product Datastore (#12317)
* Fix up tests in the product/* folder.

* Handle data store updates for grouped, variable, external, simple, and general data store updates for products.

* Variations & variable changes.

* Update -functions.php calls to use data store.

* Add an interface for the public product data store methods.

* Finished product factory tests

* Correctly delete in the api, fix up some comments, and implement an interface for the public variable methods.

* Fix up delete in all versions of the api

* Handle feedback

* Match protected decloration to parent
2016-11-11 14:31:15 +00:00
Mike Jolley 09ea4ba91f [Product CRUD] Variable, variation, notices, and stock handling (#12277)
* No longer needed

* Remove old todos

* Use getters in admin list

* Related and upsells update for CRUD

* Fix notice in gallery

* Variable fixes and todos

* Context

* Price sync

* Revert variation attributes change

* Return parent data in view context

* Defer term counting

* wc_find_matching_product_variation

* Stock manage tweaks

* Stock fixes

* Correct id

* correct id

* Better sync

* Data logic setter fix

* feedback
2016-11-09 16:10:37 +00:00
Mike Jolley 31e5882bb8 [Product CRUD] Getter setter proxy methods (#12236)
* Started on variation changes

* Stock functions

* Variation class

* Bulk change ->id to get_id() to fix variation form display

* Missing status

* Fix add to cart

* Start on stored data save

* save variation

* Save_variations

* Variation edit panel

* Save variations code works.

* Remove stored data code and fix save

* Improve legacy class

* wc_bool_to_string

* prepare_set_attributes

* Use wc_get_products

* More feedback fixes

* get_prop implementation in abstract and data classes

* Implement set_prop

* Change handling

* Array key exists

* set_object_read
2016-11-09 16:07:29 +00:00
Justin Shreve 9072b1da43 Handle PR feedback 2016-11-09 16:05:50 +00:00
Justin Shreve e551a846b8 Implement CRUD in the legacy REST API 2016-11-09 16:05:50 +00:00
Mike Jolley 7dd64662f0 [Product CRUD] Grouped Handling (#12151)
* Handle grouped product saving

* Update routine
2016-11-09 15:41:48 +00:00
Justin Shreve 5b09c9f063 [Product CRUD] Variable (#12146)
* [Product CRUD] Variable Products

* Handle PR feedback.
2016-11-09 15:41:25 +00:00
Mike Jolley 06fb79ec03 Spacing in query 2016-11-09 15:39:18 +00:00
Mike Jolley f58829a316 Grouped product class 2016-11-09 15:38:44 +00:00
Mike Jolley 4c0cc54f79 Hardcode the get_type per product class 2016-11-09 15:37:51 +00:00
Aristeides Stathopoulos 734f284fa4 WordPress.PHP.YodaConditions.NotYoda 2016-09-08 01:32:24 +03:00
Aristeides Stathopoulos f2730eea02 WordPress.WhiteSpace.ControlStructureSpacing.BlankLineAfterEnd 2016-08-27 08:57:05 +03:00
Claudio Sanches 7d9d091767 Fixed mixed tabs and spaces 2016-07-11 16:56:35 +02:00
Joshua Dwire 2c42a81089 Include child prices in grouped_price_html filter 2016-07-05 09:44:26 -04:00
Mike Jolley c7783bca24 Fix grouped product range display
Closes #11225
2016-06-23 12:16:38 +01:00
Mike Jolley 60cd28e802 Fix range for grouped products
Fixes #10359
2016-02-16 13:15:49 +00:00
Eivin Landa db39c223b0 Added code to use the get_price method for child products. fixes #10217 2016-01-29 14:58:12 +01:00
Fredrik Forsmo f1920cb882 Improve docblock comments in various WC_Product classes
* Added comments to methods that was `method function`
2016-01-06 16:15:00 +01:00
Mike Jolley b59ec6de76 Move var definition to abstract 2015-11-14 16:39:53 +00:00
Mike Jolley 3a096b3b64 Remove transient from get_total_stock and combine into abstract
Grouped and variable methods were identical. Caching benefit comes from
get_children
2015-11-14 16:34:47 +00:00
Claudio Sanches ee30b5b308 Fixed php docs standards 2015-11-03 11:31:20 -02:00
Mike Jolley 79010b634f Cast grouped product children to int
Avoids invalid or empty data and fixes #9416
2015-10-23 12:52:52 +01:00
Mike Jolley 5f8a5bcb63 We don't need get_transient_version for children transients because other products do not affect this. 2015-07-09 16:02:26 +01:00
Mike Jolley 68974655d6 Tweak visible child product query and cache 2015-06-08 13:18:23 +01:00
Tamara Zuk 4e36efe3af Missing argument on `woocommerce_product_is_on_sale` grouped product filter
Avoids a “missing argument” warning
2015-03-09 17:28:37 -04:00
Mike Jolley d9455994c8 Use 30 days instead of year for transients to avoid bugs in memcache plugins.
Closes #7520
2015-02-24 12:02:56 +00:00
Mike Jolley 74abdf27c9 Cast to array 2015-02-03 15:06:08 +00:00
Scrutinizer Auto-Fixer 19f660171e Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
2015-01-23 14:37:20 +00:00
Diego Zanella dbeeb6d7b5 Fixed bug in is_on_sale() method 2015-01-22 16:05:59 +00:00
Diego Zanella 04bf4fecd2 Added/altered product filters to make them work consistently
* WC_Product_Variable::get_variation_regular_price() now always calls the "woocommerce_get_variation_regular_price" filter (removed early exit).
* WC_Product_Variable::get_variation_sale_price() now always calls the "woocommerce_get_variation_sale_price" filter (removed early exit).
* WC_Product_Variable::is_on_sale() now calls the "woocommerce_product_is_on_sale" filter.
* WC_Product_Grouped::is_on_sale() now calls the "woocommerce_product_is_on_sale" filter.
2015-01-22 13:02:43 +00:00
Mike Jolley 7ef8f4d156 Invalidate unknown product transients Closes #6815 2014-12-30 15:27:08 +00:00
Bryce 7670a08ff4 Add filter 'woocommerce_grouped_children_args'
Allows people to filter the grouped product children, like changing the
order that the children products are displayed in, etc.
2014-12-29 13:13:26 +07:00
Mike Jolley 58904fcf83 Removed deprecated get_product() calls 2014-10-07 11:09:25 +01:00
shivapoudel 3fc03a184d Absolute path fix for class-wc-product-grouped.php 2014-09-21 00:42:09 +05:45
Mike Jolley 7f825a98ce Tweak get_children to look for empty transient 2014-08-12 12:06:18 +01:00
Mike Jolley 0f6f04e017 Added wc_stock_amount() core function and replaced intval
#4612
2014-06-25 11:25:28 +01:00
Patrick Rauland abd8a36ddc fixing typo in product classes 2014-03-21 16:41:32 -05:00
Coen Jacobs 3617316357 Updated expiry times for transients 2014-03-12 12:58:41 +01:00
Coen Jacobs 03163c54b0 set_transient calls should have expiration to prevent autoloading 2014-03-07 09:29:01 +01:00
splashingpixels 8a6848bdd3 syntax error missing semicolon on product grouped class 2013-12-10 09:38:36 -08:00
Mike Jolley 9e5c0fbf67 Get rid of "FROM" - display a price range, localisable. Closes #4222 2013-12-04 12:08:14 +00:00
Coen Jacobs c1a439eb99 Formatting functions woocommerce to wc refactor 2013-11-25 14:34:21 +01:00
Mike Jolley 6fd823dabd get_children should get published products only for grouped products. Closes #3880.
@coenjacobs This should go in .15
2013-10-11 13:25:34 +01:00
Mike Jolley ef49977905 add_to_cart_url add_to_cart_text and single_add_to_cart_text class methods allowing greater control with custom classes.
Closes #3484 and Closes #3143. Pinging @thenbrent as the handler was
originally his idea and I've killed it.

@helgatheviking In 2.1, add to cart URLs will only be used in loops, so
conditonal logic should no longer be neccessary. Single templates post
to themselves without the need for the URL.
2013-09-25 12:35:06 +01:00
Mike Jolley b93df4e706 Excl and incl. display options for prices, and suffix to add additonal info and prices. Closes #1506. 2013-09-19 16:31:54 +01:00
Mike Jolley c75ea04c1c classes -> includes 2013-06-11 14:25:30 +01:00