Commit Graph

9697 Commits

Author SHA1 Message Date
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
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
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
Claudio Sanches 7d090957c8 Merge pull request #12794 from shivapoudel/wc-pages
Tweak - Exclude profile pages from WC pages
2017-01-10 16:37:12 -02:00
Shiva Poudel 8171c73e9b Tweak - Exclude profile pages from WC pages using array_diff 2017-01-10 21:55:11 +05:45
Mike Jolley 00250e8eab Fix date query format 2017-01-10 15:50:05 +00:00
Claudio Sanches 4b3c44fea3 Merge pull request #12791 from mattallan/system_status_endpoint_editable
Make the `GET /system_status` API response more customisable
2017-01-10 12:30:35 -02:00
Mike Jolley 451199a388 Hooks when creating refunds 2017-01-10 14:14:05 +00:00
Mike Jolley 5bfb372f01 Customer update hook 2017-01-10 14:14:05 +00:00
Mike Jolley b97f6c9eb1 wc_bool_to_string handling for 'true' 2017-01-10 14:14:05 +00:00
matttallan c45d81e650 Make the system_status GET endpoint more customisable 2017-01-10 16:06:09 +10:00
Diego Zanella de02645544 Improved filter `woocommerce_layered_nav_link`
* Added term and taxonomy as additional parameters.
2017-01-09 19:27:01 +00:00
Claudio Sanches ca47661388 Fixed WC_Product::get_price_html_from_text deprecated message, closes #12779 2017-01-09 15:52:17 -02:00
Manos Psychogyiopoulos 022fbe4183 add 'include' arg to wc_get_products 2017-01-09 14:10:47 +02:00
Manos Psychogyiopoulos bffdc27e8c fix variation attributes display in stock reports 2017-01-09 12:03:08 +02:00
Jon Surrell acd338fb87 Add default source to WC_Log_Handler_DB 2017-01-08 21:42:56 +01:00
Jon Surrell f1a90d6b05 Move level filters to dropdown
Drop table list "views" and use dropdown filter for sources and levels.
2017-01-08 19:32:53 +01:00
Jon Surrell a992084776 Sort by timestamp by default 2017-01-08 18:55:21 +01:00
Jon Surrell 0aab3282f4 Add more sanitizing
These values should be controlled, but additional sanitization is preferable.
2017-01-08 18:53:01 +01:00
Amit Sidhpura 887aa5fe1b sorry change zone in action to shipping_zone 2017-01-07 11:16:31 +05:30
Amit Sidhpura 8de220beeb Actions on delete of zone and zone method
Hooks on delete of zone and zone method.
I have named it 'woocommerce_delete_zone' and 'woocommerce_delete_zone_mehod' making it same format as customer delete action
'woocommerce_delete_customer'.
2017-01-07 11:10:36 +05:30
Kathy Darling 8d4844a31c space after parens 2017-01-06 14:39:02 -05:00
Mike Jolley 66c3cff76d More escaping 2017-01-06 14:09:36 +00:00
Mike Jolley 76f8c3dddd Escaping for scruitinizer 2017-01-06 12:45:28 +00:00
Mike Jolley 54352de9b4 Merge pull request #12767 from woocommerce/deprecated-actions
Add hooks when error_logging deprecation notices on AJAX calls.
2017-01-06 12:05:16 +00:00
Mike Jolley f03e09e791 Comment 2017-01-06 11:59:05 +00:00
Justin Shreve 39fe17ec45 Add hooks when error_logging deprecation notices on AJAX calls. 2017-01-05 10:54:10 -08:00
Mike Jolley f7d72afcf9 Detect classname when saving attributes 2017-01-05 16:54:47 +00:00
Mike Jolley ee7ee26278 Add static method to get a filtered product classname 2017-01-05 16:54:33 +00:00
Mike Jolley 813ec28c7b Remove type check in link_all_variations 2017-01-05 16:17:46 +00:00
Mike Jolley fdbb36bb93 Support deprecated args again 2017-01-05 16:16:19 +00:00
Jon Surrell d38e22329f Replace count with empty check 2017-01-05 16:33:58 +01:00
Jon Surrell e6bcc1aeb6 Replace 'All' with 'All sources' in dropdown 2017-01-05 16:23:03 +01:00
Mike Jolley 17f78d9668 Fallback to full image
Closes #12759
2017-01-05 14:31:04 +00:00
Mike Jolley f7abf29f25 Merge pull request #12754 from woocommerce/sync-variation-names-12707
Sync variation names
2017-01-05 12:15:06 +00:00
Justin Shreve e4937b898d Fix PHP 7.1 warnings/notices. 2017-01-04 10:45:45 -08:00
Kathy Darling ff0926aa2d use wc_format_stock_quantity_for_display() to wrap stock quantity numbers for front end display. closes #12753. 2017-01-04 12:25:28 -05:00
Mike Jolley 5dba3d5bfe Sync variation names 2017-01-04 15:18:02 +00:00
Mike Jolley ec41ba9ff0 delete, don't trash, variations 2017-01-04 14:05:13 +00:00
Mike Jolley 5272f836a4 Merge branch 'read-price-data-caching' 2017-01-04 13:56:14 +00:00
Mike Jolley 564d3f4e33 Feedback 2017-01-04 13:56:07 +00:00
Mike Jolley 13018752ea Merge pull request #12744 from woocommerce/fix/distinct-12689
Update wc_terms_clauses query
2017-01-04 10:47:49 +00:00
Mike Jolley d84a3bc45b Merge pull request #12751 from bekarice/wc-2-7-fix
[2.7] Fix undefined variable notice
2017-01-04 10:47:22 +00:00
Beka Rice 85f06d7d02 [2.7] Fix undefined variable notice 2017-01-03 18:08:37 -05:00
Justin Shreve 94a33b694c Separate status and post_status in legacy output. status should match get_status exactly. 2017-01-03 14:04:41 -08:00
Manos Psychogyiopoulos af378a619d fix undefined qty_ordered variable 2017-01-03 21:40:06 +02:00
Justin Shreve c560a65e1b Merge pull request #12742 from jtsternberg/patch-1
Add the shortcode name param to shortcodes where it is missing and `shortcode_atts` call where it is missing.
2017-01-03 11:05:48 -08:00
Justin Shreve 3513f50e55 Add tm.meta_value to the DISTINCT list since it is being used in the ORDER BY clause. 2017-01-03 10:43:48 -08:00
Justin Shreve 291a662be1 The WC API returns exclude_product_ids and expiry_date. 2.7 renamed these in the API file, which we should not do until we version the endpoints. 2017-01-03 10:25:36 -08:00
Justin Sternberg d07d704187 Add the shortcode_atts call to WC_Shortcode_Cart::output 2017-01-03 13:17:04 -05:00
Justin Sternberg 6d21f2170e Add the shortcode_atts call to WC_Shortcode_Checkout::output 2017-01-03 13:15:26 -05:00
Justin Sternberg 5f92dce1f3 Add the shortcode name param to the woocommerce_order_tracking shortcode 2017-01-03 13:13:27 -05:00