Commit Graph

17916 Commits

Author SHA1 Message Date
Mike Jolley b9d60965d2 Conflicts 2016-11-09 16:53:23 +00:00
Mike Jolley 36d8e3b401 Prevent notices 2016-11-09 16:20:34 +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
Lee Willis 07eef044c2 Use get_the_terms() instead of wp_get_post_terms()
wp_get_post_terms() is a wrapper around wp_get_object_terms() which does not
use the object cache, and generates a database query every time it is used.

get_the_terms() however can use data from the object cache if present.
2016-11-09 16:07:29 +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 5f4dbdb733 [Product CRUD] Variations - setters, getters and admin. (#12228)
* 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

* Feedback fixes
2016-11-09 16:05:49 +00:00
Justin Shreve cee91cccbf Remove the download type input from the product data metabox for downloadable products. (#12221) 2016-11-09 15:47:23 +00:00
Justin Shreve a8742a2bcc Add a wc_get_products wrapper. 2016-11-09 15:47:23 +00:00
Justin Shreve 1985620f33 Fix comparison for is_on_sale and remove download_type from WC_Product. 2016-11-09 15:47:23 +00:00
Justin Shreve 37c8e62fcf Fix final failing tests and implementing setters/getters and attributes functionality. 2016-11-09 15:47:23 +00:00
Justin Shreve e31a75d584 Additional API updates/fixes. Added some todos 2016-11-09 15:47:23 +00:00
Justin Shreve bcae6fb1d6 REST API CRUD Updates 2016-11-09 15:47:23 +00:00
Mike Jolley 038104c8a8 [Product CRUD] Product crud admin use getters (#12196)
* Initial props

* Work on admin saving

* Set/get attributes

* Atom was moaning about this before but no longer.

* Update get_shipping_class

* WC_Product_Attribute

* Use getter in admin panel

* Fix attribute saving

* Move settings into new files

* Refactor panels and use getters

* Use getters for variation panel

* Revert save variation changes for now

* Add todos

* Fix downloads
2016-11-09 15:44:02 +00:00
Mike Jolley af32b3ea91 Product crud admin save routine (#12174)
* Initial props

* Work on admin saving

* Set/get attributes

* Atom was moaning about this before but no longer.

* Update get_shipping_class

* WC_Product_Attribute

* Use getter in admin panel

* Fix attribute saving

* Spacing

* Fix comment

* wc_implode_text_attributes helper function
2016-11-09 15:43:20 +00:00
Mike Jolley 611ac8b651 [Product CRUD] Product crud terms (#12149)
* Category and tag id handling

* Replace template functions

* Remove todo

* Handle default name in save function
2016-11-09 15:41:48 +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 f57601d755 Price handling 2016-11-09 15:41:08 +00:00
Mike Jolley 67c01ff101 wc_get_price_to_display 2016-11-09 15:41:08 +00:00
Mike Jolley 38ab3d63f6 get_price_including_tax/excluding_tax functions 2016-11-09 15:40:52 +00:00
Mike Jolley 9e23b0d2cc missing $this 2016-11-09 15:40:52 +00:00
Mike Jolley cf8fba5900 Put back review functions (still todo) 2016-11-09 15:40:51 +00:00
Mike Jolley a85ad09e7e Rename method 2016-11-09 15:40:51 +00:00
Mike Jolley e5cbb91472 Tidy/add todos 2016-11-09 15:40:51 +00:00
Mike Jolley 731df74bad Availability html 2016-11-09 15:40:38 +00:00
Mike Jolley bc220c3b73 Moving and refactoring methods 2016-11-09 15:39:39 +00:00
Mike Jolley 06fb79ec03 Spacing in query 2016-11-09 15:39:18 +00:00
Mike Jolley bf78e8bcd4 Use get_upsell_ids 2016-11-09 15:39:18 +00:00
Mike Jolley 3e6bee0712 Move children to meta and update test 2016-11-09 15:39:18 +00:00
Mike Jolley 5fc0142ba0 Tests 2016-11-09 15:39:18 +00:00
Mike Jolley f58829a316 Grouped product class 2016-11-09 15:38:44 +00:00
Justin Shreve 92e016f68e _virtual meta should be 'no', not taxable, in product unit test helper 2016-11-09 15:38:44 +00:00
Justin Shreve 19949d369d External Product CRUD 2016-11-09 15:38:44 +00:00
Mike Jolley 745c31176d Made abstract function useful 2016-11-09 15:38:44 +00:00
Justin Shreve 79f2d0eb8c Handle PR feedback: Remove duplicate regular_price update, allow changing of post status for products, remove deprecation for get_title since we might still offer it as a function 2016-11-09 15:38:44 +00:00
Mike Jolley f733f1fcba Bump template version 2016-11-09 15:38:44 +00:00
Justin Shreve 432d736520 Clean up the abstract product class a bit, deprecate two functions we have renamed, make update & create work properly, and add some tests for it. 2016-11-09 15:38:44 +00:00
Mike Jolley ac9574e25e wc_get_product_term_ids instead of related wording and use in other places.
get_the_terms is used here and also handles caching, something
wp_get_post_terms does not.
2016-11-09 15:38:44 +00:00
Mike Jolley 68282e9661 Remove unneeded comments 2016-11-09 15:38:44 +00:00
Mike Jolley 34f579cfc4 Sanitize ids later 2016-11-09 15:38:27 +00:00
Claudio Sanches a5cf2922ee Use count() instead of sizeof() 2016-11-09 15:38:27 +00:00
Claudio Sanches 1c73ffb3f6 Fixed wrong variable in wc_get_related_terms 2016-11-09 15:38:27 +00:00
Claudio Sanches ee82a198da Get cached terms from wc_get_related_terms() 2016-11-09 15:38:27 +00:00
Claudio Sanches f5c42c60c8 Fixed coding standards and improved the docblocks 2016-11-09 15:38:27 +00:00
Mike Jolley fb8c54dcce No need to exclude ID 2016-11-09 15:38:27 +00:00
Mike Jolley 3b3a83df8e Add related product functions and deprecate those in class. 2016-11-09 15:38:27 +00:00
Mike Jolley b254ecf16d Missing var 2016-11-09 15:37:51 +00:00
Mike Jolley eb61503210 Initial look through getters and setters and abstract data 2016-11-09 15:37:51 +00:00