Commit Graph

9905 Commits

Author SHA1 Message Date
Claudio Sanches d02d90c867 V1 and V2 for product taxonomies, reviews, reports, taxes and webhooks 2017-02-11 12:51:41 -02:00
Claudio Sanches e9f2e75d53 Fixed coding standards and file header 2017-02-11 12:51:13 -02:00
Claudio Sanches 1b1b784cb4 Merge pull request #13158 from woocommerce/fix-13119
Only append tax price suffix if taxable
2017-02-11 12:08:11 -02:00
Mike Jolley eb518ec06d Only append tax price suffix if taxable 2017-02-11 00:08:49 +00:00
Mike Jolley 979e64c242 Merge pull request #13145 from woocommerce/fix/cli-id-docs
Fix CLI documentation for commands with multiple IDs.
2017-02-11 00:05:17 +00:00
Mike Jolley 31d428131e Imrpove checkout performance when updating product sales 2017-02-10 23:41:53 +00:00
Claudio Sanches 190ebccd00 Fixed order notes 2017-02-10 21:34:01 -02:00
Claudio Sanches 7f82051dd9 Fixed returning values in write context 2017-02-10 21:32:40 -02:00
Claudio Sanches ca67d448a2 Fixed doing it wrong notices 2017-02-10 21:11:56 -02:00
Claudiu Lodromanean 8a05f72f78 Minor clean-up 2017-02-10 14:35:26 -08:00
Claudiu Lodromanean f362e0108e Enable attribute suppression in wc_display_item_meta 2017-02-10 14:11:16 -08:00
Claudio Sanches e84acf3ee4 Order notes v2 2017-02-10 18:31:29 -02:00
Claudio Sanches e4b6c81f66 Customer downloads v2 2017-02-10 18:31:21 -02:00
Brent Shepherd 5d10c797d0 Make WC_Checkout line item creations reusable
By passing in dependencies, like cart items, fees, taxes or coupons,
as well as the cart to which they relate.
2017-02-10 12:03:32 -08:00
Claudiu Lodromanean 8d2fd29396 Don't rtlcss select2.css 2017-02-10 11:39:28 -08:00
Mike Jolley d693863ad2 Merge pull request #13064 from thenbrent/variable_product_sync_filters
Modify variable product sync hooks
2017-02-10 18:40:48 +00:00
Brent Shepherd 5d560f380a Remove 'woocommerce_variable_product_synced' hook
And add additional suggested alternatives to the deprecated
woocommerce_variable_product_sync hook.
2017-02-10 10:36:35 -08:00
Brent Shepherd 5dec55928b Add 'woocommerce_variable_product_sync_data'
Renaming 'woocommerce_variable_product_sync_before_save'
2017-02-10 10:33:48 -08:00
Claudiu Lodromanean b6b3f0c217 Modify product title logic 2017-02-10 10:19:05 -08:00
Mike Jolley 82d9abd4c5 Make sure enabled is checked by default
#13147
2017-02-10 17:43:32 +00:00
Claudio Sanches b1b536b5d2 Give REST API authentication a lower priority
Bigger than add_filter( 'determine_current_user', 'wp_validate_auth_cookie' );
Smaller than add_filter( 'determine_current_user', 'wp_validate_logged_in_cookie', 20
);

This solve issues while trying to authenticate in a browser while logged
in.

