Commit Graph

9946 Commits

Author SHA1 Message Date
Claudio Sanches 4e653139b6 Merge pull request #13117 from woocommerce/fix-12973
Moved refund logic
2017-02-08 16:15:54 -02:00
Claudiu Lodromanean 4525f91223 Merge pull request #13112 from woocommerce/fix-13106
Don't round values in get_on_sale_products
2017-02-08 10:14:52 -08:00
Claudio Sanches 3f2f313161 Merge pull request #13118 from woocommerce/fix-12955
Fix type setting in API
2017-02-08 16:14:05 -02:00
Mike Jolley edbee7db5a Merge pull request #13115 from woocommerce/fix-12811
Define min and max price, not all variation prices, in schema
2017-02-08 18:09:48 +00:00
Mike Jolley 3cf772bcb5 Always use type arg 2017-02-08 18:08:13 +00:00
Mike Jolley eb150724c4 Make sure calculations are redone after setting line items
Closes #13075
2017-02-08 17:23:40 +00:00
Claudiu Lodromanean dce81b4d4e Use store's decimal settings when figuring out what's a sale product 2017-02-08 09:04:13 -08:00
Mike Jolley 11ef37880b Moved logic to wc_create_refund 2017-02-08 16:20:42 +00:00
Mike Jolley 52291e003c wrong method name 2017-02-08 16:20:05 +00:00
Mike Jolley b5572fc041 wc_create_refund should handle payment and stock 2017-02-08 16:19:47 +00:00
Mike Jolley af6ee6d420 Fix; wrong method calls 2017-02-08 16:19:13 +00:00
Mike Jolley c63cec32b9 Fix; prevent duplicate queries 2017-02-08 16:19:01 +00:00
Mike Jolley b391e64453 Fix; Deprecated methods should return 2017-02-08 16:18:42 +00:00
akashsonic cb42768164 Added exit after wp_safe_redirect.
Here not add exit after wp_safe_redirect.
2017-02-08 17:52:06 +05:30
Mike Jolley dd70417758 Fix offset direction for schedule sales cron
Fixes #13105
2017-02-08 12:08:49 +00:00
Mike Jolley 66bceedbf8 Send min and max price, not all variation prices
Closes #12811
2017-02-08 11:40:04 +00:00
Mike Jolley 649f55b494 Load default country/state on edit
Closes #13061 Fixes #12899
2017-02-08 10:56:00 +00:00
Mike Jolley 3b06660edf Merge pull request #12917 from woocommerce/12170-rtl
#12170 Set up RTL generation and enqueuing
2017-02-08 10:29:55 +00:00
Mike Jolley 718149f1d4 Merge pull request #12999 from thenbrent/add_sort_variation_prices
Move price sorting into WC_Product_Variable::sort_variation_prices()
2017-02-08 10:29:30 +00:00
Brent Shepherd a9a83ebae2 Add 'woocommerce_variable_product_synced' filter 2017-02-07 14:05:17 -08:00
Brent Shepherd 81ef55ef42 Add woocommerce_variable_product_sync_before_save
Removing woocommerce_variable_product_nsync filter and $save param.
2017-02-07 13:57:24 -08:00
Claudiu Lodromanean 06c17d6be4 Add whitespace between parens 2017-02-07 13:57:01 -08:00
Brent Shepherd d4ff61814a Deprecate 'woocommerce_variable_product_sync' 2017-02-07 13:51:21 -08:00
Claudiu Lodromanean 8ce5356943 13106 Dont round values in get_on_sale_products 2017-02-07 13:46:00 -08:00
Brent Shepherd dcec16f749 Merge branch 'master' into variable_product_sync_filters
Conflicts:
	includes/class-wc-product-variable.php
