Commit Graph

255 Commits

Author SHA1 Message Date
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
Mike Jolley 82f50cedb0 Allow menu_order sorting like in 2.3
Also allow setting manually to allow sorting between pages.

Fixes #8690
2015-07-31 12:39:23 +01:00
Claudio Sanches 6c4893e0b2 Introduces the woocommerce_ajax_admin_get_variations_args filter, closes #8690 2015-07-30 19:11:53 -03:00
Claudio Sanches b28c6db7f5 Added button to dismiss variation error notices 2015-07-29 19:56:33 -03:00
Mike Jolley 7b2aec4791 Take item qty into consideration when refunding orders
Fixes #8675
2015-07-29 13:13:41 +01:00
Mike Jolley 060fb16e2e Move Pre 2.4 handling for attributes - DRY
@claudiosmweb @franticpsyx
2015-07-28 16:20:51 +01:00
Claudio Sanches b0ce578541 Show errors for admin ajax variations 2015-07-27 14:16:52 -03:00
Mike Jolley 0ab151562a Fix issues with trailing slashes on permalinks
Closes #8658
2015-07-27 11:56:07 +01:00
Tamara Zuk 1bd4cf8fad Define new `WC_DOING_AJAX` constant
This constant will allow extensions to selectively load files etc.
during a WC AJAX request.
2015-07-24 15:50:50 -04:00
Brent Shepherd ffdc13fb4b Remove duplication in WC_Ajax::save_variations()
And use the original WC_Meta_Box_Product_Data::save_variations() method instead.
2015-07-23 22:15:44 -07:00