Commit Graph

16373 Commits

Author SHA1 Message Date
kakshak 6c57b59353 fix: ability to apply coupon on a sale item even when the coupon is restricted to only non sale items 2018-08-18 13:02:51 +05:30
Peter Fabian 1a2f0d4a0b Removed check for invalid utf8 in passwords. 2018-08-17 11:01:30 +02:00
Claudiu Lodromanean 6eea244a28
Merge pull request #21074 from woocommerce/fix/21026
Fixes two product attributes issues when non-ASCII characters are used in the attribute name
2018-08-16 13:22:16 -07:00
Claudiu Lodromanean f1c6f3cb3e
Merge pull request #21065 from andgrankin/patch-1
Fixed typo in translations context
2018-08-16 12:59:57 -07:00
Claudiu Lodromanean 7a0b15b9ec
Merge pull request #21072 from woocommerce/fix/21071
Hide activate step in wizard when you cannot install plugins
2018-08-16 12:55:41 -07:00
Gerhard Potgieter 2c15bee1d4 Refine wp.org update check to use correct data structures when querying data. 2018-08-16 14:27:35 +02:00
Gerhard Potgieter 2625823734 Add fallback to wp.org plugin info check if the changelog check fails, this is for free plugins hosted on .org 2018-08-16 14:09:39 +02:00
Gerhard Potgieter 1b98c1e22e Hide activate step on wizard when the user does not have install_plugins capability, administrators on multisites cannot install plugins, only super admins are allowed. 2018-08-16 12:38:27 +02:00
David Marín bc86676b7e
Update class-wc-meta-box-product-data.php 2018-08-16 09:28:48 +02:00
David Marín 6b3ef46f4e
Complete filter call 2018-08-16 09:28:03 +02:00
David Marín 97eddce025
Admin: New filter to customize variations count
Adding new filter to customize variations count, so internal-use variations can be hidden by plugins.
2018-08-16 08:37:25 +02:00
andgrankin 5bb55159a7
Fixed typo in translations context
When only one shipping package translation was not applied because of wrong context.
2018-08-16 12:30:42 +07:00
Rodrigo Primo 4d2530ef45 Fix: product attributes cache should work when non-ASCII characters are used
This commit fixes an issue in the code that sets product attributes that was breaking product attributes cache removal when non-ASCII characters are used in the attribute name. For more information see https://github.com/woocommerce/woocommerce/issues/21026#issuecomment-412111740
2018-08-15 13:24:33 -03:00
Rodrigo Primo fef0cd48ea phpcs fixes 2018-08-15 13:24:09 -03:00
Claudiu Lodromanean ec0613ad78
Merge pull request #21056 from Luminus/fix-21055
Make postcode field optional and hidden for Nigeria and label State correctly
2018-08-15 08:38:13 -07:00
Luminus Olumide Alabi 798cd36f04 Make postcode field optional and hidden for Nigeria and label State correctly 2018-08-15 10:36:20 +01:00
Nico Mollet cc9e904cfc
Standardize case of button View cart
Hello,

In this WC_Cart class, there are two string for `View cart`.
Line 1037 and line 1065.

The other `button wc-forward` buttons are first character uppercase only.

The PR changes `View Cart` to `View cart`.
Thank you
2018-08-15 09:13:59 +02:00
Claudiu Lodromanean 41a9994e52
Merge pull request #21051 from woocommerce/feature/add-cart-contents-filter
Add new filter to allow modifications of cart contents
2018-08-14 13:02:25 -07:00
Boro Sitnikovski a1bec3f200 Update comment style 2018-08-14 21:30:02 +02:00
Boro Sitnikovski 1c4ef011d2 Add new filter to allow modifications of cart contents 2018-08-14 18:34:52 +02:00
Rodrigo Primo 20fd569a55 Fix clearing filters in "Filter products by attribute" widget
This commit fixes an issue that was making it impossible to clear filters in the "Filter products by attribute" widget when the attribute name contained non-ASCII characters. The problem was caused by a call to sanitize_title() which doesn't seem necessary as it is sanitizing one of the widget parameters which is already sanitized in 679d719368/includes/widgets/class-wc-widget-layered-nav.php (L116). So this commit simply removes the sanitize_title() call. Even if we needed to sanitize the variable `$taxonomy`, it would be better to use sanitize_text_input_field() or wc_sanitize_taxonomy_name() as sanitize_title() will replace accented characters.

