WooCommerce - Version 3.2.5

Version Description

  • 2017-11-22 =
  • Fix - WordPress 4.9 - REST API - Updated schema, sanitization, and validation callbacks to support correct data types.
  • Fix - WordPress 4.9 - Fix an issue saving variation attributes on new products and with attributes containing slashes.
  • Fix - Save fee tax lines to new orders on checkout.
  • Fix - Restore the post global after rendering product shortcodes.
  • Fix - Fix product filtering when searching for a string including quote characters.
  • Fix - Fix layered nav drop-downs containing unicode characters.
  • Fix - Fix an edge case rounding bug with shipping taxes, and another with non-integer quantities.
  • Fix - Set correct defaults when adding a new shipping class in admin.
Download this release

Release Info

Developer claudiosanches
Plugin Icon 128x128 WooCommerce
Version 3.2.5
Comparing to
See all releases

Code changes from version 3.2.4 to 3.2.5

assets/js/admin/wc-shipping-classes.js CHANGED
@@ -145,7 +145,7 @@
145
  classes = _.indexBy( model.get( 'classes' ), 'term_id' ),
146
  changes = {},
147
  size = _.size( classes ),
148
- newRow = _.extend( {}, data.default_class, {
149
  term_id: 'new-' + size + '-' + Date.now(),
150
  editing: true,
151
  newRow : true
145
  classes = _.indexBy( model.get( 'classes' ), 'term_id' ),
146
  changes = {},
147
  size = _.size( classes ),
148
+ newRow = _.extend( {}, data.default_shipping_class, {
149
  term_id: 'new-' + size + '-' + Date.now(),
150
  editing: true,
151
  newRow : true
assets/js/admin/wc-shipping-classes.min.js CHANGED
@@ -1 +1 @@
1
- !function(e,i,s,n){e(function(){var t=e(".wc-shipping-class-rows"),a=e(".wc-shipping-class-save"),o=s.template("wc-shipping-class-row"),d=s.template("wc-shipping-class-row-blank"),c=Backbone.Model.extend({changes:{},logChanges:function(e){var i=this.changes||{};_.each(e,function(e,s){i[s]=_.extend(i[s]||{term_id:s},e)}),this.changes=i,this.trigger("change:classes")},save:function(){_.size(this.changes)?e.post(n+(n.indexOf("?")>0?"&":"?")+"action=woocommerce_shipping_classes_save_changes",{wc_shipping_classes_nonce:i.wc_shipping_classes_nonce,changes:this.changes},this.onSaveResponse,"json"):r.trigger("saved:classes")},discardChanges:function(e){delete(this.changes||{})[e],0===_.size(this.changes)&&h.clearUnloadConfirmation()},onSaveResponse:function(e,s){"success"===s&&(e.success?(r.set("classes",e.data.shipping_classes),r.trigger("change:classes"),r.changes={},r.trigger("saved:classes")):e.data?window.alert(e.data):window.alert(i.strings.save_failed)),h.unblock()}}),l=Backbone.View.extend({rowTemplate:o,initialize:function(){this.listenTo(this.model,"change:classes",this.setUnloadConfirmation),this.listenTo(this.model,"saved:classes",this.clearUnloadConfirmation),this.listenTo(this.model,"saved:classes",this.render),t.on("change",{view:this},this.updateModelOnChange),e(window).on("beforeunload",{view:this},this.unloadConfirmation),a.on("click",{view:this},this.onSubmit),e(document.body).on("click",".wc-shipping-class-add",{view:this},this.onAddNewRow),e(document.body).on("click",".wc-shipping-class-save-changes",{view:this},this.onSubmit)},block:function(){e(this.el).block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},unblock:function(){e(this.el).unblock()},render:function(){var i=_.indexBy(this.model.get("classes"),"term_id"),s=this;this.$el.empty(),this.unblock(),_.size(i)?(i=_.sortBy(i,function(e){return e.name}),e.each(i,function(e,i){s.renderRow(i)})):s.$el.append(d)},renderRow:function(e){var i=this;i.$el.append(i.rowTemplate(e)),i.initRow(e)},initRow:function(i){var s=this.$el.find('tr[data-id="'+i.term_id+'"]');s.find("select").each(function(){var s=e(this).data("attribute");e(this).find('option[value="'+i[s]+'"]').prop("selected",!0)}),s.find(".view").show(),s.find(".edit").hide(),s.find(".wc-shipping-class-edit").on("click",{view:this},this.onEditRow),s.find(".wc-shipping-class-delete").on("click",{view:this},this.onDeleteRow),s.find(".editing .wc-shipping-class-edit").trigger("click"),s.find(".wc-shipping-class-cancel-edit").on("click",{view:this},this.onCancelEditRow),!0===i.editing&&(s.addClass("editing"),s.find(".wc-shipping-class-edit").trigger("click"))},onSubmit:function(e){e.data.view.block(),e.data.view.model.save(),e.preventDefault()},onAddNewRow:function(s){s.preventDefault();var n=s.data.view,t=n.model,a=_.indexBy(t.get("classes"),"term_id"),o={},d=_.size(a),c=_.extend({},i.default_class,{term_id:"new-"+d+"-"+Date.now(),editing:!0,newRow:!0});o[c.term_id]=c,t.logChanges(o),n.renderRow(c),e(".wc-shipping-classes-blank-state").remove()},onEditRow:function(i){i.preventDefault(),e(this).closest("tr").addClass("editing"),e(this).closest("tr").find(".view").hide(),e(this).closest("tr").find(".edit").show(),i.data.view.model.trigger("change:classes")},onDeleteRow:function(i){var s=i.data.view,n=s.model,t=_.indexBy(n.get("classes"),"term_id"),a={},o=e(this).closest("tr").data("id");i.preventDefault(),t[o]&&(delete t[o],a[o]=_.extend(a[o]||{},{deleted:"deleted"}),n.set("classes",t),n.logChanges(a)),s.render()},onCancelEditRow:function(i){var s=i.data.view,n=s.model,t=e(this).closest("tr"),a=e(this).closest("tr").data("id"),o=_.indexBy(n.get("classes"),"term_id");i.preventDefault(),n.discardChanges(a),o[a]&&(o[a].editing=!1,t.after(s.rowTemplate(o[a])),s.initRow(o[a])),t.remove()},setUnloadConfirmation:function(){this.needsUnloadConfirm=!0,a.removeAttr("disabled")},clearUnloadConfirmation:function(){this.needsUnloadConfirm=!1,a.attr("disabled","disabled")},unloadConfirmation:function(e){if(e.data.view.needsUnloadConfirm)return e.returnValue=i.strings.unload_confirmation_msg,window.event.returnValue=i.strings.unload_confirmation_msg,i.strings.unload_confirmation_msg},updateModelOnChange:function(i){var s=i.data.view.model,n=e(i.target),t=n.closest("tr").data("id"),a=n.data("attribute"),o=n.val(),d=_.indexBy(s.get("classes"),"term_id"),c={};d[t]&&d[t][a]===o||(c[t]={},c[t][a]=o),s.logChanges(c)}}),r=new c({classes:i.classes}),h=new l({model:r,el:t});h.render()})}(jQuery,shippingClassesLocalizeScript,wp,ajaxurl);
1
+ !function(e,i,s,n){e(function(){var t=e(".wc-shipping-class-rows"),a=e(".wc-shipping-class-save"),o=s.template("wc-shipping-class-row"),d=s.template("wc-shipping-class-row-blank"),c=Backbone.Model.extend({changes:{},logChanges:function(e){var i=this.changes||{};_.each(e,function(e,s){i[s]=_.extend(i[s]||{term_id:s},e)}),this.changes=i,this.trigger("change:classes")},save:function(){_.size(this.changes)?e.post(n+(n.indexOf("?")>0?"&":"?")+"action=woocommerce_shipping_classes_save_changes",{wc_shipping_classes_nonce:i.wc_shipping_classes_nonce,changes:this.changes},this.onSaveResponse,"json"):r.trigger("saved:classes")},discardChanges:function(e){delete(this.changes||{})[e],0===_.size(this.changes)&&h.clearUnloadConfirmation()},onSaveResponse:function(e,s){"success"===s&&(e.success?(r.set("classes",e.data.shipping_classes),r.trigger("change:classes"),r.changes={},r.trigger("saved:classes")):e.data?window.alert(e.data):window.alert(i.strings.save_failed)),h.unblock()}}),l=Backbone.View.extend({rowTemplate:o,initialize:function(){this.listenTo(this.model,"change:classes",this.setUnloadConfirmation),this.listenTo(this.model,"saved:classes",this.clearUnloadConfirmation),this.listenTo(this.model,"saved:classes",this.render),t.on("change",{view:this},this.updateModelOnChange),e(window).on("beforeunload",{view:this},this.unloadConfirmation),a.on("click",{view:this},this.onSubmit),e(document.body).on("click",".wc-shipping-class-add",{view:this},this.onAddNewRow),e(document.body).on("click",".wc-shipping-class-save-changes",{view:this},this.onSubmit)},block:function(){e(this.el).block({message:null,overlayCSS:{background:"#fff",opacity:.6}})},unblock:function(){e(this.el).unblock()},render:function(){var i=_.indexBy(this.model.get("classes"),"term_id"),s=this;this.$el.empty(),this.unblock(),_.size(i)?(i=_.sortBy(i,function(e){return e.name}),e.each(i,function(e,i){s.renderRow(i)})):s.$el.append(d)},renderRow:function(e){var i=this;i.$el.append(i.rowTemplate(e)),i.initRow(e)},initRow:function(i){var s=this.$el.find('tr[data-id="'+i.term_id+'"]');s.find("select").each(function(){var s=e(this).data("attribute");e(this).find('option[value="'+i[s]+'"]').prop("selected",!0)}),s.find(".view").show(),s.find(".edit").hide(),s.find(".wc-shipping-class-edit").on("click",{view:this},this.onEditRow),s.find(".wc-shipping-class-delete").on("click",{view:this},this.onDeleteRow),s.find(".editing .wc-shipping-class-edit").trigger("click"),s.find(".wc-shipping-class-cancel-edit").on("click",{view:this},this.onCancelEditRow),!0===i.editing&&(s.addClass("editing"),s.find(".wc-shipping-class-edit").trigger("click"))},onSubmit:function(e){e.data.view.block(),e.data.view.model.save(),e.preventDefault()},onAddNewRow:function(s){s.preventDefault();var n=s.data.view,t=n.model,a=_.indexBy(t.get("classes"),"term_id"),o={},d=_.size(a),c=_.extend({},i.default_shipping_class,{term_id:"new-"+d+"-"+Date.now(),editing:!0,newRow:!0});o[c.term_id]=c,t.logChanges(o),n.renderRow(c),e(".wc-shipping-classes-blank-state").remove()},onEditRow:function(i){i.preventDefault(),e(this).closest("tr").addClass("editing"),e(this).closest("tr").find(".view").hide(),e(this).closest("tr").find(".edit").show(),i.data.view.model.trigger("change:classes")},onDeleteRow:function(i){var s=i.data.view,n=s.model,t=_.indexBy(n.get("classes"),"term_id"),a={},o=e(this).closest("tr").data("id");i.preventDefault(),t[o]&&(delete t[o],a[o]=_.extend(a[o]||{},{deleted:"deleted"}),n.set("classes",t),n.logChanges(a)),s.render()},onCancelEditRow:function(i){var s=i.data.view,n=s.model,t=e(this).closest("tr"),a=e(this).closest("tr").data("id"),o=_.indexBy(n.get("classes"),"term_id");i.preventDefault(),n.discardChanges(a),o[a]&&(o[a].editing=!1,t.after(s.rowTemplate(o[a])),s.initRow(o[a])),t.remove()},setUnloadConfirmation:function(){this.needsUnloadConfirm=!0,a.removeAttr("disabled")},clearUnloadConfirmation:function(){this.needsUnloadConfirm=!1,a.attr("disabled","disabled")},unloadConfirmation:function(e){if(e.data.view.needsUnloadConfirm)return e.returnValue=i.strings.unload_confirmation_msg,window.event.returnValue=i.strings.unload_confirmation_msg,i.strings.unload_confirmation_msg},updateModelOnChange:function(i){var s=i.data.view.model,n=e(i.target),t=n.closest("tr").data("id"),a=n.data("attribute"),o=n.val(),d=_.indexBy(s.get("classes"),"term_id"),c={};d[t]&&d[t][a]===o||(c[t]={},c[t][a]=o),s.logChanges(c)}}),r=new c({classes:i.classes}),h=new l({model:r,el:t});h.render()})}(jQuery,shippingClassesLocalizeScript,wp,ajaxurl);
i18n/languages/woocommerce.pot CHANGED
@@ -2,16 +2,16 @@
2
  # This file is distributed under the same license as the WooCommerce package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WooCommerce 3.2.4\n"
6
  "Report-Msgid-Bugs-To: https://github.com/woocommerce/woocommerce/issues\n"
7
- "POT-Creation-Date: 2017-11-16 17:34:08+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "PO-Revision-Date: 2017-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <EMAIL@ADDRESS>\n"
14
- "X-Generator: grunt-wp-i18n1.0.0\n"
15
 
16
  #: i18n/continents.php:19
17
  msgid "Africa"
@@ -8446,14 +8446,6 @@ msgstr ""
8446
  msgid "Set a fixed price to cover shipping costs."
8447
  msgstr ""
8448
 
8449
- #: includes/admin/class-wc-admin-setup-wizard.php:627
8450
- #: includes/admin/meta-boxes/views/html-order-items.php:31
8451
- #: includes/shipping/flat-rate/includes/settings-flat-rate.php:31
8452
- #: includes/shipping/legacy-flat-rate/includes/settings-flat-rate.php:58
8453
- #: includes/shipping/local-pickup/class-wc-shipping-local-pickup.php:91
8454
- msgid "Cost"
8455
- msgstr ""
8456
-
8457
  #: includes/admin/class-wc-admin-setup-wizard.php:628
8458
  msgid "What would you like to charge for flat rate shipping?"
8459
  msgstr ""
@@ -10612,6 +10604,13 @@ msgstr ""
10612
  msgid "Item"
10613
  msgstr ""
10614
 
 
 
 
 
 
 
 
10615
  #: includes/admin/meta-boxes/views/html-order-items.php:32
10616
  #: templates/checkout/form-pay.php:30
10617
  msgid "Qty"
@@ -14915,7 +14914,7 @@ msgstr ""
14915
  #: includes/api/class-wc-rest-orders-controller.php:1488
14916
  #: includes/api/class-wc-rest-orders-controller.php:1546
14917
  #: includes/api/class-wc-rest-product-variations-controller.php:929
14918
- #: includes/api/class-wc-rest-products-controller.php:1972
14919
  msgid "Meta data."
14920
  msgstr ""
14921
 
@@ -14930,7 +14929,7 @@ msgstr ""
14930
  #: includes/api/class-wc-rest-orders-controller.php:1495
14931
  #: includes/api/class-wc-rest-orders-controller.php:1553
14932
  #: includes/api/class-wc-rest-product-variations-controller.php:936
14933
- #: includes/api/class-wc-rest-products-controller.php:1979
14934
  msgid "Meta ID."
14935
  msgstr ""
14936
 
@@ -14945,7 +14944,7 @@ msgstr ""
14945
  #: includes/api/class-wc-rest-orders-controller.php:1501
14946
  #: includes/api/class-wc-rest-orders-controller.php:1559
14947
  #: includes/api/class-wc-rest-product-variations-controller.php:942
14948
- #: includes/api/class-wc-rest-products-controller.php:1985
14949
  #: includes/api/v1/class-wc-rest-order-refunds-controller.php:476
14950
  #: includes/api/v1/class-wc-rest-orders-controller.php:1309
14951
  msgid "Meta key."
@@ -14962,7 +14961,7 @@ msgstr ""
14962
  #: includes/api/class-wc-rest-orders-controller.php:1506
14963
  #: includes/api/class-wc-rest-orders-controller.php:1564
14964
  #: includes/api/class-wc-rest-product-variations-controller.php:947
14965
- #: includes/api/class-wc-rest-products-controller.php:1990
14966
  #: includes/api/v1/class-wc-rest-order-refunds-controller.php:488
14967
  #: includes/api/v1/class-wc-rest-orders-controller.php:1321
14968
  msgid "Meta value."
@@ -16266,7 +16265,7 @@ msgstr ""
16266
 
16267
  #: includes/api/class-wc-rest-product-variations-controller.php:906
16268
  #: includes/api/class-wc-rest-products-controller.php:1890
16269
- #: includes/api/class-wc-rest-products-controller.php:1932
16270
  #: includes/api/v1/class-wc-rest-products-controller.php:2199
16271
  #: includes/api/v1/class-wc-rest-products-controller.php:2241
16272
  #: includes/api/v1/class-wc-rest-products-controller.php:2531
@@ -16276,7 +16275,7 @@ msgstr ""
16276
 
16277
  #: includes/api/class-wc-rest-product-variations-controller.php:911
16278
  #: includes/api/class-wc-rest-products-controller.php:1895
16279
- #: includes/api/class-wc-rest-products-controller.php:1937
16280
  #: includes/api/v1/class-wc-rest-product-attributes-controller.php:462
16281
  #: includes/api/v1/class-wc-rest-products-controller.php:2204
16282
  #: includes/api/v1/class-wc-rest-products-controller.php:2246
@@ -16285,14 +16284,14 @@ msgid "Attribute name."
16285
  msgstr ""
16286
 
16287
  #: includes/api/class-wc-rest-product-variations-controller.php:916
16288
- #: includes/api/class-wc-rest-products-controller.php:1942
16289
  #: includes/api/v1/class-wc-rest-products-controller.php:2251
16290
  #: includes/api/v1/class-wc-rest-products-controller.php:2541
16291
  msgid "Selected attribute term name."
16292
  msgstr ""
16293
 
16294
  #: includes/api/class-wc-rest-product-variations-controller.php:924
16295
- #: includes/api/class-wc-rest-products-controller.php:1967
16296
  #: includes/api/v1/class-wc-rest-products-controller.php:2561
16297
  msgid "Menu order, used to custom sort products."
16298
  msgstr ""
@@ -16590,88 +16589,88 @@ msgstr ""
16590
  msgid "List of available term names of the attribute."
16591
  msgstr ""
16592
 
16593
- #: includes/api/class-wc-rest-products-controller.php:1925
16594
  #: includes/api/v1/class-wc-rest-products-controller.php:2234
16595
  msgid "Defaults variation attributes."
16596
  msgstr ""
16597
 
16598
- #: includes/api/class-wc-rest-products-controller.php:1950
16599
  msgid "List of variations IDs."
16600
  msgstr ""
16601
 
16602
- #: includes/api/class-wc-rest-products-controller.php:1959
16603
  #: includes/api/v1/class-wc-rest-products-controller.php:2552
16604
  msgid "List of grouped products ID."
16605
  msgstr ""
16606
 
16607
- #: includes/api/class-wc-rest-products-controller.php:2012
16608
  #: includes/api/v1/class-wc-rest-products-controller.php:2580
16609
  msgid "Limit result set to products with a specific slug."
16610
  msgstr ""
16611
 
16612
- #: includes/api/class-wc-rest-products-controller.php:2018
16613
  #: includes/api/v1/class-wc-rest-products-controller.php:2586
16614
  msgid "Limit result set to products assigned a specific status."
16615
  msgstr ""
16616
 
16617
- #: includes/api/class-wc-rest-products-controller.php:2025
16618
  #: includes/api/v1/class-wc-rest-products-controller.php:2593
16619
  msgid "Limit result set to products assigned a specific type."
16620
  msgstr ""
16621
 
16622
- #: includes/api/class-wc-rest-products-controller.php:2032
16623
  #: includes/api/v1/class-wc-rest-products-controller.php:2630
16624
  msgid "Limit result set to products with a specific SKU."
16625
  msgstr ""
16626
 
16627
- #: includes/api/class-wc-rest-products-controller.php:2038
16628
  msgid "Limit result set to featured products."
16629
  msgstr ""
16630
 
16631
- #: includes/api/class-wc-rest-products-controller.php:2044
16632
  #: includes/api/v1/class-wc-rest-products-controller.php:2600
16633
  msgid "Limit result set to products assigned a specific category ID."
16634
  msgstr ""
16635
 
16636
- #: includes/api/class-wc-rest-products-controller.php:2050
16637
  #: includes/api/v1/class-wc-rest-products-controller.php:2606
16638
  msgid "Limit result set to products assigned a specific tag ID."
16639
  msgstr ""
16640
 
16641
- #: includes/api/class-wc-rest-products-controller.php:2056
16642
  #: includes/api/v1/class-wc-rest-products-controller.php:2612
16643
  msgid "Limit result set to products assigned a specific shipping class ID."
16644
  msgstr ""
16645
 
16646
- #: includes/api/class-wc-rest-products-controller.php:2062
16647
  #: includes/api/v1/class-wc-rest-products-controller.php:2618
16648
  msgid "Limit result set to products with a specific attribute."
16649
  msgstr ""
16650
 
16651
- #: includes/api/class-wc-rest-products-controller.php:2068
16652
  #: includes/api/v1/class-wc-rest-products-controller.php:2624
16653
  msgid ""
16654
  "Limit result set to products with a specific attribute term ID (required an "
16655
  "assigned attribute)."
16656
  msgstr ""
16657
 
16658
- #: includes/api/class-wc-rest-products-controller.php:2076
16659
  msgid "Limit result set to products with a specific tax class."
16660
  msgstr ""
16661
 
16662
- #: includes/api/class-wc-rest-products-controller.php:2085
16663
  msgid "Limit result set to products in stock or out of stock."
16664
  msgstr ""
16665
 
16666
- #: includes/api/class-wc-rest-products-controller.php:2091
16667
  msgid "Limit result set to products on sale."
16668
  msgstr ""
16669
 
16670
- #: includes/api/class-wc-rest-products-controller.php:2097
16671
  msgid "Limit result set to products based on a minimum price."
16672
  msgstr ""
16673
 
16674
- #: includes/api/class-wc-rest-products-controller.php:2103
16675
  msgid "Limit result set to products based on a maximum price."
16676
  msgstr ""
16677
 
@@ -20250,8 +20249,8 @@ msgstr ""
20250
  msgid "Invalid coupon."
20251
  msgstr ""
20252
 
20253
- #: includes/data-stores/class-wc-customer-data-store.php:136
20254
- #: includes/data-stores/class-wc-customer-data-store.php:141
20255
  msgid "Invalid customer."
20256
  msgstr ""
20257
 
@@ -22735,7 +22734,7 @@ msgstr ""
22735
  msgid "JCB"
22736
  msgstr ""
22737
 
22738
- #: includes/wc-core-functions.php:1569
22739
  #. translators: 1: class name 2: woocommerce_logging_class 3:
22740
  #. WC_Logger_Interface
22741
  msgid "The class %1$s provided by %2$s filter must implement %3$s."
@@ -24044,19 +24043,19 @@ msgid "Webhooks"
24044
  msgstr ""
24045
 
24046
  #: includes/admin/class-wc-admin-permalink-settings.php:76
24047
- #: includes/wc-core-functions.php:1724 includes/wc-update-functions.php:51
24048
  msgctxt "slug"
24049
  msgid "product-category"
24050
  msgstr ""
24051
 
24052
  #: includes/admin/class-wc-admin-permalink-settings.php:85
24053
- #: includes/wc-core-functions.php:1725 includes/wc-update-functions.php:52
24054
  msgctxt "slug"
24055
  msgid "product-tag"
24056
  msgstr ""
24057
 
24058
  #: includes/admin/class-wc-admin-permalink-settings.php:194
24059
- #: includes/wc-core-functions.php:1723 includes/wc-update-functions.php:60
24060
  msgctxt "slug"
24061
  msgid "product"
24062
  msgstr ""
@@ -24084,6 +24083,11 @@ msgctxt "full name"
24084
  msgid "%1$s %2$s"
24085
  msgstr ""
24086
 
 
 
 
 
 
24087
  #: includes/admin/class-wc-admin-setup-wizard.php:1082
24088
  #: includes/gateways/cheque/class-wc-gateway-cheque.php:27
24089
  #: includes/gateways/cheque/class-wc-gateway-cheque.php:63
2
  # This file is distributed under the same license as the WooCommerce package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: WooCommerce 3.2.5\n"
6
  "Report-Msgid-Bugs-To: https://github.com/woocommerce/woocommerce/issues\n"
7
+ "POT-Creation-Date: 2017-11-21 14:48:19+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=utf-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
  "PO-Revision-Date: 2017-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <EMAIL@ADDRESS>\n"
14
+ "X-Generator: grunt-wp-i18n1.0.1\n"
15
 
16
  #: i18n/continents.php:19
17
  msgid "Africa"
8446
  msgid "Set a fixed price to cover shipping costs."
8447
  msgstr ""
8448
 
 
 
 
 
 
 
 
 
8449
  #: includes/admin/class-wc-admin-setup-wizard.php:628
8450
  msgid "What would you like to charge for flat rate shipping?"
8451
  msgstr ""
10604
  msgid "Item"
10605
  msgstr ""
10606
 
10607
+ #: includes/admin/meta-boxes/views/html-order-items.php:31
10608
+ #: includes/shipping/flat-rate/includes/settings-flat-rate.php:31
10609
+ #: includes/shipping/legacy-flat-rate/includes/settings-flat-rate.php:58
10610
+ #: includes/shipping/local-pickup/class-wc-shipping-local-pickup.php:91
10611
+ msgid "Cost"
10612
+ msgstr ""
10613
+
10614
  #: includes/admin/meta-boxes/views/html-order-items.php:32
10615
  #: templates/checkout/form-pay.php:30
10616
  msgid "Qty"
14914
  #: includes/api/class-wc-rest-orders-controller.php:1488
14915
  #: includes/api/class-wc-rest-orders-controller.php:1546
14916
  #: includes/api/class-wc-rest-product-variations-controller.php:929
14917
+ #: includes/api/class-wc-rest-products-controller.php:1975
14918
  msgid "Meta data."
14919
  msgstr ""
14920
 
14929
  #: includes/api/class-wc-rest-orders-controller.php:1495
14930
  #: includes/api/class-wc-rest-orders-controller.php:1553
14931
  #: includes/api/class-wc-rest-product-variations-controller.php:936
14932
+ #: includes/api/class-wc-rest-products-controller.php:1982
14933
  msgid "Meta ID."
14934
  msgstr ""
14935
 
14944
  #: includes/api/class-wc-rest-orders-controller.php:1501
14945
  #: includes/api/class-wc-rest-orders-controller.php:1559
14946
  #: includes/api/class-wc-rest-product-variations-controller.php:942
14947
+ #: includes/api/class-wc-rest-products-controller.php:1988
14948
  #: includes/api/v1/class-wc-rest-order-refunds-controller.php:476
14949
  #: includes/api/v1/class-wc-rest-orders-controller.php:1309
14950
  msgid "Meta key."
14961
  #: includes/api/class-wc-rest-orders-controller.php:1506
14962
  #: includes/api/class-wc-rest-orders-controller.php:1564
14963
  #: includes/api/class-wc-rest-product-variations-controller.php:947
14964
+ #: includes/api/class-wc-rest-products-controller.php:1993
14965
  #: includes/api/v1/class-wc-rest-order-refunds-controller.php:488
14966
  #: includes/api/v1/class-wc-rest-orders-controller.php:1321
14967
  msgid "Meta value."
16265
 
16266
  #: includes/api/class-wc-rest-product-variations-controller.php:906
16267
  #: includes/api/class-wc-rest-products-controller.php:1890
16268
+ #: includes/api/class-wc-rest-products-controller.php:1935
16269
  #: includes/api/v1/class-wc-rest-products-controller.php:2199
16270
  #: includes/api/v1/class-wc-rest-products-controller.php:2241
16271
  #: includes/api/v1/class-wc-rest-products-controller.php:2531
16275
 
16276
  #: includes/api/class-wc-rest-product-variations-controller.php:911
16277
  #: includes/api/class-wc-rest-products-controller.php:1895
16278
+ #: includes/api/class-wc-rest-products-controller.php:1940
16279
  #: includes/api/v1/class-wc-rest-product-attributes-controller.php:462
16280
  #: includes/api/v1/class-wc-rest-products-controller.php:2204
16281
  #: includes/api/v1/class-wc-rest-products-controller.php:2246
16284
  msgstr ""
16285
 
16286
  #: includes/api/class-wc-rest-product-variations-controller.php:916
16287
+ #: includes/api/class-wc-rest-products-controller.php:1945
16288
  #: includes/api/v1/class-wc-rest-products-controller.php:2251
16289
  #: includes/api/v1/class-wc-rest-products-controller.php:2541
16290
  msgid "Selected attribute term name."
16291
  msgstr ""
16292
 
16293
  #: includes/api/class-wc-rest-product-variations-controller.php:924
16294
+ #: includes/api/class-wc-rest-products-controller.php:1970
16295
  #: includes/api/v1/class-wc-rest-products-controller.php:2561
16296
  msgid "Menu order, used to custom sort products."
16297
  msgstr ""
16589
  msgid "List of available term names of the attribute."
16590
  msgstr ""
16591
 
16592
+ #: includes/api/class-wc-rest-products-controller.php:1928
16593
  #: includes/api/v1/class-wc-rest-products-controller.php:2234
16594
  msgid "Defaults variation attributes."
16595
  msgstr ""
16596
 
16597
+ #: includes/api/class-wc-rest-products-controller.php:1953
16598
  msgid "List of variations IDs."
16599
  msgstr ""
16600
 
16601
+ #: includes/api/class-wc-rest-products-controller.php:1962
16602
  #: includes/api/v1/class-wc-rest-products-controller.php:2552
16603
  msgid "List of grouped products ID."
16604
  msgstr ""
16605
 
16606
+ #: includes/api/class-wc-rest-products-controller.php:2015
16607
  #: includes/api/v1/class-wc-rest-products-controller.php:2580
16608
  msgid "Limit result set to products with a specific slug."
16609
  msgstr ""
16610
 
16611
+ #: includes/api/class-wc-rest-products-controller.php:2021
16612
  #: includes/api/v1/class-wc-rest-products-controller.php:2586
16613
  msgid "Limit result set to products assigned a specific status."
16614
  msgstr ""
16615
 
16616
+ #: includes/api/class-wc-rest-products-controller.php:2028
16617
  #: includes/api/v1/class-wc-rest-products-controller.php:2593
16618
  msgid "Limit result set to products assigned a specific type."
16619
  msgstr ""
16620
 
16621
+ #: includes/api/class-wc-rest-products-controller.php:2035
16622
  #: includes/api/v1/class-wc-rest-products-controller.php:2630
16623
  msgid "Limit result set to products with a specific SKU."
16624
  msgstr ""
16625
 
16626
+ #: includes/api/class-wc-rest-products-controller.php:2041
16627
  msgid "Limit result set to featured products."
16628
  msgstr ""
16629
 
16630
+ #: includes/api/class-wc-rest-products-controller.php:2047
16631
  #: includes/api/v1/class-wc-rest-products-controller.php:2600
16632
  msgid "Limit result set to products assigned a specific category ID."
16633
  msgstr ""
16634
 
16635
+ #: includes/api/class-wc-rest-products-controller.php:2053
16636
  #: includes/api/v1/class-wc-rest-products-controller.php:2606
16637
  msgid "Limit result set to products assigned a specific tag ID."
16638
  msgstr ""
16639
 
16640
+ #: includes/api/class-wc-rest-products-controller.php:2059
16641
  #: includes/api/v1/class-wc-rest-products-controller.php:2612
16642
  msgid "Limit result set to products assigned a specific shipping class ID."
16643
  msgstr ""
16644
 
16645
+ #: includes/api/class-wc-rest-products-controller.php:2065
16646
  #: includes/api/v1/class-wc-rest-products-controller.php:2618
16647
  msgid "Limit result set to products with a specific attribute."
16648
  msgstr ""
16649
 
16650
+ #: includes/api/class-wc-rest-products-controller.php:2071
16651
  #: includes/api/v1/class-wc-rest-products-controller.php:2624
16652
  msgid ""
16653
  "Limit result set to products with a specific attribute term ID (required an "
16654
  "assigned attribute)."
16655
  msgstr ""
16656
 
16657
+ #: includes/api/class-wc-rest-products-controller.php:2079
16658
  msgid "Limit result set to products with a specific tax class."
16659
  msgstr ""
16660
 
16661
+ #: includes/api/class-wc-rest-products-controller.php:2088
16662
  msgid "Limit result set to products in stock or out of stock."
16663
  msgstr ""
16664
 
16665
+ #: includes/api/class-wc-rest-products-controller.php:2094
16666
  msgid "Limit result set to products on sale."
16667
  msgstr ""
16668
 
16669
+ #: includes/api/class-wc-rest-products-controller.php:2100
16670
  msgid "Limit result set to products based on a minimum price."
16671
  msgstr ""
16672
 
16673
+ #: includes/api/class-wc-rest-products-controller.php:2106
16674
  msgid "Limit result set to products based on a maximum price."
16675
  msgstr ""
16676
 
20249
  msgid "Invalid coupon."
20250
  msgstr ""
20251
 
20252
+ #: includes/data-stores/class-wc-customer-data-store.php:137
20253
+ #: includes/data-stores/class-wc-customer-data-store.php:142
20254
  msgid "Invalid customer."
20255
  msgstr ""
20256
 
22734
  msgid "JCB"
22735
  msgstr ""
22736
 
22737
+ #: includes/wc-core-functions.php:1572
22738
  #. translators: 1: class name 2: woocommerce_logging_class 3:
22739
  #. WC_Logger_Interface
22740
  msgid "The class %1$s provided by %2$s filter must implement %3$s."
24043
  msgstr ""
24044
 
24045
  #: includes/admin/class-wc-admin-permalink-settings.php:76
24046
+ #: includes/wc-core-functions.php:1727 includes/wc-update-functions.php:51
24047
  msgctxt "slug"
24048
  msgid "product-category"
24049
  msgstr ""
24050
 
24051
  #: includes/admin/class-wc-admin-permalink-settings.php:85
24052
+ #: includes/wc-core-functions.php:1728 includes/wc-update-functions.php:52
24053
  msgctxt "slug"
24054
  msgid "product-tag"
24055
  msgstr ""
24056
 
24057
  #: includes/admin/class-wc-admin-permalink-settings.php:194
24058
+ #: includes/wc-core-functions.php:1726 includes/wc-update-functions.php:60
24059
  msgctxt "slug"
24060
  msgid "product"
24061
  msgstr ""
24083
  msgid "%1$s %2$s"
24084
  msgstr ""
24085
 
24086
+ #: includes/admin/class-wc-admin-setup-wizard.php:627
24087
+ msgctxt "Short label for entering the cost of an item"
24088
+ msgid "Cost"
24089
+ msgstr ""
24090
+
24091
  #: includes/admin/class-wc-admin-setup-wizard.php:1082
24092
  #: includes/gateways/cheque/class-wc-gateway-cheque.php:27
24093
  #: includes/gateways/cheque/class-wc-gateway-cheque.php:63
includes/admin/class-wc-admin-setup-wizard.php CHANGED
@@ -624,7 +624,7 @@ class WC_Admin_Setup_Wizard {
624
  'settings' => array(
625
  'cost' => array(
626
  'type' => 'text',
627
- 'default_value' => __( 'Cost', 'Short label for entering the cost of an item', 'woocommerce' ),
628
  'description' => __( 'What would you like to charge for flat rate shipping?', 'woocommerce' ),
629
  'required' => true,
630
  ),
@@ -1599,7 +1599,7 @@ class WC_Admin_Setup_Wizard {
1599
  $docs_url = 'https://docs.woocommerce.com/documentation/plugins/woocommerce/getting-started/?utm_source=setupwizard&utm_medium=product&utm_content=docs&utm_campaign=woocommerceplugin';
1600
  $help_text = sprintf(
1601
  /* translators: %1$s: link to videos, %2$s: link to docs */
1602
- __( 'Watch our <a href="%1$s" target="_blank">guided tour videos</a> to learn more about WooCommerce, and visit WooCommerce.com to learn more about <a href="%2$s" target="_blank">getting started</a>.' ),
1603
  $videos_url,
1604
  $docs_url
1605
  );
624
  'settings' => array(
625
  'cost' => array(
626
  'type' => 'text',
627
+ 'default_value' => _x( 'Cost', 'Short label for entering the cost of an item', 'woocommerce' ),
628
  'description' => __( 'What would you like to charge for flat rate shipping?', 'woocommerce' ),
629
  'required' => true,
630
  ),
1599
  $docs_url = 'https://docs.woocommerce.com/documentation/plugins/woocommerce/getting-started/?utm_source=setupwizard&utm_medium=product&utm_content=docs&utm_campaign=woocommerceplugin';
1600
  $help_text = sprintf(
1601
  /* translators: %1$s: link to videos, %2$s: link to docs */
1602
+ __( 'Watch our <a href="%1$s" target="_blank">guided tour videos</a> to learn more about WooCommerce, and visit WooCommerce.com to learn more about <a href="%2$s" target="_blank">getting started</a>.', 'woocommerce' ),
1603
  $videos_url,
1604
  $docs_url
1605
  );
includes/api/class-wc-rest-coupons-controller.php CHANGED
@@ -507,7 +507,7 @@ class WC_REST_Coupons_Controller extends WC_REST_Legacy_Coupons_Controller {
507
  ),
508
  'value' => array(
509
  'description' => __( 'Meta value.', 'woocommerce' ),
510
- 'type' => 'string',
511
  'context' => array( 'view', 'edit' ),
512
  ),
513
  ),
507
  ),
508
  'value' => array(
509
  'description' => __( 'Meta value.', 'woocommerce' ),
510
+ 'type' => 'mixed',
511
  'context' => array( 'view', 'edit' ),
512
  ),
513
  ),
includes/api/class-wc-rest-customers-controller.php CHANGED
@@ -354,7 +354,7 @@ class WC_REST_Customers_Controller extends WC_REST_Customers_V1_Controller {
354
  ),
355
  'value' => array(
356
  'description' => __( 'Meta value.', 'woocommerce' ),
357
- 'type' => 'string',
358
  'context' => array( 'view', 'edit' ),
359
  ),
360
  ),
354
  ),
355
  'value' => array(
356
  'description' => __( 'Meta value.', 'woocommerce' ),
357
+ 'type' => 'mixed',
358
  'context' => array( 'view', 'edit' ),
359
  ),
360
  ),
includes/api/class-wc-rest-order-refunds-controller.php CHANGED
@@ -400,7 +400,7 @@ class WC_REST_Order_Refunds_Controller extends WC_REST_Orders_Controller {
400
  ),
401
  'value' => array(
402
  'description' => __( 'Meta value.', 'woocommerce' ),
403
- 'type' => 'string',
404
  'context' => array( 'view', 'edit' ),
405
  ),
406
  ),
@@ -421,12 +421,12 @@ class WC_REST_Order_Refunds_Controller extends WC_REST_Orders_Controller {
421
  ),
422
  'name' => array(
423
  'description' => __( 'Product name.', 'woocommerce' ),
424
- 'type' => 'string',
425
  'context' => array( 'view', 'edit' ),
426
  ),
427
  'product_id' => array(
428
  'description' => __( 'Product ID.', 'woocommerce' ),
429
- 'type' => 'integer',
430
  'context' => array( 'view', 'edit' ),
431
  ),
432
  'variation_id' => array(
@@ -512,7 +512,7 @@ class WC_REST_Order_Refunds_Controller extends WC_REST_Orders_Controller {
512
  ),
513
  'value' => array(
514
  'description' => __( 'Meta value.', 'woocommerce' ),
515
- 'type' => 'string',
516
  'context' => array( 'view', 'edit' ),
517
  ),
518
  ),
400
  ),
