Commit Graph

20 Commits

Author SHA1 Message Date
Mike Jolley d42d7c13b6 Prevent variations being created/returned without parents
Nasty bug discovered by @RiaanKnoetze where it would get a variation
without parent, and due to the return, it wouldn’t be ‘seen’ as a
variation, therefore creating fatal errors when props are called.

To prevent this, lets allow product constructors to throw exceptions.
If they do, the factory class will catch them and return false instead
of an invalid product object.

@claudiosmweb Thoughts on this one before merge?
2016-05-13 19:06:16 +01:00
Matt Isenhower 7561f772d9 Make wc_get_product() return false if the specified post is not a product 2016-03-31 17:51:01 -07:00
Mike Jolley 114cbdd450 Autoload tweaks 2016-02-09 23:26:22 +00: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
Nicola Mustone c9da4f928a check if ABSPATH is defined 2015-11-06 10:22:19 +01:00
Claudio Sanches 5893875b0c Removed period for file headers 2015-11-03 11:53:50 -02:00
Claudio Sanches ee30b5b308 Fixed php docs standards 2015-11-03 11:31:20 -02:00
Ben Bidner f3e3b5c209 add `$args` arguments to `WC_Product_Factory->get_product_class()` to allow `$product_type` to be overwritten by `$args['product_type']` 2015-06-01 12:54:18 +01:00
Nicola Mustone d2af01df5b scrutinizer suggested tweaks 2015-03-27 16:15:40 +01:00
Mike Jolley 66e13a9927 Filter object 2015-02-26 11:59:50 +00:00
Mike Jolley ffd512a55e Why assign $the_product to itself? 2015-02-03 16:14:56 +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
Mike Jolley fef41c149c @uses WP_POST 2015-01-15 15:03:12 +00:00
Mike Jolley 206496b584 Split up WC_Product_Factory methods 2014-11-26 00:03:00 +00:00
Mike Jolley a076c5a69d get_product in product factory should return passed in object if its a product already
Fixes #6726
2014-11-11 16:24:22 +00:00
shivapoudel a3d4d87ca5 Remove newline 2014-09-21 00:41:34 +05:45
Nick Price e69f3d6b54 Minor fix to stop warnings in HHVM
HHVM is a bit weird and will throw these warnings otherwise:

HipHop Warning: Cannot access property on non-object in /home/_____/public_html/wp-content/plugins/woocommerce/classes/class-wc-product-factory.php on line 36
HipHop Warning: Cannot access property on non-object in /home/_____/public_html/wp-content/plugins/woocommerce/classes/class-wc-product-factory.php on line 37
2014-01-17 14:28:15 -06:00
Mike Jolley 0ff59bcd5b remove deprecated function. Closes #3582. 2013-08-13 13:02:20 +01:00
jprieton 59d43a25f7 Update proposal hint on documentation of function get_product()
Update proposal hint on documentation of function `WC_Product_Factory::get_product()` from `void` to an generic `WC_Product`
2013-07-01 17:18:07 -04:30
Mike Jolley c75ea04c1c classes -> includes 2013-06-11 14:25:30 +01:00