Mike Jolley
6027b355ca
Further get_variation_prices tweaks
...
For 2.5, I’ve adjusted the caching to store 1 transient per variable
product. The cache key etc is still needed, but its stored within a
single transient instead of several.
This should prevent exponential growth of transient data for users.
Thoughts?
@daigo75 @franticpsyx @claudiosmweb
2015-10-09 12:49:39 +01:00
Mike Jolley
84f83e0bf4
Fix return value @roykho
2015-10-05 14:39:08 +01:00
roykho
5ba6ff1dac
fix variation image flicker issue when default variations are set closes #7904
2015-10-02 03:45:11 +02:00
Diego Zanella
5da98ce782
Fixed loading of variation prices
...
The original method loaded the prices once, then stored them in a property of the product instance. Any subsequent calls to WC_Product_Variable::get_variation_prices() would get the stored prices, regardless of the value of the $display argument.
2015-09-25 16:11:41 +01:00
Mike Jolley
3dbe9ccd95
Better fallback for ajax variations in case sync_attributes has ran
2015-09-14 16:50:58 +01:00
Mike Jolley
fc78f85bc6
Merge branch 'pr/9034'
2015-09-14 15:56:38 +01:00
Mike Jolley
3a1bcd8e7d
Store prices in class to prevent running get_variation_prices multiple times
2015-09-14 15:09:57 +01:00
Mike Jolley
2d90e1c6c6
Ensure _product_version checks act the same regardless of the attributes being checked
2015-09-14 12:12:05 +01:00
Mike Jolley
8ec5986d48
Tweak hash logic
2015-09-09 22:29:54 +01:00
Manos Psychogyiopoulos
e3dad9106f
elseif
2015-09-07 19:17:33 +03:00
Manos Psychogyiopoulos
d9d11974fe
introduce context in transient with price filters
2015-09-07 19:13:41 +03:00
Manos Psychogyiopoulos
68e24c8f8a
no filters allowed when generating variable product price transients
2015-09-03 19:04:31 +03:00
Mike Jolley
28da8a40d8
Tweak wc_var_prices naming to allow them to be flushed on save
2015-08-26 12:28:04 +01:00
Mike Jolley
ae21b511f0
Support 0 value attributes
2015-08-24 13:32:20 +01:00
Mike Jolley
ae207466d4
Ajax variation < 2.4 attribute name handling.
2015-08-23 21:47:04 +01:00
Mike Jolley
dc1798f942
woocommerce_variable_children_args hook.
2015-08-13 23:35:41 +01:00
Diego Zanella
5b29d23daf
Added filter for Variable Products, as suggested in #8820
...
* The new filter allows to alter the query used to retrieve children of a variable product.
2015-08-13 22:42:16 +01:00
Mike Jolley
56b6c0ab9c
Link to full image
...
Closes #8809
2015-08-13 16:55:32 +01:00
Mike Jolley
a52619c344
Ajax variation handling when 'any' attribute is set.
2015-08-13 13:57:26 +01:00
Mike Jolley
61f7dd428e
use shop_single instead of full image size for variations.
...
Closes #8764
2015-08-11 12:54:26 +01:00
Mike Jolley
42e99286c7
If all variations are out of stock, maintain pricing.
2015-08-11 10:33:47 +01:00
Mike Jolley
77b2316d80
Merge pull request #8754 from JeroenSormani/is_on_sale
...
FIx is_on_sale bug on variable products
2015-08-10 15:43:35 +01:00
JeroenSormani
95609928ba
FIx is_on_sale bug on variable products
2015-08-10 16:36:40 +02:00
Mike Jolley
7363c85a2c
Get filtered variation prices #8753
2015-08-10 15:34:10 +01:00
Mike Jolley
060fb16e2e
Move Pre 2.4 handling for attributes - DRY
...
@claudiosmweb @franticpsyx
2015-07-28 16:20:51 +01:00
Mike Jolley
6626c68175
When syncing OLD products, update the attributes to 2.4 standard
2015-07-28 15:13:25 +01:00
Mike Jolley
794af1c013
When the stock level is changed via update_post_meta ensure the stock_status is kept in sync
...
Closes #8605
2015-07-27 19:04:08 +01:00
Mike Jolley
9a7893ba23
Moved variation dropdowns logic into wc_dropdown_variation_attribute_options()
2015-07-27 16:42:22 +01:00
Mike Jolley
dcd273d343
Rename transient - 45 chars is max legnth
2015-07-27 10:57:14 +01:00
Claudio Sanches
9e41552342
Removed all "@return void"
2015-07-16 16:55:48 -03:00
Claudio Sanches
8d2a98eab1
Improved some docblocks
2015-07-16 16:29:01 -03:00
Mike Jolley
30b01ff9b6
Add filter to force price display
2015-07-09 16:15:05 +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
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
Mike Jolley
5771969c2c
Prevent notices in get_children
2015-06-09 10:32:40 +01:00
Mike Jolley
68974655d6
Tweak visible child product query and cache
2015-06-08 13:18:23 +01:00
roykho
b812b2fd94
add dynamic variation description feature
2015-05-14 10:56:26 -07:00
Mike Jolley
906940791a
Merge branch 'variation-prices-sync'
2015-05-01 15:01:14 +01:00
Illimar Tambek
3e9c56a5ca
Pass current variation to woocommerce_hide_invisible_variations filter
2015-04-29 12:16:58 +03:00
Nicola Mustone
d2af01df5b
scrutinizer suggested tweaks
2015-03-27 16:15:40 +01:00
Mike Jolley
302fca886c
ID needs to be part of transient
2015-03-25 16:27:11 +00:00
Mike Jolley
8cb2ca86d7
Store variation ID in transient
2015-03-25 16:23:19 +00:00
Mike Jolley
c76a08aad2
woocommerce_variation_prices filter
2015-03-25 15:48:51 +00:00
Mike Jolley
01c13a52cd
Fix price/sale price listings
2015-03-25 15:23:28 +00:00
Mike Jolley
99fcb77262
woocommerce_get_variation_prices_hash array
2015-03-25 14:52:33 +00:00
Mike Jolley
0ab0a12156
_has_multiple_variation_tax_rates no longer needed
2015-03-25 13:37:11 +00:00
Mike Jolley
9f50d41b97
New approach to getting min/max variation prices using transients
...
New method will get all prices and store in array format. Cached based
on user location (tax) and product transient hash.
Fixes #6504
2015-03-25 13:35:49 +00: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
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
186f223d92
Fix indents in #7174
2015-01-23 11:17:27 +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
36841589cf
Merge pull request #7123 from splashingpixels/variation-price-issue
...
correctly display FREE if all prices are zero ref #6929
2015-01-16 16:14:02 +00:00
splashingpixels
eee5d16844
changed comparison type to non strict in case a string is passed
2015-01-16 06:52:49 -08:00
splashingpixels
187f6729e9
correctly display FREE if all prices are zero ref #6929
2015-01-15 20:19:33 -08:00
Brent Shepherd
ed0593fc4a
Set variable product virtual/downloadable property
...
Based on whether all children are virtual/downloadable.
Fixes #7072 .
2015-01-15 17:06:09 -08:00
Mike Jolley
7ef8f4d156
Invalidate unknown product transients Closes #6815
2014-12-30 15:27:08 +00:00
Mike Jolley
4a57cd3f7d
'Free' for variable products without a range of prices. Closes #6929
2014-12-30 15:13:34 +00:00
Spencer Hill
d8c8d37fd6
Using post_status of 'any' causes a conflict with the WP Invoice Plugin by Usability Dynamics resulting in the Select Box for Variable Subscriptions - when the WooCommerce Variable Subscriptons Plugin is installed and activated - not functioning and returning an error to the user on the front end. Since it's filtering out the Trash status, and others, anyway when being displayed on the front end we found that setting the post_status to publish resolved the issue and doesn't appear to have adverse affects elsewhere.
2014-12-19 13:21:15 -08: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
c2ce3b0d88
Tidy
2014-10-14 14:25:53 +01:00
Mike Jolley
26186f815a
Fix potential error if variation doesn't exist
2014-10-09 11:20:46 +01:00
Mike Jolley
58904fcf83
Removed deprecated get_product() calls
2014-10-07 11:09:25 +01:00
Manos Psychogyiopoulos
0966519adc
woocommerce_get_children filter from 2.2
2014-10-01 19:42:20 +03:00
James Koster
63f45a8720
variation visibility, based on #6182 . #5661
2014-09-26 17:22:43 +01:00
Mike Jolley
744549ad13
[2.2] Use variation get_stock_quantity() for max_qty
...
Fixes #6339
2014-09-24 11:15:56 +01:00
shivapoudel
26d4abb88c
Absolute path fix for class-wc-product-variable.php
2014-09-21 00:42:58 +05:45
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
Mike Jolley
b1c76adb56
Send product object to woocommerce_stock_html filter. Closes #6016
2014-08-13 11:30:47 +01:00
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
Mike Jolley
21d37e86c2
Handle stock for self and children, as well as syncing status with the children
2014-06-24 13:03:25 +01:00
Mike Jolley
b86b4c91c6
Simplify get_children and use stock status rather than stock level
2014-06-20 10:50:31 +01:00
Mike Jolley
3df6a71b96
Removed some transient clears where unnecessary
2014-06-19 12:25:10 +01:00
claudiosmweb
05a6914ebc
fixed WC_Product_Variable::set_stock() compatibility with WC_Product::set_stock()
2014-05-10 17:45:14 -03:00
Tamara Zuk
7ba3089909
Backorders at variation level
...
Added a new select metabox for variations allowing users to control
backorders at the variation level.
Might need more testing.
ref: #5351
2014-04-21 21:13:13 -04:00
Mike Jolley
51482579d1
sync min and max prices for regular and sale prices so prices are displayed correctly when sale price is lower than a regular price of another variation
2014-03-19 10:51:07 +00:00
Mike Jolley
7f7dae0629
get_children visible only arg to hide out of stock items. Moved logic.
2014-03-19 10:06:13 +00:00
Mike Jolley
b321d6297b
Use is_purchasable to determine if a variation cart button is needed, and potentially show empty_price_html Closes #5137
2014-03-17 12:12:10 +00:00
Mike Jolley
7f417c0e8e
Fix sale flash for out of stock sale items Closes #5119
2014-03-14 13:41:25 +00: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
Mike Jolley
ba466b3de9
Fix variation price display by checking if a variation is actually stock managed before comparing to stock amount Closes #5059
2014-03-06 12:07:28 +00:00
Mike Jolley
e557ff5aec
Use woocommerce_notify_no_stock_amount not 0, Closes #5035
2014-03-04 14:46:17 +00:00
Mike Jolley
decfca94a4
Updated sync logic to exclude hidden and out of stock variations from the price display #5035
2014-03-04 14:44:24 +00:00
Mike Jolley
a54223f910
Tweak message #4335
2014-01-08 13:38:34 +00:00
Kathy Darling
6544d6b8f9
add $min_or_max and $display params to variation pricing functions
2013-12-07 10:11:23 +01:00
Mike Jolley
00ff09e3a2
sort sale price
2013-12-04 12:45:23 +00:00
Mike Jolley
9e5c0fbf67
Get rid of "FROM" - display a price range, localisable. Closes #4222
2013-12-04 12:08:14 +00:00
Mike Jolley
1ec8b82f69
Prevent error if variation doesn't exist.
2013-12-03 14:54:13 +00:00
Coen Jacobs
c1a439eb99
Formatting functions woocommerce to wc refactor
2013-11-25 14:34:21 +01:00
Mike Jolley
6ea8cad430
Related display fixes for attributes #4123
2013-11-18 14:11:40 +00:00
Mike Jolley
97bdb1555f
Sync only when needed
2013-11-08 16:02:03 +00:00
Mike Jolley
98d247eb76
Rather than storing prices themselves, store the ID's of variations during price sync - output prices using variation tax class Closes #4032
2013-11-08 15:53:57 +00:00
Kathy Darling
b444b42275
pass $children variable (variations) to the woocommerce_variable_product_sync hook
2013-10-31 09:17:00 +01:00
Mike Jolley
e143d344e5
Constants
2013-10-24 19:36:22 +01:00
Mike Jolley
cc397a89d5
variable_product_sync should reload prices. Closes #3889
2013-10-11 15:56:13 +01:00
Mike Jolley
ece95e25ce
When handling variations, priority from top to bottom - disabled variations still taking into consideration allow you to exclude certain combinations when using 'all' for variations with lower priority. Message displayed if a variation is unavailable.
...
@coenjacobs please review
2013-10-10 16:34:44 +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
de9bc28b43
Prevent variable products without variations from being posted and show error in admin. Closes #3763
2013-09-24 16:37:51 +01:00
Mike Jolley
9a98be6a15
WOOCOMMERCE_DELIMITER constant. Closes #3476 .
2013-09-24 12:24:26 +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
0405fabf69
Alt changes from .14
2013-09-04 17:22:35 +01:00
Mike Jolley
d021980c10
Rather than have hooks *everywhere* use a single set stock function in admin and on the frontend Closes #3593
2013-08-13 16:56:09 +01:00
Mike Jolley
57157db9bf
Function refactoring.
2013-08-09 17:11:21 +01:00
thenbrent
3ce6f3012d
Set default $product_id on variable_product_sync()
2013-08-01 17:54:24 -07:00
thenbrent
825587da6a
Backward compatible variable_product_sync()
...
Adds new static sync() method to WC_Product_Variable and restores
variable_product_sync() to its former, non-static glory. Also makes
the $product_id param optional on variable_product_sync() to avoid
breaking backward compatibility.
2013-08-01 17:35:54 -07:00
Mike Jolley
63b203955b
Fix syncing and make variable_product_sync static for admin use. Closes #3450
2013-07-30 12:15:09 +01:00
Kathy Darling
f743018ea1
add action woocommerce_variable_product_sync to variable sync
2013-07-26 11:59:34 -04:00
Mike Jolley
805a9e617c
Use get_price and introduce get_regular and get_sale_price methods. Closes #3427
2013-07-23 11:29:04 +01:00
Mike Jolley
f8f3f8a660
Fix sale expiration for variations. Closes #3321 .
...
@coenjacobs might be useful for .13
2013-06-28 09:58:07 +01:00
Mike Jolley
2a6bae4e0a
Change is_visible for variations to make method calls cleaner.
2013-06-14 12:21:38 +01:00
Mike Jolley
c75ea04c1c
classes -> includes
2013-06-11 14:25:30 +01:00