401
  'value' => array(
402
  'description' => __( 'Meta value.', 'woocommerce' ),
403
+ 'type' => 'mixed',
404
  'context' => array( 'view', 'edit' ),
405
  ),
406
  ),
421
  ),
422
  'name' => array(
423
  'description' => __( 'Product name.', 'woocommerce' ),
424
+ 'type' => 'mixed',
425
  'context' => array( 'view', 'edit' ),
426
  ),
427
  'product_id' => array(
428
  'description' => __( 'Product ID.', 'woocommerce' ),
429
+ 'type' => 'mixed',
430
  'context' => array( 'view', 'edit' ),
431
  ),
432
  'variation_id' => array(
512
  ),
513
  'value' => array(
514
  'description' => __( 'Meta value.', 'woocommerce' ),
515
+ 'type' => 'mixed',
516
  'context' => array( 'view', 'edit' ),
517
  ),
518
  ),
includes/api/class-wc-rest-orders-controller.php CHANGED
@@ -596,8 +596,9 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
596
  protected function maybe_set_item_meta_data( $item, $posted ) {
597
  if ( ! empty( $posted['meta_data'] ) && is_array( $posted['meta_data'] ) ) {
598
  foreach ( $posted['meta_data'] as $meta ) {
599
- if ( isset( $meta['key'], $meta['value'] ) ) {
600
- $item->update_meta_data( $meta['key'], $meta['value'], isset( $meta['id'] ) ? $meta['id'] : '' );
 
601
  }
602
  }
603
  }
@@ -1117,7 +1118,7 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
1117
  ),