2017-02-07 13:43:02 -08:00
Claudiu Lodromanean 173c09dd04 Fix failing tests and array_merge error 2017-02-07 10:46:03 -08:00
Mike Jolley 5888ef5b93 Convert standard to '' in CRUD
Closes #12896
2017-02-07 17:22:04 +00:00
Mike Jolley fcae260b43 Missing placeholder 2017-02-07 17:07:11 +00:00
Mike Jolley 09f2c6b89a Add locale independent wc_get_permalink_structure function 2017-02-07 16:16:45 +00:00
Mike Jolley b08449e502 Payment method display
Fixes #12830
2017-02-07 14:51:21 +00:00
Mike Jolley 4dea9d7b81 Merge pull request #13100 from divadmts/fix-external
External product add_to_cart_text function's hook used
2017-02-07 13:43:54 +01:00
Mike Jolley a4f87293ca Inherit shipping class id from parent 2017-02-07 12:35:24 +00:00
Mike Jolley b14d1ecbc9 Merge pull request #13101 from woocommerce/fix-13051
Exit after redirect to prevent incorrect headers being set by wp_die
2017-02-06 19:12:17 +01:00
Mike Jolley c61b4bf35c wc_add_to_cart_message_html filter which passes in full array of products and qty
Closes #12824
2017-02-06 18:11:54 +00:00
Claudiu Lodromanean e45adc14ed Bring up-to-date with master 2017-02-06 10:10:41 -08:00
Mike Jolley 23cc478bc9 Exit after redirect to prevent incorrect headers being set by wp_die 2017-02-06 17:59:31 +00:00
Mike Jolley b19be41994 Added since to WC_Data docblocks
Closes #13056
2017-02-06 17:06:20 +00:00
divadmts 8df243fdbf
use woocommerce_product_add_to_cart_text hook 2017-02-07 01:04:34 +08:00
Mike Jolley c44fffe35b If woocommerce_adjust_non_base_location_prices is false, remove modded tax, not base tax 2017-02-06 16:56:14 +00:00
Mike Jolley 32d5e3d6f0 Merge pull request #13076 from woocommerce/fix/shipping-total-when-no-shipping-methods
Fix empty string case for `WC_Order::get_total_shipping`
2017-02-06 16:29:20 +01:00
Boro Sitnikovski 5a0b70f291 Fix empty string case for `WC_Order::get_total_shipping` 2017-02-06 14:41:19 +01:00
Mike Jolley 1ef593ff16 Merge pull request #13046 from thenbrent/merge_extra_data
Merge WC_Data::$extra_data in WC_Data::__construct()
2017-02-06 13:08:53 +01:00
Mike Jolley 1f89d2f22e Merge pull request #13063 from thenbrent/remove_unused_param
Remove 'edit' param from calls to WC_Product_Variable::get_visible_children()
2017-02-06 12:55:53 +01:00
Mike Jolley 09f7b0493e Merge pull request #13042 from woocommerce/legacy-order-date-format
Fix legacy order dates format
2017-02-06 12:51:41 +01:00
Mike Jolley 908439c972 Merge pull request #13036 from chrislam/fix/ambiguous-column-names
Added table alias so that the column names in the `ORDER BY` and `GROUP BY` clauses are not ambiguous
2017-02-06 12:51:24 +01:00
Mike Jolley 58118997a9 Merge pull request #13069 from jaydeeprami/Fix-Issue-13067
Fixed issue ref #13067
2017-02-06 12:36:53 +01:00
Jaydeep 91cd899989 Fixed issue ref #13067 2017-02-06 14:35:55 +05:30
Brent Shepherd f768f9f04b Add new variable product sync hook
To provide a way for callbacks to modify the actual instance of the
variable product being sync'd, especially before its saved, in case
it needs to sync some meta data or other prop that can be set on the
object itself.
2017-02-03 15:30:56 -08:00
Brent Shepherd a6bed34358 Remoe unused 'edit' param
To avoid a merge conflict with #13063
2017-02-03 15:10:19 -08:00
Brent Shepherd 7e61cb8a24 Trigger variable product sync hook after save
Because only a product ID is passed to callbacks on 'woocommerce_variable_product_sync',
they will need to instantiate their own instance of the product to do anything useful
with it. This creates a lot of potential for problems given that the product has at that
stage had its data sync'd but not all of it saved. For example, a callback may modify some
meta data on its own instance of the product, then save that, only to immediately have
that overridden if the instance of $product in WC_Product_Variable::sync() also had changes
to that meta data.

Instead, trigger 'woocommerce_variable_product_sync' only after the product has been
saved. This is backward compatible because the hook was triggered at the very end of
the process in WC < 2.7.
2017-02-03 15:01:36 -08:00
Brent Shepherd 8431b2ac86 Remove 'edit' param on get_visible_children()
The WC_Product_Variable::get_visible_children() method accepts no parameters.
2017-02-03 14:53:03 -08:00
Mike Jolley 497b4d986c Merge pull request #13047 from thenbrent/backward_compat_for_email_order_items
Reinstate old show/hide logic for download links and purchase notes in email order item table
2017-02-03 11:02:17 +01:00
Mike Jolley 244b42eae8 Merge pull request #13048 from woocommerce/fix/cart-discount-call
Fix call to non-existent method for cart_discount.
2017-02-03 11:00:54 +01:00
Brent Shepherd 4147935990 Fix undefined index notice in WC_Webhook 2017-02-02 12:52:00 -08:00
Brent Shepherd fe7e280ea0 Reinstate woocommerce_email_order_items_args hook 2017-02-02 12:26:59 -08:00
Claudio Sanches 5eb08aeda6 [REST API] Cast int for batch delete 2017-02-02 19:09:45 +01:00
Mike Jolley 2ec4b8cf7f Revert "Get rating count should use is_array"
This reverts commit 0625a2b759.
2017-02-02 18:43:43 +01:00
Mike Jolley 0625a2b759 Get rating count should use is_array 2017-02-02 18:35:30 +01:00
Boro Sitnikovski 5f05b2e3d8 Fix call to non-existant method for cart_discount. 2017-02-02 09:45:09 +01:00
Brent Shepherd 75bcbbf959 Maintain old show/hide email order item logic
When SHA: 7b3a9b introduced wc_get_email_order_items(), it slightly
changed the logic applied to determine whether to display:
* download links; and
* purchase notes.

In WC 2.6.13 and older, WC_Abstract_Order::email_order_items_table()
would only display download links and purchase note in emails *not*
sent to the admin. This patch preserves that behaviour.
2017-02-01 18:12:21 -08:00
Brent Shepherd 010a208e88 Merge WC_Data::$extra_data in WC_Data::__construct
Rather than requiring child classes to merge it as well as define it.
If it's not defined in a child class, then the merge call will have no
effect as it will be an the empty array set in WC_Data, if they do define
it, WC_Data will now take care of it automatically rather than requiring
manually merging it in the child class's constructor before it has any
effect on that objects data.

