Commit Graph

86 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
Mike Jolley f5e9875548 Allows stock status to be considered for availability and stock status on frontend.
Refactors code which make it so stock status was actually ignored if on
backorder. Fixes #10834

@claudiosmweb
2016-05-03 15:10:31 +01:00
Mike Jolley 39e8d981a0 Support order items when calling get_permalink on a variation. 2016-04-21 10:36:46 +01:00
Mike Jolley 7be2b129b6 Removed bulk actions from order items panel
Reduce/increase order item stock is less important these days do to
automatic stock reduction (when status changes) and because when you
refund items you can restock items via checkbox. Manual stock changes
can be performed by editing products.

Decreases complexity of order items box.
2016-03-21 14:58:14 +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
Max Rice 3befe1426f Introduce WC_Product::get_id() method 2015-12-04 15:17:25 -05:00
Claudio Sanches ee30b5b308 Fixed php docs standards 2015-11-03 11:31:20 -02:00
Claudio Sanches 1ea5b8433f Escape normalized for the woocommerce_variation_option_name filter 2015-10-18 10:42:44 -06:00
Mike Jolley 2816260388 Merge pull request #8807 from franticpsyx/get_formatted_variation_attributes
get_formatted_name() produces cryptic output for variations
2015-10-01 18:54:46 +02:00
Aurélien PIERRE aead6f1e87 add shortcodes support in variation description 2015-09-21 19:34:06 -04:00
roykho f5f61da4e9 fixes a case were there are orphaned variations and trying to call the parent that doesn't exist 2015-09-16 08:49:18 -07:00
Mike Jolley 14b0c20bf2 Ensure variable stock status is based only on variations 2015-08-24 15:03:44 +01:00
Nicola Mustone ae3f0aec51 encode variation data 2015-08-21 12:32:00 +02:00
Manos Psychogyiopoulos 46151c6757 ensure variation data is_array 2015-08-13 13:32:26 +03:00
Manos Psychogyiopoulos 97ab635e71 introduce get_formatted_variation_attributes 2015-08-13 13:12:24 +03:00
Mike Jolley 060fb16e2e Move Pre 2.4 handling for attributes - DRY
@claudiosmweb @franticpsyx
2015-07-28 16:20:51 +01:00
Mike Jolley 1b45bcde0b URL encode to preserve text attributes in permalinks 2015-07-28 10:37:24 +01:00
Mike Jolley 7c9cae830a Populate variation_data with valid attributes only
@claudiosmweb
2015-07-27 17:48:30 +01:00
Mike Jolley f42fa85eab Variation tax status should always come from parent 2015-07-15 19:12:12 +01:00
Mike Jolley 65f19d5ca7 Ajax variation handling
If there are more variations than the threshold allows (set to 20
currently) this loads the matching variation via ajax instead of inline
in the HTML. #8477
2015-07-09 15:56:20 +01:00
Mike Jolley 622b11ae9f Add version check to prevent pre-2.4 logic kicking in when not needed
@claudiosmweb
2015-06-16 15:10:53 +01:00
Mike Jolley 12396f4296 Attempted bw compat by comparing sanitised text to real text 2015-06-11 15:42:18 +01:00
Mike Jolley 89f7e15052 Save full version of text based attributes when dealing with variations 2015-06-11 14:43:02 +01:00
Mike Jolley aaaef5bfcf [2.3] Incorrect wc_product_total_stock_ transient
Closes #8337
2015-06-10 18:28:34 +01:00
Ben Bidner 7d8db595f2 Fixes an (admin) SQLi when setting stock levels for product variations 2015-06-01 12:58:38 +01:00
roykho 54b0a0ca54 changed dynamic variation description to allow limited HTML and some sanitized tweaks 2015-05-28 14:31:45 -07:00
roykho b812b2fd94 add dynamic variation description feature 2015-05-14 10:56:26 -07:00
Manos Psychogyiopoulos 4b04701cc8 add display_prices in variation data
The commit introduces 3 changes:
1. It adds 2 extra fields to the available_variations array,
display_price and display_regular_price, to be used by extensions in
cases like
https://github.com/woothemes/woocommerce-product-addons/issues/19
2. Introduces a get_display_price() function in WC_Product to retrieve
product prices incl or excl tax relative to the
woocommerce_tax_display_shop setting.
3. Fixes a minor issue where passing a 0 price to
get_price_including_tax() or get_price_excluding_tax() results in a
wrong output.
2014-12-03 11:28:04 +02:00
Mike Jolley 3415b5d7c0 In the cart, add variation selected data to the permalink.
Closes #6060
2014-11-27 15:04:24 +00:00
Manos Psychogyiopoulos 0b275de06a Issue 5661: filter params 2014-11-19 19:46:05 +02:00
Kathy Darling 3d4a534e6a rename method to has_all_attributes_set 2014-10-17 17:24:04 +02:00
Kathy Darling 0304778f18 add variation class method is_all_defined() which tests if all the attributes are set 2014-10-15 09:11:41 +02:00
Mike Jolley 58904fcf83 Removed deprecated get_product() calls 2014-10-07 11:09:25 +01:00
Mike Jolley a8d5ca561d Merge pull request #6405 from tamarazuk/master
[#6337] Return variation meta if it exists
2014-10-02 12:42:45 +01:00
James Koster 63f45a8720 variation visibility, based on #6182. #5661 2014-09-26 17:22:43 +01:00
Tamara Zuk c5374201cb [#6337] Return variation meta if it exists
includes some code standards cleanup
2014-09-26 06:45:15 -04:00
shivapoudel 1f4db18e7f Absolute path fix for class-wc-product-variation.php 2014-09-21 00:43:30 +05:45
Barry Kooij 06103c6cd2 Fixed a varation product width inheritance bug. 2014-09-17 11:00:14 +02:00
Barry Kooij 72c6f262f1 Width should be allowed to be set in a Product Variation. 2014-09-16 14:02:26 +02:00
Barry Kooij b1daae5d0d Setup variable to prevent a notice if no variable data is set. 2014-09-16 13:21:09 +02:00
Mike Jolley c4ef86d44e scrutinizer patches 2014-09-08 00:37:55 +01:00
thenbrent 1a15cb03bd Allow WC_Product_Variation children to extend meta
When SHA: 50a0577b81 introduced `$variation_level_meta_data` and
`$variation_inherited_meta_data`, it set their access to `private`.
Child classes of `WC_Product_Variation` should be able to extend these
properties to allow them to take advantage of the parent's `__isset()`
and `__get()` methods.

Related to #6065
2014-08-28 11:30:11 -07:00
Mike Jolley 50a0577b81 Separate inherited meta data from variation level meta data to stop bubbling up.
Fixes #6065
2014-08-28 15:38:51 +01:00
Mike Jolley c51fac23e0 Availability with backorders not requiring notification. 2014-08-15 15:29:14 +01:00
Mike Jolley 3f53512c7f Fix up visibility of stock options, drop downs, and get_availability() when parent is managing stock for a variation.
Fixes #6017
2014-08-13 15:03:30 +01:00
claudiosmweb ae66ba4553 fixed variation tax_class and backorders
@mikejolley
2014-08-04 16:05:15 -03:00
claudiosmweb b67a1e6b0e stopped endless loop when saving variable product that manages stock
@mikejolley
2014-08-04 15:31:40 -03:00
Mike Jolley e02d94d305 Fix stock logic in 2.2 for variations with parents which manage stock
Closes #5957 @claudiosmweb can you review this change?
2014-08-04 10:51:54 +01:00
Mike Jolley 2cb66fe4b9 Prevent empty attributes in permalinks
Closes #5714
2014-07-30 10:22:15 +01:00
Mike Jolley 50a4c5bd23 Merge branch 'variation-stock-management'
Conflicts:
	includes/class-wc-product-variation.php
2014-06-27 11:15:42 +01:00