1118
  'value' => array(
1119
  'description' => __( 'Meta value.', 'woocommerce' ),
1120
- 'type' => 'string',
1121
  'context' => array( 'view', 'edit' ),
1122
  ),
1123
  ),
@@ -1138,12 +1139,12 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
1138
  ),
1139
  'name' => array(
1140
  'description' => __( 'Product name.', 'woocommerce' ),
1141
- 'type' => 'string',
1142
  'context' => array( 'view', 'edit' ),
1143
  ),
1144
  'product_id' => array(
1145
  'description' => __( 'Product ID.', 'woocommerce' ),
1146
- 'type' => 'integer',
1147
  'context' => array( 'view', 'edit' ),
1148
  ),
1149
  'variation_id' => array(
@@ -1158,7 +1159,7 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
1158
  ),
1159
  'tax_class' => array(
1160
  'description' => __( 'Tax class of product.', 'woocommerce' ),
1161
- 'type' => 'integer',
1162
  'context' => array( 'view', 'edit' ),
1163
  ),
1164
  'subtotal' => array(
@@ -1229,7 +1230,7 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
1229
  ),
1230
  'value' => array(
1231
  'description' => __( 'Meta value.', 'woocommerce' ),
1232
- 'type' => 'string',
1233
  'context' => array( 'view', 'edit' ),
1234
  ),