This helps reduce duplicate code by removing this from child classes, and
in some cases, being able to remove the child constructor definitions
entirely. It also avoids a gotcha for developers setting their own
$extra_data values only to find they aren't being set on the $data
property.
2017-02-01 12:48:27 -08:00
Mike Jolley e46b256c67 Use cron to send emails to avoid long page load times on checkout 2017-02-01 20:08:18 +01:00
Mike Jolley ed51c8ac13 Pass order object to emails 2017-02-01 17:54:47 +01:00
Mike Jolley 3529d7cafd Cache items 2017-02-01 14:54:18 +01:00
Mike Jolley 31308403d4 Use variables to save values in item crud. 2017-02-01 10:53:53 +01:00
Claudiu Lodromanean 9fadeacfdc Tweak shipping zones button styling to handle RTL better 2017-02-01 10:25:42 +01:00
Claudio Sanches 54e35648e2 Fixed legacy date format 2017-02-01 10:11:19 +01:00
Claudio Sanches 247c9aff50 Merge pull request #13032 from woocommerce/fix/order-date-direct-access
Fix direct access to order_date property
2017-02-01 10:00:06 +01:00
Claudio Sanches 79256504a1 [REST API] Products endpoint fixes, closes #13031 2017-02-01 09:58:04 +01:00
Mike Jolley 3a3588c92c Check product once 2017-02-01 02:11:56 +01:00
Mike Jolley 5a2b07763d Update metadata directly 2017-02-01 02:03:18 +01:00
Mike Jolley 5e2f1de36b get id once 2017-02-01 01:44:16 +01:00
Mike Jolley 2d013eb5be Handle wp prefix in php 2017-02-01 01:43:52 +01:00
Brent Shepherd 7a7c0fbce6 Add WC_Abstract_Order::get_valid_statuses()
So that classes which extend WC_Abstract_Order can define custom statuses
specifically for their order type and have those used for validation in
WC_Abstract_Order::set_status() instead of only the order statuses defined
by wc_get_order_statuses().

For example, the subscription order type has a number of custom order statuses,
like 'wc-active' and 'wc-expired', which do not apply to orders but are valid
statuses for WC_Subscription objects, which extend WC_Abstract_Order.
2017-01-31 15:00:03 -08:00
Chris Lam 502fa930ba Fixes #13035 - Added table alias so that the column names in the `ORDER BY` and `GROUP BY` clauses are not ambiguous 2017-02-01 11:58:54 +13:00
Boro Sitnikovski 58d7e6d940 Fix direct access of order_date property 2017-01-31 17:29:09 +01:00
Mike Jolley 5b221b4ed0 Edit context
#12936
2017-01-31 17:26:49 +01:00
Mike Jolley efcbdc3031 Tweaks for #12805
Closes #12805
2017-01-31 17:25:57 +01:00
Claudiu Lodromanean da22e021f9 Tweak admin tabs CSS to look good in LTR and RTL modes. 2017-01-31 10:09:56 +01:00
Mike Jolley 724f832b40 Fix get_template_loader_files
Fixes #12958
2017-01-31 09:56:27 +01:00
Mike Jolley 22260bfb96 Merge pull request #13021 from Chouby/ajax_wp_die
Use wp_die instead of die in ajax responses
2017-01-31 09:45:46 +01:00
Mike Jolley a4b3244d7b Merge pull request #13028 from woocommerce/fix-13027
Allow password resets when account page isn’t set
2017-01-31 09:45:16 +01:00
Mike Jolley 429b7534bb Merge pull request #13029 from woocommerce/fix-13025
Fix wording on deprecation messages
2017-01-31 09:39:57 +01:00
Mike Jolley dee73d4056 Use edit context on load
Closes #12936
2017-01-31 09:39:19 +01:00
Caleb Burks df7f3533bc Fix wording on deprecation messages 2017-01-30 23:40:21 -06:00
Caleb Burks 9b22886a0d Allow password resets when account page isn’t set 2017-01-30 22:59:32 -06:00
Mike Jolley 55c9554ace Use MDL
Closes #13016
2017-01-30 10:35:47 +01:00
Frédéric Demarle 4075024bb9 Use wp_die intead of die in ajax responses 2017-01-29 21:43:25 +01:00
Frédéric Demarle e03000126e Check SHOP_IS_ON_FRONT existence before defining it 2017-01-29 21:32:26 +01:00
Mike Jolley abe87d9bfa Merge pull request #12967 from woocommerce/fix/variation-get-name
Clean up variation names.
2017-01-27 17:01:34 +00:00
Claudio Sanches 346e1ea1e0 Merge pull request #12996 from woocommerce/rest-api-missing-types-args
REST API Types
2017-01-27 14:49:35 -02:00
Mike Jolley 6a997ec6b2 Merge pull request #13001 from thenbrent/honour_default_checkout_get_value
Honour default checkout_get_value
2017-01-27 16:42:32 +00:00
Mike Jolley 365b456fa5 Make sure product is set. 2017-01-27 16:39:53 +00:00
Claudio Sanches 24a5fe7592 Make WC_REST_Exception extend WC_Data_Exception 2017-01-27 13:52:21 -02:00
Mike Jolley 4abe2b8025 Disable smooth height for #12868 2017-01-27 15:37:35 +00:00
Mike Jolley 46367710ee Default themes get theme support 2017-01-27 15:35:06 +00:00
Claudio Sanches 8c84836423 Merge pull request #12998 from todeveni/patch-3
Cast position as integer
2017-01-27 13:20:52 -02:00
Claudio Sanches 80bc7128be Merge pull request #13002 from thenbrent/fix_undefined_variable_function
Fix "Undefined variable: function" notice
2017-01-27 13:19:07 -02:00
Mike Jolley bf24ba395d Use get_theme_support for gallery features 2017-01-27 14:13:54 +00:00
Brent Shepherd 0e393da2cd Fix woocommerce_order_add_product deprecation msg 2017-01-26 16:58:47 -08:00
Brent Shepherd 5e77311384 Fix deprecated action messages
Don't end sentence with double .. and instead of "Replace with Use CRUD"
just say "Replace with CRUD"
2017-01-26 16:44:28 -08:00
Brent Shepherd 7a77c70d2a Fix "Undefined variable: function" notice
Triggered whenever wc_deprecated_argument() is called in an Ajax request.

