Commit Graph

92 Commits

Author SHA1 Message Date
Christopher Allford 1358cca6d1
Revert "Improved performance when saving variations" 2020-03-17 08:55:09 -07:00
Salva Machí c4a7e19534 Refactory: code style 2020-01-31 09:23:28 +01:00
Salva Machí d1dc5f8c20 Bypass inputs without name 2020-01-13 11:31:20 +01:00
Salva Machí 2ca6c12089 Bypass unchecked radio buttons, unchecked checkboxes and disabled inputs 2020-01-13 10:24:12 +01:00
Salva Machí 37d7d498ec Improved performance when saving variations
The serializeJSON function was causing a long delay when preparing the JSON if there are many input fields within the variations (even worse if 3rd party plugins add their own extra fields there too).
2020-01-10 11:38:38 +01:00
Rodrigo Primo a26f38f3a1
Merge pull request #23133 from woocommerce/update/23111
If variations are missing prices, show notice
2019-07-04 10:08:41 -03:00
Gerhard b79c02658d Fix eslint for meta-boxes-product-variation.js 2019-05-13 13:36:21 +02:00
Gerhard b77c7fbbd8 Trigger input_changed function when download files removed for variations. 2019-05-13 13:32:30 +02:00
Mike Jolley 9907a25ff6 Append notice if variations are invalid 2019-03-25 13:30:04 +00:00
Mike Jolley 97f30e7f5c Variation stock status handling 2019-03-18 12:56:49 +00:00
Mike Jolley 83543a9232 Handle publish and save post buttons by storing ID of button pressed 2019-01-09 16:31:53 +00:00
Gerhard Potgieter 36cf6d64b8 Check the post status and set the hidden field based on that before submitting. 2018-09-10 11:23:12 +02:00
Mike Jolley cb693a5ccd Make form aware publish was pressed 2018-06-29 13:58:47 +01:00
Caleb Burks c7f5ee97db Hide variation stock status setting conditionally 2017-12-13 22:38:03 -06:00
claudiulodro afa0ca23d2 Start scripts once document is ready 2017-10-31 12:27:57 -07:00
Claudio Sanches a0ef49164f Fixed missing jQuery wrapper 2017-10-27 15:40:05 -02:00
Umangvaghela 75e5e36b4a 'use strict' in jQuery file 2017-10-13 17:53:26 +05:30
Mike Jolley 5475ae6e2b Avoid full refresh if user cancels a bulk action
Fixes #16658
2017-08-31 12:01:25 +01:00
Ninos Ego bf9a7381dc Coding improvements for datepicker range 2017-07-13 13:15:58 +02:00
Mike Jolley 2ac125417f Fix sale date field 2017-02-22 10:31:20 +00:00
Sabbir Ahmed 0bf17455ff Variation pagination problem fixed #12239 (#12240) 2016-11-03 11:28:58 +00:00
Mike Jolley 6f04ff1fa0 Replace size with length
Fixes #10444
2016-03-01 13:08:25 +00:00
Mike Jolley 4595befb76 Pass product type with variation bulk edit
Closes #9570
2015-11-17 15:25:48 +00:00
roykho ca13d3e5f7 Add conditional check for the selected variation image
This added check prevents undefined object preventing images that have no sizes ( e.g SVG ) from causing errors
2015-11-12 16:55:25 -08:00
Claudio Sanches 2e95a68357 Use new "question" mark icon font
Created wc_add_help_tip() function to generate the icons
Replaced all .help_tip elements and [?]

We'll keep the old image and styles in order to maintain backwards
compatibility

Closes #9381
2015-10-23 01:40:52 -02:00
Claudio Sanches ec2fdcc2d4 [2.4] Start variations tiptip for .help_tip elements, closes #9151 2015-09-22 14:06:54 -03:00
Mike Jolley 799353e8f2 Wait for variation update before submit
@claudiosmweb
2015-09-08 14:30:41 +01:00
Florian Ludwig 35655f8544 Fixed all inefficient selector usages
Use find for more efficient selectors - more information on e.g.
https://24ways.org/2011/your-jquery-now-with-less-suck/
2015-09-07 19:51:10 +02:00
Mike Jolley 32b220d8b6 Improve variation reload after save attributes
@claudiosmweb
2015-09-03 16:17:08 +01:00
Mike Jolley 889d40b8aa Add data attribute to leave options visible
Closes #9017
2015-09-03 15:38:42 +01:00
Claudio Sanches b6b34255d2 Stop for change inputs when add a new variation on admin, closes #8874 2015-08-18 13:00:38 -03:00
Claudio Sanches ac1986412c Stay on the same page when delete a variation 2015-08-12 11:39:55 -03: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
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 b28c6db7f5 Added button to dismiss variation error notices 2015-07-29 19:56:33 -03:00
Claudio Sanches d0e34588aa Updated all .page-selector when change page, closes #8681 2015-07-29 19:25:17 -03:00
Claudio Sanches b0ce578541 Show errors for admin ajax variations 2015-07-27 14:16:52 -03:00
Brent Shepherd 23418214d0 Trigger do_variation_action + '_ajax_data'
To allow extensions which add their own variation bulk actions to pass
data back to WooCommerce core's handler so that only one ajax call
is necessary for updating the data.

Previously, a duplicate ajax call would be required as trigger() does
not capture the callbacks return value.
2015-07-21 15:41:13 -07:00
Claudio Sanches 5e97a68e3d Fixed calendar when added new variation, closes #8533 2015-07-15 12:26:38 -03:00
Claudio Sanches 8b5fff38e4 Stop alerts when use delete all variations action 2015-07-14 14:08:59 -03:00
Mike Jolley c707f771ad serializeJSON to maintain POST data structure
@claudiosmweb
2015-07-14 13:49:45 +01:00
Claudio Sanches b8a28bdab4 Admin variations - Cancel button reset the default form values
@mikejolley
2015-07-10 20:16:35 -03:00
Mike Jolley 3ec4003bbb Move add variation button and toolbars 2015-07-11 00:04:16 +01:00
Claudio Sanches 8b4711f655 Admin variations - Removed alert when add new variation 2015-07-10 19:30:14 -03:00
Claudio Sanches 441d3c44bb Admin variations - Go to previous page when delete the last variation in a page 2015-07-10 18:57:38 -03:00
Claudio Sanches e0c1cc7784 Admin variations - Turn on save button when add new variation 2015-07-10 18:31:38 -03:00
Claudio Sanches e9fc799f97 Admin variations - Fix product add and save methods
Allow add new variations and stay at the same page
When save will set up the pagination again

@mikejolley
2015-07-10 18:22:05 -03:00
Claudio Sanches 987a789367 Admin variations - Show link all variations bulk action 2015-07-10 00:49:52 -03:00
Claudio Sanches a64695b7f5 Admin variations - Added new triggers and removed data-product_id 2015-07-09 17:31:48 -03:00
Claudio Sanches 1ce7719c98 Save variable defaults via ajax 2015-07-08 22:50:32 -03:00