1235
  ),
@@ -1243,7 +1244,7 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
1243
  ),
1244
  'price' => array(
1245
  'description' => __( 'Product price.', 'woocommerce' ),
1246
- 'type' => 'string',
1247
  'context' => array( 'view', 'edit' ),
1248
  'readonly' => true,
1249
  ),
@@ -1320,7 +1321,7 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
1320
  ),
1321
  'value' => array(
1322
  'description' => __( 'Meta value.', 'woocommerce' ),
1323
- 'type' => 'string',
1324
  'context' => array( 'view', 'edit' ),
1325
  ),
1326
  ),
@@ -1344,12 +1345,12 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
1344
  ),
1345
  'method_title' => array(
1346
  'description' => __( 'Shipping method name.', 'woocommerce' ),
1347
- 'type' => 'string',
1348
  'context' => array( 'view', 'edit' ),
1349
  ),
1350
  'method_id' => array(
1351
  'description' => __( 'Shipping method ID.', 'woocommerce' ),
1352
- 'type' => 'string',
1353
  'context' => array( 'view', 'edit' ),
1354
  ),
1355
  'total' => array(
@@ -1406,7 +1407,7 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
1406
  ),
1407
  'value' => array(
1408
  'description' => __( 'Meta value.', 'woocommerce' ),
1409
- 'type' => 'string',
1410
  'context' => array( 'view', 'edit' ),
1411
  ),