Related to #12889
2017-01-26 16:31:11 -08:00
Brent Shepherd 50da0ebd4a Fix default WC_Checkout::get_value() behaviour
Prior to SHA: 43d362d1, WC_Checkout::get_value() would set the default value
for an $input whenever the value after was null after being passed through
filters. This logic changed with SHA: 43d362d1 to *always* return the filtered
value, even if the value was not changed by filters and was still null.

This means if any code filters just one checkout value, like order_comments,
then all other checkout values will default to null, because the has_filter()
check will pass, but the default null value won't be modified by that callback.
2017-01-26 14:47:43 -08:00
Toni Viemerö 2d92bdece6 Cast position as integer
Even though I'm sending `position` as integer in my REST request, it comes through as string value.

```
array (
  'id' => '186',
  'position' => '0',
)
```
2017-01-26 23:08:12 +02:00
Mike Jolley e930ccd16e object types to fix unit tests 2017-01-26 20:58:55 +00:00
Toni Viemerö 2b00615fa2 Remove tilde from i 2017-01-26 22:55:23 +02:00
Brent Shepherd e7e434da4b WC_Product_Variable::sort_variation_prices()
To keep variation sorting logic inside the variable product, and separate
from the database storage logic in WC_Product_Variable_Data_Store_CPT
2017-01-26 12:47:46 -08:00
Mike Jolley 82d7fe6e73 Added more missing args and types 2017-01-26 20:33:39 +00:00
Mike Jolley b727c61da7 Missing arg and setting types 2017-01-26 20:06:18 +00:00
Mike Jolley 2d23705431 ID arg definitions 2017-01-26 19:22:57 +00:00
Mike Jolley def35a5aa2 Cast request ids to int 2017-01-26 18:34:11 +00:00
Jaydeep Rami 615ba59ebb Fixed issue #12986 2017-01-26 23:21:34 +05:30
Justin Shreve 0b1685c76b Remove variation get_name, it will get it from parent. 2017-01-26 07:48:04 -08:00
Justin Shreve 7b1adfb98f Bake out of get_title deprecation changes 2017-01-26 07:46:59 -08:00
Mike Jolley 40e9eabf9f Merge pull request #12983 from woocommerce/get_tax_classes
WC_Tax::get_tax_class_slugs()
2017-01-26 14:10:04 +00:00
Mike Jolley 9eaffcde42 Merge pull request #12980 from woocommerce/fix/payment-token-update-props
When updating payment tokens, only update the props that have changed & fire off a hook of the changed props.
2017-01-26 14:06:44 +00:00
Justin Shreve e176f008b8 Add some comments for the return value of get_tax_classes and get_tax_class_slugs 2017-01-25 13:48:29 -08:00
Justin Shreve 474a307420 Introduce get_tax_class_slugs. 2017-01-25 13:38:13 -08:00
Justin Shreve e8237eab3d Merge pull request #12965 from woocommerce/update/duplicate-product
Update WC_Admin_Duplicate_Product to use CRUD.
2017-01-25 12:18:49 -08:00
Justin Shreve bcae0166fd Fix spacing error, return objects on our new hook, and force sku to be unique when duplicating. 2017-01-25 11:44:27 -08:00
Justin Shreve 32651f638c When updating payment tokens, only update the props that have changed + fire off a hook of the changed props. 2017-01-25 11:05:54 -08:00
Justin Shreve 318046789c Comment clarifying translation wrapper. 2017-01-25 10:40:14 -08:00
Justin Shreve 9889efec75 Catch Product # titles and remove error logs 2017-01-25 10:37:48 -08:00
Justin Shreve f344143b63 Catch variation text and update 2017-01-25 10:27:28 -08:00
Mike Jolley aadc1094e0 Merge pull request #12939 from maximus80/carousel-filter
add animationLoop to woocommerce_single_product_carousel_options filter
2017-01-25 00:47:34 +00:00
Mike Jolley 0df50c59a3 Merge pull request #12972 from woocommerce/log-handler-interface
Add log handler interface
2017-01-25 00:42:50 +00:00
Mike Jolley e9b0fba63c Merge pull request #12953 from pierrebuet/master
Updating the way select2 v4 loads translated strings
2017-01-25 00:22:47 +00:00
Mike Jolley 3a104df5bd Merge pull request #12966 from thenbrent/dry_get_data
Remove redundant WC_Product::get_data() method
2017-01-25 00:12:16 +00:00
Mike Jolley 5746c87580 Merge pull request #12968 from woocommerce/updated-props-action
Fire actions for updated props
2017-01-25 00:10:48 +00:00
Mike Jolley 3afb00da06 Fixed Typo 2017-01-25 00:09:57 +00:00
Mike Jolley ea817a5c88 Merge pull request #12970 from thenbrent/check_variation_post_type
Check post type during read of product variations
2017-01-25 00:08:54 +00:00
Mike Jolley 76f5bc9b79 Merge pull request #12971 from thenbrent/add_read_extra_data
Add WC_Product_Data_Store_CPT::read_extra_data()
2017-01-25 00:08:18 +00:00
Jon Surrell 65b5e4181f Use __METHOD__ over "{$class}::{$method}" 2017-01-24 23:09:24 +01:00
Jon Surrell 2bd8b6efbc Validate handlers implement WC_Log_handler_Interface
Add tests for interface validation.
2017-01-24 23:07:58 +01:00
Mike Jolley 90fd0da7d0 Fire actions for updated props 2017-01-24 21:38:02 +00:00
Brent Shepherd 49095f0a6c Check post type during read of product variations
Continuation of #12795
2017-01-24 12:28:02 -08:00
Brent Shepherd f2cb083bd6 Read extra data for variation products
So that classes can extend WC_Product_Variation and use the existing
WC_Product_Variation_Data_Store_CPT class, rather than having to create
a new data store class to set the WC_Product_Variation::$extra_data
values.
2017-01-24 12:20:15 -08:00
Brent Shepherd 56c427acba Add WC_Product_Data_Store_CPT::read_extra_data()
So that a product's $extra_data can also be read by child classes of
WC_Product_Data_Store_CPT, like WC_Product_Variation_Data_Store_CPT,
without duplicating the code to read it.
2017-01-24 12:18:35 -08:00
Justin Shreve 2b464d2e52 Deprecate get_title and it's hook, use get_name instead and pull name from parent. 2017-01-24 12:10:36 -08:00
Justin Shreve 10d3e2d580 Update WC_Admin_Duplicate_Product to use CRUD. 2017-01-24 11:57:48 -08:00
Justin Shreve dcecf0f228 Fix get_hook_prefix format 2017-01-24 11:02:06 -08:00
Brent Shepherd 2cf401f60f Delete WC_Product::get_data()
It's identical to WC_Data::get_data(), which is already inherited from
WC_Abstract_Legacy_Product (which extends WC_Data::get_data()).
2017-01-24 10:44:51 -08:00
Justin Shreve 2cdf950963 Merge pull request #12950 from woocommerce/fix/meta-update
Data Stores & update_post_meta: Update changed & keys that don't exist.
2017-01-24 07:14:54 -08:00
Jon Surrell 8e0f40d3d1 Add WC_Log_Handler_Interface
Abstract class `WC_Log_Handler` implements interface
2017-01-24 14:10:05 +01:00
Mike Jolley eb2b9d78f8 Merge pull request #12947 from woocommerce/improve-rest-api-error-data
Allow pass error data using WC_Data_Exception
2017-01-24 12:45:49 +00:00
Justin Shreve 711a381ff6 Remove error log 2017-01-23 13:16:49 -08:00
Claudio Sanches f345285c2e Merge pull request #12951 from woocommerce/emails-using-site-language
Send emails using site language
2017-01-23 19:10:39 -02:00
Justin Shreve 3d55efffac Move order logic to wc-order 2017-01-23 13:08:55 -08:00
pierrebuet 41a937041d Updating the way select2 v4 loads translated strings
Correcting Issue #12952.