For more about the problem that is fixed by this commit see #21028
2018-08-14 11:45:57 -03:00
Rodrigo Primo a637fe10b8
Merge pull request #21018 from Luminus/fix-21016
Make city field optional and hidden for Singapore addresses
2018-08-14 10:31:27 -03:00
Peter Fabian 4dce6ec050
Merge pull request #21011 from woocommerce/fix/21010
Allow usage of orderby sorting via GET params when using the shortcode.
2018-08-14 09:54:11 +02:00
Claudiu Lodromanean 28f4185899
Merge pull request #21038 from woocommerce/fix/21002
Update customer's ip address on successful payment.
2018-08-13 11:32:09 -07:00
Peter Fabian ca08beaa42 Changed explicit check to implicit. 2018-08-13 19:44:33 +02:00
Peter Fabian 96b9ebae14
Merge pull request #21007 from woocommerce/fix/21000
jquery-blockui dependency for wc-add-to-cart and wc-add-to-cart-variation scripts.
2018-08-13 19:36:00 +02:00
Peter Fabian 84e008337c Update customer's ip address on successful payment. 2018-08-13 14:37:21 +02:00
Peter Fabian 1c2f51ee86 Unslashed the SKU for variation. 2018-08-09 12:13:23 +02:00
Peter Fabian d4fab78b05 PHPCS update. 2018-08-09 11:30:40 +02:00
Luminus Olumide Alabi a3d8c6d599 Make city field optional and hidden for Singapore addresses 2018-08-09 10:02:09 +01:00
Claudiu Lodromanean 11911aa2ea
Merge pull request #20870 from woocommerce/add/export-products-based-on-category
Add category filter to product export functionality.
2018-08-08 08:51:58 -07:00
Gerhard Potgieter 1f4e86bd83 Allow exporting of variations for a parent product when a category is selected since variations are not tied to a category. 2018-08-08 14:45:57 +02:00
Gerhard Potgieter a250b0044f Add support for order as well to the shortcode 2018-08-08 13:44:47 +02:00
Gerhard Potgieter 2596796de3 Allow usage of orderby sorting via GET params when using the shortcode. 2018-08-08 11:05:27 +02:00
Gerhard Potgieter 7db8940d2d
Merge pull request #20982 from shabnam611/fix/20943
Fix for issue 20943: Removed unnecessary php tag [point 2] and removed a return false stat…
2018-08-08 10:51:31 +02:00
Shabnam 722c21066f changed version to 3.5.0 and adjusted the curly brace 2018-08-08 13:27:54 +06:00
Gerhard Potgieter 90cc41c895 Make jquery-blockui dependencies for wc-add-to-cart and wc-add-to-cart-variation since it uses the block function but has not dependency on the woocommerce script. 2018-08-08 08:56:49 +02:00
Gerhard Potgieter b9a28b7ec2 Allow for multiple category selections when exporting. 2018-08-07 16:58:39 +02:00
Gerhard Potgieter 70e9b747e8
Merge pull request #20832 from rnaby/180718-010448-class-wc-checkout
HashTable Implemented
2018-08-07 12:26:08 +02:00
Rodrigo Primo 7922e68022
Merge pull request #20953 from woocommerce/fix/20927
Hide "Stock status" field for grouped products
2018-08-07 06:58:36 -03:00
Peter Fabian 925002bc37 Changed wc_clean sanitization to checking for valid utf8 and the input is later sanitized by WordPress db layer.
It caused issues in 2 places: Order item name (product name) and user's password.
2018-08-06 20:49:27 +02:00
Claudiu Lodromanean d32a675c25
Merge pull request #20931 from woocommerce/fix/download-log-data-store
Fix: orderby and order parameters in WC_Customer_Download_Log_Data_Store::get_download_logs()
2018-08-04 07:57:17 -07:00
Shabnam 4affbff47e removed unnecessary php tag [point 2] and removed a return false statement[point 3] 2018-08-04 19:51:25 +06:00
Gerhard Potgieter 19401ea7d0 Fix PHPCS errors on WC_Action_Queue and make sure to pass on correct variable in schedule_cront function. 2018-08-01 20:11:08 +02:00
Gerhard Potgieter 883a5f90eb Fix PHPCS errors in WC_Queue class 2018-08-01 20:07:14 +02:00
Claudiu Lodromanean 71f67b0f2b
Merge pull request #20030 from thenbrent/issue_18003
Prototype using Action Scheduler Event Queue for Async Webhook Delivery
2018-08-01 09:57:56 -07:00
Rodrigo Primo 1274c61a7c Hide "Stock status" field for grouped products
In the product admin page, the field "Stock status" should be hidden for grouped products as stock is controlled individually for each of the child products and setting a stock status in the parent product has no effect.