1412
  ),
@@ -1430,7 +1431,7 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
1430
  ),
1431
  'name' => array(
1432
  'description' => __( 'Fee name.', 'woocommerce' ),
1433
- 'type' => 'string',
1434
  'context' => array( 'view', 'edit' ),
1435
  ),
1436
  'tax_class' => array(
@@ -1504,7 +1505,7 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
1504
  ),
1505
  'value' => array(
1506
  'description' => __( 'Meta value.', 'woocommerce' ),
1507
- 'type' => 'string',
1508
  'context' => array( 'view', 'edit' ),
1509
  ),
1510
  ),
@@ -1528,7 +1529,7 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
1528
  ),
1529
  'code' => array(
1530
  'description' => __( 'Coupon code.', 'woocommerce' ),
1531
- 'type' => 'string',
1532
  'context' => array( 'view', 'edit' ),
1533
  ),
1534
  'discount' => array(
@@ -1562,7 +1563,7 @@ class WC_REST_Orders_Controller extends WC_REST_Legacy_Orders_Controller {
1562
  ),
1563
  'value' => array(
1564
  'description' => __( 'Meta value.', 'woocommerce' ),
1565
- 'type' => 'string',
1566
  'context' => array( 'view', 'edit' ),
1567
  ),
1568
  ),
596
  protected function maybe_set_item_meta_data( $item, $posted ) {
597
  if ( ! empty( $posted['meta_data'] ) && is_array( $posted['meta_data'] ) ) {
598
  foreach ( $posted['meta_data'] as $meta ) {
599
+ if ( isset( $meta['key'] ) ) {
600
+ $value = isset( $meta['value'] ) ? $meta['value'] : null;
601
+ $item->update_meta_data( $meta['key'], $value, isset( $meta['id'] ) ? $meta['id'] : '' );
602
  }
603
  }
604
  }
1118
  ),
1119
  'value' => array(
1120
  'description' => __( 'Meta value.', 'woocommerce' ),
1121
+ 'type' => 'mixed',
1122
  'context' => array( 'view', 'edit' ),
1123
  ),
1124
  ),
1139
  ),
1140
  'name' => array(
1141
  'description' => __( 'Product name.', 'woocommerce' ),
1142
+ 'type' => 'mixed',
1143
  'context' => array( 'view', 'edit' ),
1144
  ),
1145
  'product_id' => array(
1146
  'description' => __( 'Product ID.', 'woocommerce' ),
1147
+ 'type' => 'mixed',
1148
  'context' => array( 'view', 'edit' ),
1149
  ),
1150
  'variation_id' => array(
1159
  ),
1160
  'tax_class' => array(
1161
  'description' => __( 'Tax class of product.', 'woocommerce' ),
1162
+ 'type' => 'string',
1163
  'context' => array( 'view', 'edit' ),
1164
  ),
1165
  'subtotal' => array(
1230
  ),
1231
  'value' => array(
1232
  'description' => __( 'Meta value.', 'woocommerce' ),
1233
+ 'type' => 'mixed',
1234
  'context' => array( 'view', 'edit' ),
1235
  ),
1236
  ),
1244
  ),
1245
  'price' => array(
1246
  'description' => __( 'Product price.', 'woocommerce' ),
1247
+ 'type' => 'number',
1248
  'context' => array( 'view', 'edit' ),
1249
  'readonly' => true,
1250
  ),
1321
  ),
1322
  'value' => array(
1323
  'description' => __( 'Meta value.', 'woocommerce' ),
1324
+ 'type' => 'mixed',
1325
  'context' => array( 'view', 'edit' ),
1326
  ),
1327
  ),
1345
  ),
1346
  'method_title' => array(
1347
  'description' => __( 'Shipping method name.', 'woocommerce' ),
1348
+ 'type' => 'mixed',
1349
  'context' => array( 'view', 'edit' ),
1350
  ),
1351
  'method_id' => array(
1352
  'description' => __( 'Shipping method ID.', 'woocommerce' ),
1353
+ 'type' => 'mixed',
1354
  'context' => array( 'view', 'edit' ),
1355
  ),
1356
  'total' => array(
1407
  ),
1408
  'value' => array(
1409
  'description' => __( 'Meta value.', 'woocommerce' ),
1410
+ 'type' => 'mixed',
1411
  'context' => array( 'view', 'edit' ),
1412
  ),
1413
  ),
1431
  ),
1432
  'name' => array(
1433
  'description' => __( 'Fee name.', 'woocommerce' ),
1434
+ 'type' => 'mixed',
1435
  'context' => array( 'view', 'edit' ),
1436
  ),
1437
  'tax_class' => array(
1505
  ),
1506
  'value' => array(
1507
  'description' => __( 'Meta value.', 'woocommerce' ),
1508
+ 'type' => 'mixed',
1509
  'context' => array( 'view', 'edit' ),
1510
  ),
1511
  ),
1529
  ),
1530
  'code' => array(
1531
  'description' => __( 'Coupon code.', 'woocommerce' ),
1532
+ 'type' => 'mixed',
1533
  'context' => array( 'view', 'edit' ),
1534
  ),
1535
  'discount' => array(
1563
  ),
1564
  'value' => array(
1565
  'description' => __( 'Meta value.', 'woocommerce' ),
1566
+ 'type' => 'mixed',
1567
  'context' => array( 'view', 'edit' ),
1568
  ),
1569
  ),
includes/api/class-wc-rest-product-variations-controller.php CHANGED
@@ -945,7 +945,7 @@ class WC_REST_Product_Variations_Controller extends WC_REST_Products_Controller
945
  ),
946
  'value' => array(
947
  'description' => __( 'Meta value.', 'woocommerce' ),
948
- 'type' => 'string',
949
  'context' => array( 'view', 'edit' ),
950
  ),