In select2 v4 the callback functions used to format the messages have
changed their names and the structure of the options have changed,
using now a „language“ object.

I was not able to find a reference in the select2 v4 code how to format
the number of matches back. Further when using v4 I don’t see any
indication on the number of the number of returned matches, so I
consider the parameter as obsolete.
2017-01-23 22:04:52 +01:00
Claudio Sanches c94bb423f5 Merge pull request #12944 from woocommerce/fix-product-categories-parent
[REST API] Fixed PHP notices while trying to set product category parent as 0
2017-01-23 18:46:10 -02:00
Claudio Sanches 3e60bd64de Send emails using site language, closes #12931 2017-01-23 18:40:36 -02:00
Justin Shreve 1ab0b34926 Fix meta handling logic for update_post_meta: Only update keys that have changed or don't exist. 2017-01-23 12:20:29 -08:00
Brent Shepherd 1ac2c1a94f Move price hash to separate function
So that it can be used by child classes without copy/pasting code.
2017-01-23 11:57:49 -08:00
Claudio Sanches bac0b299c4 Include conflicted product ID when trying to create a product with duplicated SKU 2017-01-23 17:34:49 -02:00
Claudio Sanches cdf59d6f68 E[REST API] Use WC_Data_Exception->getErrorData 2017-01-23 17:32:33 -02:00
Claudio Sanches e23ddabfea Allow WC_Data_Exception have extra error data 2017-01-23 17:29:16 -02:00
Claudio Sanches 03b34fb738 [REST API] Improved messages for term_exists error 2017-01-23 17:07:36 -02:00
Jon Surrell 72f4bcc292 Protect WC_Logger::should_handle
This method should not be public. It is not part of WC_Logger_Interface, and leaving it
public could cause problems
2017-01-23 19:59:01 +01:00
Claudio Sanches 10a9baeada [REST API] Fixed PHP notices while trying to set product category parent as 0 2017-01-23 16:44:22 -02:00
Claudio Sanches 09123c9fc8 Merge pull request #12926 from woocommerce/fix-12910
Use mb_ functions in wc_get_wildcard_postcodes
2017-01-23 15:48:59 -02:00
Claudiu Lodromanean 97497e3104 12170 Update doc blocks with new params 2017-01-23 07:54:14 -08:00
Maximus80 21a14b8636 add animationLoop to woocommerce_single_product_carousel_options filter 2017-01-23 14:24:39 +01:00
Mike Jolley 1e9659b235 Merge pull request #12884 from kreamweb/master
Fix: usermeta table name, in a multisite the usermeta table is common…
2017-01-23 11:54:59 +00:00
Mike Jolley 66914966fb Adjust meta saving code throughout
#12885
2017-01-23 11:30:53 +00:00
Mike Jolley d8bd80fbb7 Merge pull request #12885 from woocommerce/fix/shipping-rate-meta-data
Add shipping rate meta data to line item
2017-01-23 10:53:24 +00:00
Mike Jolley cd05b94ec3 woocommerce_admin_process_product_object hook 2017-01-23 10:20:11 +00:00
Mike Jolley ba7513ed82 wc_format_decimal should remove % symbols
Fixes #12893
2017-01-22 01:35:14 +00:00
Mike Jolley f0049367ae Use mb_ functions and add tests 2017-01-22 01:24:20 +00:00
Brent Shepherd ff627b31f6 Make variable data store private methods protected
So they can be inherited by other variable product types, like
variable subscriptions.
2017-01-20 11:09:49 -08:00
Claudiu Lodromanean 754a12c88a 12170 Set up RTL generation and enqueuing 2017-01-20 10:29:48 -08:00
Mike Jolley 90764253bc Merge pull request #12903 from thenbrent/fix_wc_paying_customer
[2.7] Fix wc_paying_customer() refund check
2017-01-20 10:45:22 +00:00
Mike Jolley fa9fed4e4d Merge pull request #12908 from thenbrent/fix_refund_data_store_read
[2.7] Fix WC_Order_Refund_Data_Store_CPT::read() and Abstract_WC_Order_Data_Store_CPT's support for other custom order types
2017-01-20 10:44:18 +00:00
Mike Jolley f44b4f6e9f Merge pull request #12907 from thenbrent/get_order_count_param
[2.7] Fix name of get_order_count() param
2017-01-20 10:43:06 +00:00
Mike Jolley e8115c654d Merge pull request #12905 from thenbrent/use_wc_format_price_range
[2.7] Fix get_price_html_from_to() deprecation
2017-01-20 10:42:29 +00:00
Mike Jolley fc02cc80a8 Merge pull request #12888 from woocommerce/get_order_id_by_order_item_id
Add method for getting order id from order item id.
2017-01-20 10:39:13 +00:00
Mike Jolley b2e6fa8c4e Merge pull request #12897 from hannahswain/master
Update capitalization on "Visit store" menu link
2017-01-20 10:38:48 +00:00
Mike Jolley d757b85167 Merge pull request #12883 from woocommerce/order-tracking-messages
Use notices functions in order tracking
2017-01-20 10:38:02 +00:00
Brent Shepherd c8f003d5b0 Fix WC_Order_Refund_Data_Store_CPT::read()
Abstract_WC_Order_Data_Store_CPT::read() hardcoded its validation against
the 'shop_order' post type. However, custom order types created via the
wc_register_order_type() API can use different post types. For example,
refunds have the post type: 'shop_order_refund'.

