Commit Graph

264 Commits

Author SHA1 Message Date
Mike Jolley 3b43a53546 Don't format stock if empty 2016-01-28 11:31:53 +00:00
Mike Jolley a550c77dba [2.5] Remove stock bw compat code which was preventing manage stock being disabled.
Fixes #10167
2016-01-25 18:17:28 +00:00
Mike Jolley 55c8f91c14 [2.5] Set has calculated shipping to true when setting country
Closes #10148
2016-01-25 10:16:39 +00:00
Mike Jolley a26af7b801 [2.5] Unset reload_checkout once processed.
Fixes #10134
2016-01-21 20:29:14 +00:00
Florian Ludwig 6074ea3355 Formatted variation stock with wc_stock_amount 2016-01-20 23:37:22 +01:00
Mike Jolley 6050b204fc Support qty display in cart messages
Closes #10114
2016-01-20 11:32:49 +00:00
Shiva Poudel a3889d1a17 Fix - Typo in docblock for 'gruoped' -> 'grouped' 2016-01-05 11:16:54 +05:45
Manos Psychogyiopoulos 5597a2750b orphaned variations cause "failed to load results" issue 2015-12-12 16:37:32 +02:00
Manos Psychogyiopoulos 2a6a26f800 allow searching from predefined set and introduce search limit
Makes it possible to search from a pre-defined set of known ids without returning all results, avoiding an excessive amount of product instantiations with large result sets.
2015-12-12 14:28:45 +02:00
Mike Jolley 5f940f7877 Send status headers to prevent 404s on wc-ajax
Fixes #9703
2015-11-30 12:10:31 +00:00
Mike Jolley 48f8665e2d Hide SQL errors during ajax requests
Avoids invalid JSON
2015-11-04 13:35:32 +00:00
Mike Jolley 7eb45ba16f Added wc_array_cartesian function to generate variations in a logical order.
Fixes #9515 @claudiosmweb
2015-11-04 12:14:51 +00:00
Claudio Sanches ee30b5b308 Fixed php docs standards 2015-11-03 11:31:20 -02:00
Mike Jolley 5b6e16682c Handle partial/full refund for orders containing free items
Also adds helper method to determine if such as free item exists or
not. Closes #9460
2015-10-29 15:34:33 +00:00
Biont bf4c5b1d91 Provide a filter after tax calculations are done #9313 2015-10-09 15:46:23 +02:00
Mike Jolley 0197a99065 Merge branch 'issue/8587'
Conflicts:
	assets/css/admin.css
	assets/css/woocommerce.css
	includes/admin/class-wc-admin-assets.php
	includes/admin/settings/views/html-settings-tax.php