951
  ),
945
  ),
946
  'value' => array(
947
  'description' => __( 'Meta value.', 'woocommerce' ),
948
+ 'type' => 'mixed',
949
  'context' => array( 'view', 'edit' ),
950
  ),
951
  ),
includes/api/class-wc-rest-products-controller.php CHANGED
@@ -1991,7 +1991,7 @@ class WC_REST_Products_Controller extends WC_REST_Legacy_Products_Controller {
1991
  ),
1992
  'value' => array(
1993
  'description' => __( 'Meta value.', 'woocommerce' ),
1994
- 'type' => 'string',
1995
  'context' => array( 'view', 'edit' ),
1996
  ),
1997
  ),
1991
  ),
1992
  'value' => array(
1993
  'description' => __( 'Meta value.', 'woocommerce' ),
1994
+ 'type' => 'mixed',
1995
  'context' => array( 'view', 'edit' ),
1996
  ),
1997
  ),
includes/api/v1/class-wc-rest-order-refunds-controller.php CHANGED
@@ -378,7 +378,7 @@ class WC_REST_Order_Refunds_V1_Controller extends WC_REST_Orders_V1_Controller {
378
  ),
379
  'name' => array(
380
  'description' => __( 'Product name.', 'woocommerce' ),
381
- 'type' => 'string',
382
  'context' => array( 'view', 'edit' ),
383
  'readonly' => true,
384
  ),
@@ -390,7 +390,7 @@ class WC_REST_Order_Refunds_V1_Controller extends WC_REST_Orders_V1_Controller {
390
  ),
391
  'product_id' => array(
392
  'description' => __( 'Product ID.', 'woocommerce' ),
393
- 'type' => 'integer',
394
  'context' => array( 'view', 'edit' ),
395
  ),
396
  'variation_id' => array(
@@ -486,7 +486,7 @@ class WC_REST_Order_Refunds_V1_Controller extends WC_REST_Orders_V1_Controller {
486
  ),
487
  'value' => array(
488
  'description' => __( 'Meta value.', 'woocommerce' ),
489
- 'type' => 'string',
490
  'context' => array( 'view', 'edit' ),
491
  'readonly' => true,
492
  ),
378
  ),
379
  'name' => array(
380
  'description' => __( 'Product name.', 'woocommerce' ),
381
+ 'type' => 'mixed',
382
  'context' => array( 'view', 'edit' ),
383
  'readonly' => true,
384
  ),
390
  ),
391
  'product_id' => array(
392
  'description' => __( 'Product ID.', 'woocommerce' ),
393
+ 'type' => 'mixed',
394
  'context' => array( 'view', 'edit' ),
395
  ),
396
  'variation_id' => array(
486
  ),
487
  'value' => array(
488
  'description' => __( 'Meta value.', 'woocommerce' ),
489
+ 'type' => 'mixed',
490
  'context' => array( 'view', 'edit' ),
491
  'readonly' => true,
492
  ),
includes/api/v1/class-wc-rest-orders-controller.php CHANGED
@@ -1211,7 +1211,7 @@ class WC_REST_Orders_V1_Controller extends WC_REST_Posts_Controller {
1211
  ),
1212
  'name' => array(
1213
  'description' => __( 'Product name.', 'woocommerce' ),
1214
- 'type' => 'string',
1215
  'context' => array( 'view', 'edit' ),
1216
  'readonly' => true,
1217
  ),
@@ -1223,7 +1223,7 @@ class WC_REST_Orders_V1_Controller extends WC_REST_Posts_Controller {
1223
  ),
1224
  'product_id' => array(
1225
  'description' => __( 'Product ID.', 'woocommerce' ),
1226
- 'type' => 'integer',
1227
  'context' => array( 'view', 'edit' ),
1228
  ),
1229
  'variation_id' => array(
@@ -1238,7 +1238,7 @@ class WC_REST_Orders_V1_Controller extends WC_REST_Posts_Controller {
1238
  ),
1239
  'tax_class' => array(
1240
  'description' => __( 'Tax class of product.', 'woocommerce' ),
1241
- 'type' => 'integer',
1242
  'context' => array( 'view', 'edit' ),
1243
  'readonly' => true,
1244
  ),
@@ -1319,7 +1319,7 @@ class WC_REST_Orders_V1_Controller extends WC_REST_Posts_Controller {
1319
  ),
1320
  'value' => array(
1321
  'description' => __( 'Meta value.', 'woocommerce' ),
1322
- 'type' => 'string',
1323
  'context' => array( 'view', 'edit' ),
1324
  'readonly' => true,
1325
  ),
@@ -1397,12 +1397,12 @@ class WC_REST_Orders_V1_Controller extends WC_REST_Posts_Controller {
1397
  ),
1398
  'method_title' => array(
1399
  'description' => __( 'Shipping method name.', 'woocommerce' ),
1400
- 'type' => 'string',
1401
  'context' => array( 'view', 'edit' ),
1402
  ),
1403
  'method_id' => array(
1404
  'description' => __( 'Shipping method ID.', 'woocommerce' ),
1405
- 'type' => 'string',
1406
  'context' => array( 'view', 'edit' ),
1407
  ),
1408
  'total' => array(
@@ -1457,7 +1457,7 @@ class WC_REST_Orders_V1_Controller extends WC_REST_Posts_Controller {
1457
  ),
1458
  'name' => array(
1459
  'description' => __( 'Fee name.', 'woocommerce' ),
1460
- 'type' => 'string',
1461
  'context' => array( 'view', 'edit' ),
1462
  ),
1463
  'tax_class' => array(
@@ -1528,7 +1528,7 @@ class WC_REST_Orders_V1_Controller extends WC_REST_Posts_Controller {
1528
  ),
1529
  'code' => array(
1530
  'description' => __( 'Coupon code.', 'woocommerce' ),
1531
- 'type' => 'string',
1532
  'context' => array( 'view', 'edit' ),
1533
  ),
1534
  'discount' => array(
1211
  ),
1212
  'name' => array(
1213
  'description' => __( 'Product name.', 'woocommerce' ),
1214
+ 'type' => 'mixed',
1215
  'context' => array( 'view', 'edit' ),
1216
  'readonly' => true,
1217
  ),
1223
  ),
1224
  'product_id' => array(
1225
  'description' => __( 'Product ID.', 'woocommerce' ),
1226
+ 'type' => 'mixed',
1227
  'context' => array( 'view', 'edit' ),
1228
  ),
1229
  'variation_id' => array(
1238
  ),
1239
  'tax_class' => array(
1240
  'description' => __( 'Tax class of product.', 'woocommerce' ),
1241
+ 'type' => 'string',
1242
  'context' => array( 'view', 'edit' ),
1243
  'readonly' => true,
1244
  ),
1319
  ),
1320
  'value' => array(
1321
  'description' => __( 'Meta value.', 'woocommerce' ),
1322
+ 'type' => 'mixed',
1323
  'context' => array( 'view', 'edit' ),
1324
  'readonly' => true,
1325
  ),
1397
  ),
1398
  'method_title' => array(
1399
  'description' => __( 'Shipping method name.', 'woocommerce' ),
1400
+ 'type' => 'mixed',
1401
  'context' => array( 'view', 'edit' ),
1402
  ),
1403
  'method_id' => array(
1404
  'description' => __( 'Shipping method ID.', 'woocommerce' ),
1405
+ 'type' => 'mixed',
1406
  'context' => array( 'view', 'edit' ),
1407
  ),
1408
  'total' => array(
1457
  ),
1458
  'name' => array(
1459
  'description' => __( 'Fee name.', 'woocommerce' ),
1460
+ 'type' => 'mixed',
1461
  'context' => array( 'view', 'edit' ),
1462
  ),
1463
  'tax_class' => array(
1528
  ),
1529
  'code' => array(
1530
  'description' => __( 'Coupon code.', 'woocommerce' ),
1531
+ 'type' => 'mixed',
1532
  'context' => array( 'view', 'edit' ),
1533
  ),