This patch changes the Abstract_WC_Order_Data_Store_CPT::read() validation
to check that the post type is any of the registered order types.

This fixes refunds and 3rd party custom order types, like subscriptions.
2017-01-19 16:18:42 -08:00
Brent Shepherd f9569df1ee Fix naming of get_order_count() param
The parameter is actually an order status, not type.
2017-01-19 15:40:20 -08:00
Brent Shepherd a1cd7eee42 Fix get_price_html_from_to() deprecation
WC_Product::get_price_html_from_to() was incorrectly using
wc_format_sale_price() as its replacement in WC 2.7; however,
wc_format_price_range() is a more suitable replacement.
2017-01-19 13:51:23 -08:00
Brent Shepherd 3f338cd3e1 Fix wc_paying_customer() refund check
wc_paying_customer() needs to check against 'shop_order_refund', which is
the actual return value of WC_Order_Refund::get_type(). No object will return
'refund', so a customer would always be declared as a paying customer even
for refund orders.
2017-01-19 11:16:43 -08:00
Justin Shreve 98343ffe26 Fix docblocks and cast the order ID as int after our query. 2017-01-19 09:38:23 -08:00
Justin Shreve a1446c9591 Add method for getting order id from order item id. 2017-01-19 09:30:19 -08:00
Hannah Swain c22b1d766a Update class-wc-admin-menus.php
Capitalize "s" in "Visit store" to match case on "Visit Site".
2017-01-19 14:47:29 +01:00
Claudio Sanches 9d513737ed Merge pull request #12887 from woocommerce/fix/order-item-type-array
Return order item type if accessed via array.
2017-01-18 20:43:25 -02:00
Justin Shreve 663a096429 Return order item type if accessed via array (bw compat). 2017-01-18 13:49:12 -08:00
Nabeel Sulieman 3c8ce9b494 Add shipping rate meta data to line item 2017-01-18 10:41:32 -08:00
Claudio Sanches bff95262cb Changelog for 2.6.13 2017-01-18 16:20:48 -02:00
Claudio Sanches d536d15652 Merge branch 'master' of github.com:woocommerce/woocommerce 2017-01-18 16:01:02 -02:00
Claudio Sanches f54e9e1e1a Fixed coding standards 2017-01-18 15:16:01 -02:00
emanuela castorina c4c78442cf Fix: usermeta table name, in a multisite the usermeta table is common to all sites 2017-01-18 18:11:21 +01:00
Claudio Sanches fe97e1f5b3 Merge pull request #12866 from woocommerce/wc_get_orders_before_and_after_date
Add before and after date arguments to wc_get_orders
2017-01-18 14:52:51 -02:00
Claudio Sanches ddc8ce93a4 Use notices functions in order tracking, closes #12874 2017-01-18 14:45:20 -02:00
Claudio Sanches 11035ba4d7 Fixed "stock increase" string placeholders, closes #12873 2017-01-18 14:34:52 -02:00
Mike Jolley f9f6ac175b Merge pull request #12865 from woocommerce/remove-default-instructions
Removed default instructions
2017-01-18 10:31:21 +00:00
Justin Shreve b660eda4b8 Add date searching to wc_get_orders. 2017-01-17 12:52:27 -08:00
Claudio Sanches ac3d847a16 Fixed file permissions 2017-01-17 16:31:31 -02:00
Claudio Sanches 61b39c206f Removed default instructions, closes #12853 2017-01-17 16:11:49 -02:00
Mike Jolley 17481af671 Allow html in description 2017-01-17 15:50:19 +00:00
Mike Jolley cb04d5985a Fix add zone button and default title
Fixes #12829
2017-01-17 15:25:12 +00:00
Mike Jolley d92447713a Merge pull request #12852 from woocommerce/fix-terms-ordering
Restore attributes ordering
2017-01-17 12:28:41 +00:00
Mike Jolley a276d459ed Merge pull request #12851 from woocommerce/rest-api-search-by-multiple-skus
[REST API] Allow search by multiples SKUs
2017-01-17 12:22:39 +00:00
Mike Jolley 4eac304388 Merge pull request #12814 from woocommerce/fix-product-variable-filters
Remove deprecation notices on woocommerce_get_children
2017-01-17 10:19:17 +00:00
Claudio Sanches bd655af072 Restore attributes ordering, closes #12847 2017-01-16 21:11:56 -02:00
Claudio Sanches c001b508d5 Merge branch 'master' into fix/stock-bulk 2017-01-16 20:41:33 -02:00
Claudio Sanches 3d352a680c [REST API] Allow search by multiples SKUs 2017-01-16 20:35:55 -02:00
Claudio Sanches 20032fd170 Fixed declaration of is_on_sale() compatible with WC_Product::is_on_sale 2017-01-16 19:59:53 -02:00
Claudio Sanches fbfb195f2f Fixed interfaces file names and location 2017-01-16 19:33:21 -02:00
roykho 11d0d26df7
Fix typo on variable when it should be 2017-01-16 12:54:59 -08:00
Justin Shreve fab2e52bdd Remove deprecation filters. 2017-01-16 11:06:25 -08:00
Justin Shreve 3e92ec9d59 Fix stock updating on bulk edit. 2017-01-16 10:57:14 -08:00
Justin Shreve cabff4fe28 Fix stock, virtual, and featured checks by passing correct data to quick-edit.js 2017-01-16 09:59:56 -08:00
Justin Shreve b7305b835d Merge pull request #12835 from franticpsyx/update-price-meta-context
[2.7] Prices retrieved in 'edit' context when writing meta
2017-01-16 08:52:24 -08:00
Manos Psychogyiopoulos 892d5da7e9 get prices in 'edit' context when updating meta 2017-01-16 17:33:30 +02:00
Jon Surrell 7822c38a2c Accept object from woocommerce_logging_class filter
The filter `woocommerce_logging_class` allows replacement of the
built in `WC_Logger` as the shared logger. However, we statically
instantiate the classname as `$logger = new $class`. This prevents
use of any class which needs to be instantiated with arguments.

