Commit Graph

9605 Commits

Author SHA1 Message Date
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
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 dcecf0f228 Fix get_hook_prefix format 2017-01-24 11:02:06 -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
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
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
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
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