Closes #13134
2017-02-10 15:35:52 -02:00
Justin Shreve 700026c2ab Separate positional and assoc arguments. 2017-02-10 08:38:43 -08:00
Mike Jolley b58e26b0ab Backwards compatibility for triggers
Closes #13141
2017-02-10 13:09:37 +00:00
Mike Jolley 5349171083 This panel does not show in products anyway
Fixes #13133
2017-02-10 12:51:49 +00:00
Claudiu Lodromanean ab8fb48bb4 Fix and standardize e-mail sending 2017-02-09 14:49:39 -08:00
Claudiu Lodromanean 21617f408d Bring up to date with master 2017-02-09 14:06:49 -08:00
Claudiu Lodromanean e330ab4158 Pass product into filters 2017-02-09 14:05:40 -08:00
Claudiu Lodromanean a3f9207839 Add logic to variation title generation 2017-02-09 14:03:00 -08:00
Claudio Sanches ec8fe6e30d [REST API] Implement CRUD to customers 2017-02-09 19:54:16 -02:00
Claudio Sanches 23fbc31dfb [REST API v1] Implement CRUD to coupons 2017-02-09 19:22:19 -02:00
Claudio Sanches 5d87a28407 Restored shipping zones base controller 2017-02-09 18:46:57 -02:00
Claudio Sanches 88d2875514 Restored REST API v1 2017-02-09 18:40:35 -02:00
Claudio Sanches 4b156ab1ae Merge old REST API branch 2017-02-09 18:19:56 -02:00
Claudio Sanches feeb98e801 Merge pull request #13131 from woocommerce/cli-attrib
Restructure ID route code for the CLI & fix attribute term.
2017-02-09 18:14:19 -02:00
Justin Shreve 309d118287 Restructure ID route code for the CLI & make the attribute term command work. 2017-02-09 10:29:24 -08:00
Claudiu Lodromanean 3120a19dae Switch isset back to array_key_exists to keep null-default props working 2017-02-09 10:13:44 -08:00
Justin Shreve 988175b746 Merge pull request #13127 from woocommerce/fix/product-data-store-title
Don't use get_the_title during product read
2017-02-09 10:08:51 -08:00
Claudio Sanches c350ecfb99 Fixed PHP 5.2 fatal error, closes #13128 2017-02-09 15:27:26 -02:00
Claudio Sanches 4352484ed7 REST API v2 2017-02-09 15:06:13 -02:00
Justin Shreve 8a6bae374f Switch from get_the_title to the post objects post_title. 2017-02-09 08:43:48 -08:00
Mike Jolley 962b60c8fe kses/sanitize 2017-02-09 15:43:47 +00:00
Claudio Sanches 2c5f032b0b Merge pull request #13099 from woocommerce/fix-13011
If woocommerce_adjust_non_base_location_prices is false, remove modded tax, not base tax
2017-02-09 13:41:06 -02:00
Claudio Sanches 094b86c92b Merge pull request #13104 from woocommerce/fix-13015
Inherit shipping class id from parent
2017-02-09 13:37:54 -02:00
Claudio Sanches e3b563c518 Merge pull request #13044 from woocommerce/crud-perf-tweaks
[2.7] CRUD performance improvements for emails
2017-02-09 13:25:29 -02:00
Mike Jolley dcce2a4190 Change order of execution on checkout so shipping is required.
Closes #12992
2017-02-09 12:59:13 +00:00
Mike Jolley 234b4cfa91 Merge pull request #13009 from woocommerce/gallery-tweaks
Gallery tweaks
2017-02-09 12:34:23 +00:00
Mike Jolley d7e9af3ac8 Use current_theme_supports 2017-02-09 12:34:06 +00:00
Mike Jolley 7ff301e2ca Merge branch 'master' into crud-perf-tweaks
# Conflicts:
#	includes/data-stores/class-wc-order-item-data-store.php
2017-02-09 12:31:25 +00:00
Mike Jolley 16afdeec96 Add prefix 2017-02-09 12:30:33 +00:00
Mike Jolley 1c10ad94cb Remove order item column due to performance issues on orders screen 2017-02-09 12:29:16 +00:00
Mike Jolley b17932f4e3 Fix test due to invalid amount and caching 2017-02-09 12:04:44 +00:00
Mike Jolley 8242e5496d Switch locale only after init 2017-02-09 11:23:44 +00:00
Mike Jolley 8298c83e6f Set all default parent data 2017-02-09 11:07:34 +00:00
Mike Jolley 639b805a24 Merge pull request #13120 from woocommerce/fix/factory-type
Move post type logic from product and order factories.
2017-02-09 11:02:57 +00:00
Mike Jolley a7b2a0ac7c Merge pull request #13107 from woocommerce/fix-12962
Add locale independent wc_get_permalink_structure function
2017-02-08 23:33:56 +00:00
Justin Shreve 65b99bf240 moved order item type check to order item data store 2017-02-08 11:42:36 -08:00
Justin Shreve ae5293aeb9 Move the get type logic out of the product factories and into the data stores. 2017-02-08 11:18:39 -08:00
Mike Jolley c49368f7fc Small id fix for #13118 2017-02-08 18:19:24 +00:00
Claudio Sanches 9b0a4e6c92 Merge pull request #13109 from woocommerce/fix-regressed-tests
Fix failing tests and array_merge error
2017-02-08 16:18:08 -02:00
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