2015-10-08 13:26:52 +01:00
Mike Jolley abaa8f47d8 Moved refund hooks to avoid emails after API refund failure 2015-10-06 14:43:36 +01:00
Mike Jolley 1f6260a880 Use tax settings in backend and default to base country
Closes #9186
2015-10-05 15:31:58 +01:00
Mike Jolley 786c87523f Improve product search and use WPDB instead of several get_posts queries
Fixes #9203 @claudiosmweb
2015-10-02 10:00:29 +02:00
Mike Jolley d4fbe0e45c Use SKU for stock order notes
Fixes #9133
2015-10-01 18:13:37 +02:00
Florian Ludwig 2d39a91fdc Add username on marking order status
At the moment the status updates via the order list action buttons are
not linked to the correct user. Lets fix that :)
2015-10-01 16:15:29 +02:00
Mike Jolley 7a3bd70c8b Allow bulk edit price to 0
Fixes #9143
2015-09-16 13:20:59 +01:00
Mike Jolley a056e3e649 Unslash key description
Closes #9068
2015-09-07 16:29:03 +01:00
Mike Jolley b111331686 Allow line breaks in non-variation attributes 2015-09-04 14:00:42 +01:00
Florian Ludwig b50a75ce23 Use wc_stock_amount for ajax response in variation admin
My previous pull request of old WC 2.3 didn’t get applied in the new
2.4 AJAX method for the variation admin. So let’s do it again ;) (old
pull request see #8304)
2015-08-28 18:17:54 +02:00
Mike Jolley 0cf74b5dba Set ajax endpoint headers like admin_ajax
@claudiosmweb does this make sense to you?
2015-08-23 21:17:03 +01:00
Mike Jolley 07b1f9329d Bulk update variation: Allow stock to be set to 0. 2015-08-21 16:48:25 +01:00
Mike Jolley bbb00d9a3a Bulk update variation manage stock when _manage_stock meta data is missing. 2015-08-21 16:33:55 +01:00
Mike Jolley ecc50f78ab Don't clean keys - avoids destroying special chars 2015-08-19 11:33:42 +01:00
Mike Jolley dc37e49c02 Suppress set_time_limit errors to prevent issues in some environments
“Warning: Cannot set max_execution_time above master value of 30 (tried
to set unlimited) in
/var/www/web1043/html/wordpress/wp-content/plugins/woocommerce/includes/
class-wc-download-handler.php on line 337</p>”
2015-08-18 13:16:25 +01:00
Mike Jolley a5a7c71aa7 Keep new variation in sync so actions can modify data Closes #8858 2015-08-17 15:11:34 +01:00
Claudio Sanches 934808fc37 Created new wc_sanitize_term_text_based() for properly sanitize term text based before save, closes #8823 2015-08-14 15:22:16 -03:00
Claudio Sanches dc666f6b27 Added missing $menu_order on WC_Ajax::add_variation() 2015-08-14 14:40:46 -03:00
George Stephanis 2aa1650f54 Rearrange things to get ajax working.
Spread them out throughout WooCommerce.
2015-08-13 17:49:59 -04:00
Mike Jolley fb64e6e66e Use wp_unslash and only decode when getting attributes, not saving 2015-08-13 13:03:51 +01:00
Mike Jolley 4908131b86 stripslashes_deep attributes 2015-08-13 12:07:05 +01:00
Mike Jolley 8f759c8af1 Order variations by menu_order by fallback to ID. 2015-08-13 10:40:50 +01:00
Mike Jolley d3e2217227 Allow errors with debug on
Closes #8805
2015-08-13 10:27:22 +01:00
Mike Jolley 19e8cc4634 display_errors > error_reporting 2015-08-12 17:45:49 +01:00
Mike Jolley 457283bc3c Ajax variations: stripslashes to fix attributes with quotes. 2015-08-12 17:08:21 +01:00
Mike Jolley 6a3f4ee969 Disable error_reporting during ajax requests to prevent malformed JSON. 2015-08-12 11:51:05 +01:00
Mike Jolley fafb6d5dca Tweak cart fix to avoid munging %%endpoint%% 2015-08-11 14:04:42 +01:00
Mike Jolley 3eedab457d return; don't break 2015-08-11 13:47:12 +01:00
Mike Jolley 1078564fca Prevent double add to cart due to ajax endpoints. 2015-08-11 11:53:36 +01:00
Mike Jolley c5cba283ed Remove numbered arguments from queries 2015-08-07 11:37:19 +01:00
Mike Jolley e8ea978e9e Merge pull request #8697 from JeroenSormani/define-ajax
Define DOING_AJAX early
2015-08-05 13:53:40 +01:00
Mike Jolley d6bd46c55d Move expand_item_meta to own method
Fixes notices in some extensions (deposits)
2015-08-03 13:21:44 +01:00
Brent Shepherd 501f0b752f Save product type before saving variations
WooCommerce prior to WC 2.4 saved the product type before any variations were saved because
WC_Meta_Box_Product_Data::save_variations() was called by WC_Meta_Box_Product_Data::save().
However, in WC 2.4 the variations are saved independently of other data about the containing
variable product, including product type. Because the product type hasn't been saved yet,
extensions that need to save their own variation level meta data can't know when saving
variations if the product is of the type they want to act on. They also can't check `$_POST`
to find out when saving variations, because 'product-type' isn't passed to that as it's
variable level meta data, not variation level meta data.

This patch passes the product type along with the variation level meta data when saving variations.
It then uses that to save the product type if the variable product has not yet been saved (and
therefore the product type has never been stored, which means calling get_product() would instantiate
a 'simple' product, as that is the default product type). This can lead to fatal errors if callbacks
expect the product type to be variable and attempt to call methods that only exist on those product
types, like variable_product_sync().

It will also update the product type if it was previously saved but has since changed. This prevents
fatal errors like that mentioned above but caused by switching from one product type, like a simple
product, to another, like a variable product.
2015-07-31 11:42:21 -07:00
JeroenSormani 2c81a71f04 Define DOING_AJAX early 2015-07-31 20:15:17 +02:00
Mike Jolley 61cb48afd7 Tweak wc ajax to post to the CURRENT URL rather than a fixed endpoint 2015-07-31 12:56:27 +01:00