Fixes #20927
2018-08-01 10:30:21 -03:00
Rodrigo Primo 4f41f99cd2 phpcs fixes 2018-08-01 10:27:22 -03:00
Rodrigo Primo deb48c7c7a Merge branch 'master' of github.com:woocommerce/woocommerce 2018-07-31 16:12:22 -03:00
Rodrigo Primo 3f82ecee8c Remove unnecessary uses of @codingStandardsIgnoreLine 2018-07-31 16:10:51 -03:00
Claudiu Lodromanean 3a6f14f380
Merge pull request #20905 from woocommerce/fix/20904
Fixes an issue with the 'woocommerce_grant_product_download_access' hook
2018-07-31 11:31:05 -07:00
Brent Shepherd ab78e65af9 Update WC_Queue_Interface::get_next()
To more closely align return value with other date APIs in WC, namely
WC_Data. Includes changing return value to:

1. a WC_DateTime instead of a timestamp when a scheduled occurrence is found
2. null instead of false, similar to the default of WC_Data::set_date_prop()
2018-07-31 12:29:15 +10:00
Brent Shepherd d9158a8c0e Add WC_Queue and WC()->queue() wrapper for accessing it
To take care of instantiating a canonical job queue for use across
all of WooCommerce, and by 3rd party code.

Also use this new API for enqueuing webhooks instead of raw Action
Scheduler APIs.
2018-07-31 12:21:07 +10:00
Brent Shepherd 0611ff7665 Add WC_Action_Queue
As a wrapper for Action Scheduler. This implements the WC_Queue_Interface
so it can be used as WC core's job queue. Implementing WC_Queue_Interface
also means this class has more generic and appropriate job queue nomenclature
than Action Scheduler itself. For exsample, it provides a method for
non-delayed jobs, i.e. WC_Queue_Interface::add(), unlike Action Scheduler,
which requires scheduling a job for now(), which while fairly simple, is not
intuitive or immediately obvious to new comers.

This makes it both more clear and convenient to use Action Scheduler
as a simple job queue instead of just a queue for delayed jobs.
2018-07-31 12:21:04 +10:00
Brent Shepherd 8e4466c9c8 Add WC_Queue_Interface
To provide an agreed set of public methods that need to be defined
for any class wanting to act as WooCommerce's queue handler.

The require APIs support both delay jobs, by providing APIs to
schedule an action/job/event for some time in the future, and a
non-delayed job API, to add an event to the queue to run as soon
as possible.
2018-07-31 12:20:30 +10:00
Rodrigo Primo b09bb3eee9 Fix: orderby and order parameters in WC_Customer_Download_Log_Data_Store::get_download_logs()
This commit fixes a bug in WC_Customer_Download_Log_Data_Store::get_download_logs() that made impossible to change the order in which the query returned the results. This method accepts the arguments order_by and order, but it was ignoring them and always using the default values ('download_log_id' and 'ASC' respectively).

It also introduces a very basic unit test to cover the method main functionality and to make sure that the parameters order and orderby are not ignored anymore.

It seems that the modified method was inspired in WC_Customer_Download_Data_Store::get_downloads() before the same bug was fixed in #18620.
2018-07-30 16:40:21 -03:00
Claudiu Lodromanean dc191b58a4
Merge pull request #20916 from woocommerce/fix/20906
Do not use array_merge for appending to tax classes
2018-07-30 11:46:13 -07:00
Claudiu Lodromanean 28f1aed9b0
Merge pull request #20913 from shoheitanaka/patch-15
If email @local include non alphabet
2018-07-30 11:43:10 -07:00
Shohei Tanaka d77990edde
Update it again
Thank you for the concrete method.
2018-07-29 09:17:39 +09:00
Claudiu Lodromanean 075cbd156e
Merge pull request #20915 from stromhalm/master
Merging plugin's tax_queries on REST endpoint, fixes #20914
2018-07-27 06:52:17 -07:00
Shohei Tanaka f4db4ecad7
Update it
Do you mean it?
2018-07-27 19:12:17 +09:00
Adrian Jagusch dc8d15356b
Ensure coding standards on #20914 2018-07-27 11:38:57 +02:00
Gerhard Potgieter 11832f937d Use + instead of array_merge for appending to tax classes since it rewrites numeric keys which we allow in tax class names. 2018-07-27 11:18:16 +02:00
Gerhard Potgieter 75e462c448 Do not use array_merge for appending parent to tax classes rather +, array_merge will rewrite numeric keys which we allow for tax class names. 2018-07-27 11:16:28 +02:00
Adrian Jagusch 7b7bccaf21
Ensure coding standards on #20914 2018-07-27 10:51:15 +02:00
Claudiu Lodromanean 30d34dcf8c
Merge pull request #20910 from woocommerce/fix/tax-rate-non-numeric
Cast tax rate to float so that it can be treated as number further on.
2018-07-26 10:44:56 -07:00
Adrian Jagusch 2a2345acae
Fixes #20914 2018-07-26 17:32:08 +02:00
Shohei Tanaka fdc9d42dc4
If email @local include non alphabet
If I input infoおおお@test.com as billing email address, automatically change to info@test.com by sanitize_email function.