This change allows the `woocommerce_logging_class` filter to provide
an object which will be used as the shared logger.
2017-01-15 13:41:21 +01:00
Claudio Sanches 366011ab20 Defined context for shipping packages names 2017-01-15 01:46:02 -02:00
Claudio Sanches 08644c6f42 Missing space 2017-01-15 00:21:02 -02:00
Jon Surrell ef9624efff Ensure filter provided logging class implements WC_Logger_Interface 2017-01-14 18:39:40 +01:00
Jon Surrell 144ea5d5ab Include WC_Logger_Interface on startup 2017-01-14 17:58:24 +01:00
Jon Surrell bd090749ec Add WC_Logger_Interface
`class WC_Logger implements WC_Logger_Interface`.

The built-in logger can be replaced "globally" (when
provided via `wc_get_logger`) by using the filter
`woocommerce_logging_class`. This interface should make replacing
`WC_Logger` easier and safer.
2017-01-14 17:43:15 +01:00
Claudio Sanches 022d4fdac4 Coupon expiry date do not allow multiple date formats 2017-01-14 00:10:51 -02:00
Claudio Sanches a5055ec2cf Merge pull request #12815 from woocommerce/fix-tool-command-notice
Fix notice that displays when activating WC via the command-line.
2017-01-13 22:52:33 -02:00
Justin Shreve 9dc38fcee0 Fix notice that displays when activating WC via the command-line. 2017-01-13 10:47:10 -08:00
Claudio Sanches 12481a2be7 Merge pull request #12808 from woocommerce/restore-logger-rm-clear
Restore WC_Logger remove and clear functionality
2017-01-13 13:14:27 -02:00
Jon Surrell 5d7665671c Remove WC_Logger::remove
This method was added post 2.6 and does not need to be maintained/deprecated.
Remove related test.
2017-01-13 06:48:57 +01:00
Jon Surrell 78a6ed4d44 Restore remove and clear functionality to WC_Logger
Maintain backwards compatibility of removing or clearing files.
2017-01-12 22:13:42 +01:00
Jon Surrell a2dea96430 Add message when get_log_file_path called too early 2017-01-12 22:02:31 +01:00
Claudio Sanches 9c27661dea Synchronized with master 2017-01-12 17:53:15 -02:00
Jon Surrell e8fd29520f Un-deprecate wc_get_log_file_path 2017-01-12 20:39:39 +01:00
Claudio Sanches 9f1e0c46fa Fixed wc_get_product_terms() when using menu_order ordering 2017-01-11 16:14:28 -02:00
Mike Jolley 91c68d211f Merge pull request #12798 from woocommerce/orphan-variations-fix-12614
Orphan variations fix
2017-01-11 16:23:14 +00:00
Mike Jolley 748db4e675 Defer flush so CPT is updated before flush.
Fixes #12787
2017-01-11 16:12:00 +00:00
Mike Jolley ba8f308100 Merge branch 'master' into orphan-variations-fix-12614
# Conflicts:
#	includes/class-wc-post-data.php
2017-01-11 15:42:20 +00:00
Mike Jolley dc82ea9c77 Add some functions to handle unique sku after untrash 2017-01-11 15:41:31 +00:00
Mike Jolley 80f79ae98d Trash and untrash variations handling
Fixes #12774
2017-01-11 15:41:19 +00:00
Claudio Sanches fff98a9fbd Removed more legacy $woocommerce variable 2017-01-11 13:31:31 -02:00
Claudio Sanches 612b54f0df Removed dead $woocommerce variable 2017-01-11 13:29:34 -02:00
Mike Jolley de11be2b6c space 2017-01-11 12:37:03 +00:00
Mike Jolley 9706104128 Fix test case 2017-01-11 12:33:38 +00:00
Mike Jolley b240e10b91 Merge branch 'pr/12756' 2017-01-11 12:19:30 +00:00
Mike Jolley 3e31f2f361 Syntax 2017-01-11 12:19:23 +00:00
Mike Jolley 11015c4b06 Pass products around and change how wc_format_stock_for_display gets called so $product is available. 2017-01-11 12:17:18 +00:00
Mike Jolley 8e7687b9fc Add method to delete variations 2017-01-11 11:48:39 +00:00
Mike Jolley b749b654bc Fire action on type change 2017-01-11 11:48:31 +00:00
Mike Jolley 19913f4d6c Handle variation type change event 2017-01-11 11:48:22 +00:00
Mike Jolley 61ce6a2d21 remove notice text 2017-01-11 11:48:11 +00:00
Mike Jolley 4e12ca6332 Merge pull request #12775 from kahanit/patch-1
Actions on delete of zone and zone method
2017-01-11 11:06:42 +00:00
Mike Jolley 8212611307 Merge pull request #12795 from woocommerce/check-post-type
Check post type during read of coupons, posts, and products.
2017-01-11 11:05:10 +00:00
Chouby 1a1a152e2e Fix duplicate_post_taxonomies() when using non unique slugs
Since WP 4.3, it is possible to use non unique terms slugs in the same taxonomy. Currently duplicate_post_taxonomies() uses the term slug in wp_set_object_terms(), thus may set a wrong term. I propose to use term_id instead, which ensures that the correct term is set.
2017-01-11 09:32:12 +01:00
Justin Shreve cddcb7841e Check post type during read of coupons, posts, and products. 2017-01-10 14:43:33 -08:00