1534
  'discount' => array(
includes/class-wc-ajax.php CHANGED
@@ -594,7 +594,7 @@ class WC_AJAX {
594
  $product_object = wc_get_product( $product_id );
595
  $variation_object = new WC_Product_Variation();
596
  $variation_object->set_parent_id( $product_id );
597
- $variation_object->set_attributes( array_fill_keys( array_keys( $product_object->get_variation_attributes() ), '' ) );
598
  $variation_id = $variation_object->save();
599
  $variation = get_post( $variation_id );
600
  $variation_data = array_merge( array_map( 'maybe_unserialize', get_post_custom( $variation_id ) ), wc_get_product_variation_attributes( $variation_id ) ); // kept for BW compatibility.
594
  $product_object = wc_get_product( $product_id );
595
  $variation_object = new WC_Product_Variation();
596
  $variation_object->set_parent_id( $product_id );
597
+ $variation_object->set_attributes( array_fill_keys( array_map( 'sanitize_title', array_keys( $product_object->get_variation_attributes() ) ), '' ) );
598
  $variation_id = $variation_object->save();
599
  $variation = get_post( $variation_id );
600
  $variation_data = array_merge( array_map( 'maybe_unserialize', get_post_custom( $variation_id ) ), wc_get_product_variation_attributes( $variation_id ) ); // kept for BW compatibility.
includes/class-wc-cart-totals.php CHANGED
@@ -227,7 +227,7 @@ final class WC_Cart_Totals {
227
  $item->taxable = 'taxable' === $cart_item['data']->get_tax_status();
228
  $item->price_includes_tax = wc_prices_include_tax();
229
  $item->quantity = $cart_item['quantity'];
230
- $item->price = wc_add_number_precision_deep( $cart_item['data']->get_price() ) * $cart_item['quantity'];
231
  $item->product = $cart_item['data'];
232
  $item->tax_rates = $this->get_item_tax_rates( $item );
233
  $this->items[ $cart_item_key ] = $item;
@@ -349,8 +349,8 @@ final class WC_Cart_Totals {
349
  $shipping_line->tax_class = get_option( 'woocommerce_shipping_tax_class' );
350
  $shipping_line->taxable = true;
351
  $shipping_line->total = wc_add_number_precision_deep( $shipping_object->cost );
352
- $shipping_line->taxes = wc_add_number_precision_deep( $shipping_object->taxes );
353
- $shipping_line->total_tax = wc_add_number_precision_deep( array_sum( $shipping_object->taxes ) );
354
 
355
  if ( ! $this->round_at_subtotal() ) {
356
  $shipping_line->total_tax = wc_round_tax_total( $shipping_line->total_tax, wc_get_rounding_precision() );
227
  $item->taxable = 'taxable' === $cart_item['data']->get_tax_status();
228
  $item->price_includes_tax = wc_prices_include_tax();
229
  $item->quantity = $cart_item['quantity'];
230
+ $item->price = wc_add_number_precision_deep( $cart_item['data']->get_price() * $cart_item['quantity'] );
231
  $item->product = $cart_item['data'];
232
  $item->tax_rates = $this->get_item_tax_rates( $item );
233
  $this->items[ $cart_item_key ] = $item;
349
  $shipping_line->tax_class = get_option( 'woocommerce_shipping_tax_class' );
350
  $shipping_line->taxable = true;
351
  $shipping_line->total = wc_add_number_precision_deep( $shipping_object->cost );
352
+ $shipping_line->taxes = wc_add_number_precision_deep( $shipping_object->taxes, false );
353
+ $shipping_line->total_tax = wc_add_number_precision_deep( array_sum( $shipping_object->taxes ), false );
354
 
355
  if ( ! $this->round_at_subtotal() ) {
356
  $shipping_line->total_tax = wc_round_tax_total( $shipping_line->total_tax, wc_get_rounding_precision() );
includes/class-wc-checkout.php CHANGED
@@ -469,7 +469,7 @@ class WC_Checkout {
469
  * @param WC_Cart $cart
470
  */
471
  public function create_order_tax_lines( &$order, $cart ) {
472
- foreach ( array_keys( $cart->get_cart_contents_taxes() + $cart->get_shipping_taxes() ) as $tax_rate_id ) {
473
  if ( $tax_rate_id && apply_filters( 'woocommerce_cart_remove_taxes_zero_rate_id', 'zero-rated' ) !== $tax_rate_id ) {
474
  $item = new WC_Order_Item_Tax();
475
  $item->set_props( array(
469
  * @param WC_Cart $cart
470
  */
471
  public function create_order_tax_lines( &$order, $cart ) {
472
+ foreach ( array_keys( $cart->get_cart_contents_taxes() + $cart->get_shipping_taxes() + $cart->get_fee_taxes() ) as $tax_rate_id ) {
473
  if ( $tax_rate_id && apply_filters( 'woocommerce_cart_remove_taxes_zero_rate_id', 'zero-rated' ) !== $tax_rate_id ) {
474
  $item = new WC_Order_Item_Tax();
475
  $item->set_props( array(
includes/class-woocommerce.php CHANGED
@@ -25,7 +25,7 @@ final class WooCommerce {
25
  *
26
  * @var string
27
  */
28
- public $version = '3.2.4';
29
 
30
  /**
31
  * The single instance of the class.
25
  *
26
  * @var string
27
  */
28
+ public $version = '3.2.5';
29
 
30
  /**
31
  * The single instance of the class.
includes/data-stores/class-wc-product-data-store-cpt.php CHANGED
@@ -374,16 +374,14 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
374
  /**
375
  * Read attributes from post meta.
376
  *
377
- * @param WC_Product
378
- * @since 3.0.0
379
  */
380
  protected function read_attributes( &$product ) {
381
- $meta_values = get_post_meta( $product->get_id(), '_product_attributes', true );
382
 
383
- if ( ! empty( $meta_values ) && is_array( $meta_values ) ) {
384
  $attributes = array();
385
- foreach ( $meta_values as $meta_value ) {
386
- $id = 0;
387
  $meta_value = array_merge( array(
388
  'name' => '',
389
  'value' => '',
@@ -391,7 +389,7 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
391
  'is_visible' => 0,
392
  'is_variation' => 0,
393
  'is_taxonomy' => 0,
394
- ), (array) $meta_value );
395
 
396
  // Check if is a taxonomy attribute.
397
  if ( ! empty( $meta_value['is_taxonomy'] ) ) {
@@ -401,11 +399,11 @@ class WC_Product_Data_Store_CPT extends WC_Data_Store_WP implements WC_Object_Da
401
  $id = wc_attribute_taxonomy_id_by_name( $meta_value['name'] );
402
  $options = wc_get_object_terms( $product->get_id(), $meta_value['name'], 'term_id' );
403
  } else {
 
404
  $options = wc_get_text_attributes( $meta_value['value'] );
405
  }
406
 
407
  $attribute = new WC_Product_Attribute();
408
-
409
  $attribute->set_id( $id );
410
  $attribute->set_name( $meta_value['name'] );
411
  $attribute->set_options( $options );
374
  /**
375
  * Read attributes from post meta.
376
  *
377
+ * @param WC_Product $product Product object.
 
378
  */
379
  protected function read_attributes( &$product ) {
380
+ $meta_attributes = get_post_meta( $product->get_id(), '_product_attributes', true );
381
 
382
+ if ( ! empty( $meta_attributes ) && is_array( $meta_attributes ) ) {
383
  $attributes = array();
384
+ foreach ( $meta_attributes as $meta_attribute_key => $meta_attribute_value ) {
 
385
  $meta_value = array_merge( array(
386
  'name' => '',
387
  'value' => '',
389
  'is_visible' => 0,
390
  'is_variation' => 0,
391
  'is_taxonomy' => 0,
392
+ ), (array) $meta_attribute_value );
393
 
394
  // Check if is a taxonomy attribute.
395
  if ( ! empty( $meta_value['is_taxonomy'] ) ) {
399
  $id = wc_attribute_taxonomy_id_by_name( $meta_value['name'] );
400
  $options = wc_get_object_terms( $product->get_id(), $meta_value['name'], 'term_id' );
401
  } else {
402
+ $id = 0;
403
  $options = wc_get_text_attributes( $meta_value['value'] );
404
  }
405
 
406
  $attribute = new WC_Product_Attribute();
 
407
  $attribute->set_id( $id );
408
  $attribute->set_name( $meta_value['name'] );
409
  $attribute->set_options( $options );
includes/data-stores/class-wc-product-variable-data-store-cpt.php CHANGED
@@ -19,6 +19,73 @@ class WC_Product_Variable_Data_Store_CPT extends WC_Product_Data_Store_CPT imple
19
  */
20
  protected $prices_array = array();
21
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
  /**
23
  * Read product data.
24
  *
19
  */
20
  protected $prices_array = array();
21
 
22
+ /**
23
+ * Read attributes from post meta.
24
+ *
25
+ * @param WC_Product $product Product object.
26
+ */
27
+ protected function read_attributes( &$product ) {
28
+ $meta_attributes = get_post_meta( $product->get_id(), '_product_attributes', true );
29
+
30
+ if ( ! empty( $meta_attributes ) && is_array( $meta_attributes ) ) {
31
+ $attributes = array();
32
+ $force_update = false;
33
+ foreach ( $meta_attributes as $meta_attribute_key => $meta_attribute_value ) {
34
+ $meta_value = array_merge( array(
35
+ 'name' => '',
36
+ 'value' => '',
37
+ 'position' => 0,
38
+ 'is_visible' => 0,
39
+ 'is_variation' => 0,
40
+ 'is_taxonomy' => 0,
41
+ ), (array) $meta_attribute_value );
42
+
43
+ // Maintain data integrity. 4.9 changed sanitization functions - update the values here so variations function correctly.
44
+ if ( $meta_value['is_variation'] && strstr( $meta_value['name'], '/' ) && sanitize_title( $meta_value['name'] ) !== $meta_attribute_key ) {
45
+ global $wpdb;
46
+
47
+ $old_slug = 'attribute_' . $meta_attribute_key;
48
+ $new_slug = 'attribute_' . sanitize_title( $meta_value['name'] );
49
+ $old_meta_rows = $wpdb->get_results( $wpdb->prepare( "SELECT post_id, meta_value FROM {$wpdb->postmeta} WHERE meta_key = %s;", $old_slug ) ); // WPCS: db call ok, cache ok.
50
+
51
+ if ( $old_meta_rows ) {
52
+ foreach ( $old_meta_rows as $old_meta_row ) {
53
+ update_post_meta( $old_meta_row->post_id, $new_slug, $old_meta_row->meta_value );
54
+ }
55
+ }
56
+
57
+ $force_update = true;
58
+ }
59
+
60
+ // Check if is a taxonomy attribute.
61
+ if ( ! empty( $meta_value['is_taxonomy'] ) ) {
62
+ if ( ! taxonomy_exists( $meta_value['name'] ) ) {
63
+ continue;
64
+ }
65
+ $id = wc_attribute_taxonomy_id_by_name( $meta_value['name'] );
66
+ $options = wc_get_object_terms( $product->get_id(), $meta_value['name'], 'term_id' );
67
+ } else {
68
+ $id = 0;
69
+ $options = wc_get_text_attributes( $meta_value['value'] );
70
+ }
71
+
72
+ $attribute = new WC_Product_Attribute();
73
+ $attribute->set_id( $id );
74
+ $attribute->set_name( $meta_value['name'] );
75
+ $attribute->set_options( $options );
76
+ $attribute->set_position( $meta_value['position'] );
77
+ $attribute->set_visible( $meta_value['is_visible'] );
78
+ $attribute->set_variation( $meta_value['is_variation'] );
79
+ $attributes[] = $attribute;
80
+ }
81
+ $product->set_attributes( $attributes );
82
+
83
+ if ( $force_update ) {
84
+ $this->update_attributes( $product, true );
85
+ }
86
+ }
87
+ }
88
+
89
  /**
90
  * Read product data.
91
  *
includes/shortcodes/class-wc-shortcode-products.php CHANGED
@@ -488,6 +488,8 @@ class WC_Shortcode_Products {
488
  update_meta_cache( 'post', $products_ids );
489
  update_object_term_cache( $products_ids, 'product' );
490
 
 
 
491
  do_action( "woocommerce_shortcode_before_{$this->type}_loop", $this->attributes );
492
 
493
  woocommerce_product_loop_start();
@@ -507,15 +509,17 @@ class WC_Shortcode_Products {
507
  remove_action( 'woocommerce_product_is_visible', array( $this, 'set_product_as_visible' ) );
508
  }
509
 
 
510
  woocommerce_product_loop_end();
511
 
512
  do_action( "woocommerce_shortcode_after_{$this->type}_loop", $this->attributes );
 
 
513
  } else {
514
  do_action( "woocommerce_shortcode_{$this->type}_loop_no_results", $this->attributes );
515
  }
516
 
517
  woocommerce_reset_loop();
518
- wp_reset_postdata();
519
 
520
  return '<div class="' . esc_attr( implode( ' ', $classes ) ) . '">' . ob_get_clean() . '</div>';
521
  }
488
  update_meta_cache( 'post', $products_ids );
489
  update_object_term_cache( $products_ids, 'product' );
490
 
491
+ $original_post = $GLOBALS['post'];
492
+
493
  do_action( "woocommerce_shortcode_before_{$this->type}_loop", $this->attributes );
494
 
495
  woocommerce_product_loop_start();
509
  remove_action( 'woocommerce_product_is_visible', array( $this, 'set_product_as_visible' ) );
510
  }
511
 
512
+ $GLOBALS['post'] = $original_post; // WPCS: override ok.
513
  woocommerce_product_loop_end();
514
 
515
  do_action( "woocommerce_shortcode_after_{$this->type}_loop", $this->attributes );
516
+
517
+ wp_reset_postdata();
518
  } else {
519
  do_action( "woocommerce_shortcode_{$this->type}_loop_no_results", $this->attributes );
520
  }
521
 
522
  woocommerce_reset_loop();
 
523
 
524
  return '<div class="' . esc_attr( implode( ' ', $classes ) ) . '">' . ob_get_clean() . '</div>';
525
  }
includes/wc-core-functions.php CHANGED
@@ -1483,11 +1483,13 @@ function wc_get_rounding_precision() {
1483
  *
1484
  * @since 3.2.0
1485
  * @param float $value Number to add precision to.
1486
- * @return int
 
1487
  */
1488
- function wc_add_number_precision( $value ) {
1489
  $precision = pow( 10, wc_get_price_decimals() );
1490
- return intval( round( $value * $precision ) );
 
1491
  }
1492
 
1493
  /**
@@ -1507,15 +1509,16 @@ function wc_remove_number_precision( $value ) {
1507
  *
1508
  * @since 3.2.0
1509
  * @param array $value Number to add precision to.
 
1510
  * @return int
1511
  */
1512
- function wc_add_number_precision_deep( $value ) {
1513
  if ( is_array( $value ) ) {
1514
  foreach ( $value as $key => $subvalue ) {
1515
- $value[ $key ] = wc_add_number_precision_deep( $subvalue );
1516
  }
1517
  } else {
1518
- $value = wc_add_number_precision( $value );
1519
  }
1520
  return $value;
1521
  }
1483
  *
1484
  * @since 3.2.0
1485
  * @param float $value Number to add precision to.
1486
+ * @param bool $round Should we round after adding precision?
1487
+ * @return int|float
1488
  */
1489
+ function wc_add_number_precision( $value, $round = true ) {
1490
  $precision = pow( 10, wc_get_price_decimals() );
1491
+ $value = $value * $precision;
1492
+ return $round ? intval( round( $value ) ) : $value;
1493
  }
1494
 
1495
  /**
1509
  *
1510
  * @since 3.2.0
1511
  * @param array $value Number to add precision to.
1512
+ * @param bool $round Should we round after adding precision?
1513
  * @return int
1514
  */
1515
+ function wc_add_number_precision_deep( $value, $round = true ) {
1516
  if ( is_array( $value ) ) {
1517
  foreach ( $value as $key => $subvalue ) {
1518
+ $value[ $key ] = wc_add_number_precision_deep( $subvalue, $round );
1519
  }
1520
  } else {
1521
+ $value = wc_add_number_precision( $value, $round );
1522
  }
1523
  return $value;
1524
  }
includes/wc-template-functions.php CHANGED
@@ -412,7 +412,7 @@ function wc_query_string_form_fields( $values = null, $exclude = array(), $curre
412
  if ( is_array( $value ) ) {
413
  $html .= wc_query_string_form_fields( $value, $exclude, $key, true );
414
  } else {
415
- $html .= '<input type="hidden" name="' . esc_attr( $key ) . '" value="' . esc_attr( $value ) . '" />';
416
  }
417
  }
418
 
412
  if ( is_array( $value ) ) {
413
  $html .= wc_query_string_form_fields( $value, $exclude, $key, true );
414
  } else {
415
+ $html .= '<input type="hidden" name="' . esc_attr( $key ) . '" value="' . esc_attr( wp_unslash( $value ) ) . '" />';
416
  }
417
  }
418
 
includes/widgets/class-wc-widget-layered-nav-filters.php CHANGED
@@ -72,7 +72,7 @@ class WC_Widget_Layered_Nav_Filters extends WC_Widget {
72
  * To support quote characters, first they are decoded from &quot; entities, then URL encoded.
73
  */
74
  if ( get_search_query() ) {
75
- $link = add_query_arg( 's', rawurlencode( htmlspecialchars_decode( get_search_query() ) ), $link );
76
  }
77
 
78
  // Post Type Arg
72
  * To support quote characters, first they are decoded from &quot; entities, then URL encoded.
73
  */
74
  if ( get_search_query() ) {
75
+ $link = add_query_arg( 's', rawurlencode( htmlspecialchars_decode( get_search_query( false ) ) ), $link );
76
  }
77
 
78
  // Post Type Arg
includes/widgets/class-wc-widget-layered-nav.php CHANGED
@@ -255,7 +255,7 @@ class WC_Widget_Layered_Nav extends WC_Widget {
255
  continue;
256
  }
257
 
258
- echo '<option value="' . esc_attr( $term->slug ) . '" ' . selected( $option_is_set, true, false ) . '>' . esc_html( $term->name ) . '</option>';
259
  }
260
 
261
  echo '</select>';
@@ -347,7 +347,7 @@ class WC_Widget_Layered_Nav extends WC_Widget {
347
  * To support quote characters, first they are decoded from &quot; entities, then URL encoded.
348
  */
349
  if ( get_search_query() ) {
350
- $link = add_query_arg( 's', rawurlencode( htmlspecialchars_decode( get_search_query() ) ), $link );
351
  }
352
 
353
  // Post Type Arg
255
  continue;
256
  }
257
 
258
+ echo '<option value="' . esc_attr( urldecode( $term->slug ) ) . '" ' . selected( $option_is_set, true, false ) . '>' . esc_html( $term->name ) . '</option>';
259
  }
260
 
261
  echo '</select>';
347
  * To support quote characters, first they are decoded from &quot; entities, then URL encoded.
348
  */
349
  if ( get_search_query() ) {
350
+ $link = add_query_arg( 's', rawurlencode( htmlspecialchars_decode( get_search_query( false ) ) ), $link );
351
  }
352
 
353
  // Post Type Arg
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: automattic, mikejolley, jameskoster, claudiosanches, jshreve, code
3
  Tags: ecommerce, e-commerce, store, sales, sell, shop, cart, checkout, downloadable, downloads, paypal, storefront, woo commerce
4
  Requires at least: 4.4
5
  Tested up to: 4.9
6
- Stable tag: 3.2.4
7
  License: GPLv3
8
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
9
 
@@ -160,6 +160,16 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woocommerce/wo
160
 
161
  == Changelog ==
162
 
 
 
 
 
 
 
 
 
 
 
163
  = 3.2.4 - 2017-11-16 =
164
  * Fix - Cache IDs in shortcodes rather than query objects.
165
  * Fix - Fix float rounding issues in cart with currencies like Bitcoin.
3
  Tags: ecommerce, e-commerce, store, sales, sell, shop, cart, checkout, downloadable, downloads, paypal, storefront, woo commerce
4
  Requires at least: 4.4
5
  Tested up to: 4.9
6
+ Stable tag: 3.2.5
7
  License: GPLv3
8
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
9
 
160
 
161
  == Changelog ==
162
 
163
+ = 3.2.5 - 2017-11-22 =
164
+ * Fix - WordPress 4.9 - REST API - Updated schema, sanitization, and validation callbacks to support correct data types.
165
+ * Fix - WordPress 4.9 - Fix an issue saving variation attributes on new products and with attributes containing slashes.
166
+ * Fix - Save fee tax lines to new orders on checkout.
167
+ * Fix - Restore the post global after rendering product shortcodes.
168
+ * Fix - Fix product filtering when searching for a string including quote characters.
169
+ * Fix - Fix layered nav drop-downs containing unicode characters.
170
+ * Fix - Fix an edge case rounding bug with shipping taxes, and another with non-integer quantities.
171
+ * Fix - Set correct defaults when adding a new shipping class in admin.
172
+
173
  = 3.2.4 - 2017-11-16 =
174
  * Fix - Cache IDs in shortcodes rather than query objects.
175
  * Fix - Fix float rounding issues in cart with currencies like Bitcoin.
woocommerce.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WooCommerce
4
  * Plugin URI: https://woocommerce.com/
5
  * Description: An e-commerce toolkit that helps you sell anything. Beautifully.
6
- * Version: 3.2.4
7
  * Author: Automattic
8
  * Author URI: https://woocommerce.com
9
  * Requires at least: 4.4
3
  * Plugin Name: WooCommerce
4
  * Plugin URI: https://woocommerce.com/
5
  * Description: An e-commerce toolkit that helps you sell anything. Beautifully.
6
+ * Version: 3.2.5
7
  * Author: Automattic
8
  * Author URI: https://woocommerce.com
9
  * Requires at least: 4.4