So at first check the email address by is_email function, after that we must use sanitize_email function.
2018-07-27 00:18:09 +09:00
Peter Fabian 9bca5abb40 Cast tax rate to float so that it can be treated as number going forward.
In case no tax rate is specified for the default catch-all tax rate, the tax rate was an empty string which caused a PHP notice when it was later used in arithmetic operations.
2018-07-26 14:32:48 +02:00
Kanishk 4fc06834b6 Fix for #20904 2018-07-26 15:12:28 +05:30
Claudio Sanches 575575d280 Fixed reset password cookie when REQUEST_URI includes cyrillic alphabet
WordPress core doesn't try to satinize this either.
See: ae2b929294/wp-login.php (L646)

Closes #20895
2018-07-25 20:33:11 -03:00
Gerhard Potgieter 20a6c40bdf
Merge pull request #20856 from woocommerce/fix/custom-menu-order
Allow custom menu ordering when set by another filter
2018-07-25 13:55:58 +02:00
Brent Shepherd e00e728f1f Merge branch 'master' into issue_18003 2018-07-25 14:41:56 +10:00
Claudiu Lodromanean 59de4c7148
Merge pull request #20879 from woocommerce/fix/20671
Update redirect option during activation of MailChimp in Install Wizard.
2018-07-24 11:07:00 -07:00
Claudiu Lodromanean 4c945f2e7e
Merge pull request #20854 from EmranAhmed/master
Prevent JS Issue if `woocommerce_available_variation` filter return false
2018-07-24 10:50:08 -07:00
Claudiu Lodromanean 9886d678bb
Merge pull request #20812 from woocommerce/fix/20804
Do not build paypal pay link when no base country is set.
2018-07-24 10:31:34 -07:00
Claudiu Lodromanean 8cde592c54
Merge pull request #20787 from thenbrent/error_log_file_line
Expand fatal error logging and add file/line number to log entries
2018-07-24 10:28:38 -07:00
Claudiu Lodromanean a0b4a8df03
Merge pull request #20611 from woocommerce/fix/20349
Allow filtering variations by attributes in API.
2018-07-24 10:25:36 -07:00
Claudiu Lodromanean 87acfa731d
Merge pull request #20260 from leglesslizard/master
Set low stock notification threshold per product
2018-07-24 10:23:15 -07:00
Peter Fabian d679a88156 Update redirect option during activation of MailChimp in Install Wizard. 2018-07-24 12:29:10 +02:00
Gerhard Potgieter 865f724187 Add category filter to product export functionality. 2018-07-23 11:59:01 +02:00
Khan M Rashedun-Naby 90b6f98582 PHPDoc | Return type changed to string from array. 2018-07-20 22:59:41 +06:00
Khan M Rashedun-Naby eb104ecd17 PHPDoc | Return type changed from array to string. 2018-07-20 22:53:16 +06:00
Emran Ahmed f0151ca873
Re-indexing `get_available_variations` method values when `woocommerce_available_variation` filter return false.
### All Submissions:

* [x] Have you followed the [WooCommerce Contributing guideline](https://github.com/woocommerce/woocommerce/blob/master/.github/CONTRIBUTING.md)?
* [x] Does your code follow the [WordPress' coding standards](https://make.wordpress.org/core/handbook/best-practices/coding-standards/)?
* [x] Have you checked to ensure there aren't other open [Pull Requests](../../pulls) for the same update/change?

<!-- Mark completed items with an [x] -->

<!-- You can erase any parts of this template not applicable to your Pull Request. -->

### Changes proposed in this Pull Request:

Re-indexing `get_available_variations` method values.

Suppose you made changed with `woocommerce_available_variation` hook and skip returning some specific variation product with false value. There is `array_filter` function to filter empty values from `get_available_variations` but it keeps index which convert to js object rather then array on `single-product/add-to-cart/variable.php` template variation form `data-product_variations` attribute, and select box dropdown doesn't show. I just added `array_values` PHP function to reindex after `array_filter` function which convert to js array rather then js object before `get_available_variations` function return.

Closes # .

### How to test the changes in this Pull Request:

1. Before approving pull req just return false on a specific variation via `woocommerce_available_variation` filter.
2. Now check that variation product dropdown doesn't show. Because it needs to reindex array.

### Other information:

* [x] Have you added an explanation of what your changes do and why you'd like us to include them?
* [ ] Have you written new tests for your changes, as applicable?
* [x] Have you successfully ran tests with your changes locally?

<!-- Mark completed items with an [x] -->

### Changelog entry

> Enter a short summary of all changes on this Pull Request. This will appear in the changelog if accepted.
2018-07-20 20:14:57 +06:00
Alex Sanford 0e1ec203cd Allow custom menu ordering when set by another filter
This fixes the case where another plugin sets custom menu ordering to be
true, but its filter runs before WooCommerce's filter. Otherwise
WooCommerce's filter will return false, and disallow the other plugin to
customize its menu items.
2018-07-19 17:39:41 -03:00
Emran Ahmed 33949f3c25
Prevent JS Issue if `woocommerce_available_variation` return false for a variation.
After checking some condition if `woocommerce_available_variation` filter return false. Then Option list don't show because of JS issue.
2018-07-20 01:33:25 +06:00
Peter Fabian b9cdc760ac
Merge pull request #20817 from keefyhub/master
Add class names to `edit_category_fields()` to be inline with other f…
2018-07-19 18:45:00 +02:00
Peter Fabian 22059880cd
Merge pull request #20842 from rnaby/180718-221942-wc-data
Unnecessary Variables and Spaces Removed
2018-07-19 13:49:25 +02:00
Khan M Rashedun-Naby 25ab294d40 Unnecessay Spaces Removed 2018-07-19 10:33:22 +06:00
Claudio Sanches 09d50df86b
Merge pull request #20753 from ldybecklee/master
Fix product csv exporter get stock value
2018-07-18 21:23:44 -03:00
Gerhard Potgieter ea2b3f9d7a
Merge pull request #20821 from woocommerce/fix/20718
Pass an instance of the background updater to the db update callbacks
2018-07-18 14:51:12 +02:00
Khan M Rashedun-Naby 416f4b64ee HashTable Implemented 2018-07-18 01:37:08 +06:00
ldybecklee a7de4672dc
Update class-wc-product-csv-exporter.php 2018-07-17 12:10:55 +08:00
ldybecklee 0cf070ed5e
fix method 'get_column_value_stock' 2018-07-17 12:09:34 +08:00
Rodrigo Primo b39b419e5b Pass an instance of the background updater to the db update callbacks
This commit changes the way that WC_Background_Updater::task() calls the database update callbacks and adds the WC_Background_Updater instance as the first parameter to the callbacks. This is used in wc_update_350_order_customer_id() (36b6bd79c0/includes/wc-update-functions.php (L1870)) to monitor memory usage while the function is running. This change was intended to ship with PR #17895 (see commit c77b2f20f4) but was accidentaly removed when merging commit 083c994732 from another PR.

Fixes #20718
2018-07-16 14:24:42 -03:00
Rodrigo Primo bfebd30565
Merge pull request #20726 from itowhid06/master
Convert  hardcoded db prefix to dynamic db prefix. Fixes #20718
2018-07-16 14:21:45 -03:00
Keith Light 4144211754 Add class names to `edit_category_fields()` to be inline with other fields
Class names are added in `add_category_fields()` but not `edit_category_fields()`
2018-07-16 15:24:57 +01:00
Gerhard Potgieter c7884003dc Do not build paypal pay link when no base country is set. 2018-07-16 11:44:58 +02:00
Brent Shepherd 67744b7768 Add 'woocommerce_shutdown_error' action 2018-07-13 17:08:34 +10:00
Brent Shepherd febea645f9 Log error's file and line number
To help with debugging.
2018-07-13 14:23:17 +10:00