Commit Graph

18598 Commits

Author SHA1 Message Date
Fulvio Notarstefano aba51d4c76 [#23839] Use false arg in class_exists() 2019-06-06 09:56:30 +08:00
Jonathan Moore 9e8debd7ba
Avoid attempting to cache expired sessions
get_session() attempts to cache a session even if it is already expired.
The code used passes negative expiry seconds to wp_cache_add if the session expired in the past:
wp_cache_add( $this->get_cache_prefix() . $customer_id, $value, WC_SESSION_CACHE_GROUP, $this->_session_expiration - time() );

Depending on the caching layers used this will give errors in the logs such as:
ERR invalid expire time in setex in /var/www/html/wp-content/plugins/redis-cache/includes/predis/src/Client.php:370
as reported on: https://wordpress.org/support/topic/error-when-trying-to-get-a-get-a-cache-not-available/
2019-06-03 22:11:46 +01:00
Ajay Ghaghretiya c9bcce3a31 #23850 Fixed the coupon usage limit issue when apply coupon from admin panel (#23851)
* fix the coupon usage limit issue

* fix the if condition for the usage limit

* fixed coding standard

* fix the if conditions for coupon usage limit per user
2019-06-03 10:47:32 -03:00
Claudio Sanches 3a47453d68 Improve regex 2019-06-01 11:52:15 -03:00
Dan Wyman 7355fadfdd Tracker: fix review count.
Fixes #23848
2019-05-30 12:45:47 -07:00
Fulvio Notarstefano ab1ba58128 [#23839] Do not throw an autoloader notice if following the notice recommendation 2019-05-29 12:47:26 +08:00
Claudio Sanches b5da70c74a Introduced woocommerce_search_products_post_statuses filter 2019-05-28 21:05:26 -03:00
Claudio Sanches e04e9ae521 Make NL postcode validation more flexible
Allows postcode without spaces and in lowercase.
2019-05-28 20:51:07 -03:00
Claudio Sanches 2e90e9ab65
Merge pull request #23743 from Sisanu/issue-23717-enhancement-hook
Implement the info & extra actions new filter for Product gallery
2019-05-28 18:22:33 -03:00
Claudio Sanches 2fdf6de827
Merge pull request #23764 from jorgept/patch-1
Update class-wc-countries.php
2019-05-28 18:19:41 -03:00
Claudio Sanches c28af404ad
Merge pull request #23814 from woocommerce/add/x-sendfile-file-filter
Add filters to file paths passed to the different xsendfile like backends
2019-05-28 17:41:49 -03:00
Jonathan Moore 5d6574a00a
rating optional = generate_product_data incorrect
If rating is not mandatory on comments, generate_product_data() produces incorrect output.
For example items with comments but no reviews are output with rating of zero which is getting flagged in google webmasters tools under the heading "Rating is missing required best and/or worst values".

The output google is objecting to is eg:
"aggregateRating":{"@type":"AggregateRating","ratingValue":"0","reviewCount":1}}

postmeta in this case is:
_wc_average_rating 0
_wc_rating_count 0.0
_wc_review_count 1

product lookup table is reporting
rating_count 0
average_rating 0.00

the meta is correct and reflected in the product object, it is the test that is wrong since
if $product->get_review_count() 
may be true even if there are no ratings.

This is solved by substituting get_rating_count() which has the correct number of ratings.
2019-05-28 07:38:07 +01:00
Rodrigo Primo 000c95ea88
Merge pull request #23659 from woocommerce/add/wc-admin-install-nudge
Add wc-admin notice.
2019-05-27 12:29:43 -03:00
Rodrigo Primo ff1020a787
Merge pull request #23787 from woocommerce/fix/tracks-cookie-set-action
Tracks: set cookie on admin_init insead of wp_loaded
2019-05-27 12:16:27 -03:00
Rodrigo Primo 67663836c0
Merge pull request #23739 from woocommerce/fix/23737
Remove administrative message from refund reason
2019-05-27 12:12:07 -03:00
Rodrigo Primo ce6f6a6ddb
Merge pull request #23772 from woocommerce/fix/OBW-tracks-not-enabled
Tracks: Add check for OBW is-opting-in
2019-05-27 12:09:00 -03:00
Gerhard Potgieter b2ed079520 Manual orders coupon usage limits by email (#23775)
* Add functionality to wp-admin order to check for coupon usage based on email addresses, similar to how WC_Cart handles this seperately, included unit tests.

* Only do the coupon by email usage check if order is from a guest. Fix issue with unit test.
2019-05-27 11:45:29 -03:00
Gerhard f5c5ced6b8 Update Emogirifier library 2019-05-27 11:39:33 +02:00
Peter Westwood 4448235a16
Coding Standards: Add missing space. 2019-05-24 18:15:24 -06:00
Peter Westwood f70dcc6a01 Add filters to file paths passed to the different xsendfile like backends.
Different server configurations can require different paths to be sent and it isn't always possible for a plugin to know the correct path for a platform.
These filters will allow a hosting provider to install a platform level configuration via an `mu-plugin` to make sure things work in there configuration.
2019-05-24 17:10:17 -06:00
Claudio Sanches 3a79970289 Fixed a typo in customers endpoint 2019-05-24 15:34:25 -03:00
Claudio Sanches 61346720c7 Allow enforce password strength meter on checkout 2019-05-24 15:27:26 -03:00
Iulia Cazan f49cec5108 Coding standard updates 2019-05-23 08:58:13 +03:00
Claudio Sanches 17da960abe
Merge pull request #23137 from woocommerce/fix/23051
Change coupon amount field type based on coupon type
2019-05-22 21:19:03 -03:00
Claudio Sanches 15aa298585
Merge pull request #23159 from woocommerce/fix/23157
If orderby is used on static homepage, force query to be a page query
2019-05-22 21:17:01 -03:00
Claudio Sanches dc35b89df7
Merge pull request #23178 from davidofug/master
Uganda Billing/Shipping address
2019-05-22 21:07:09 -03:00
Claudio Sanches 793519137a
Merge pull request #23794 from woocommerce/update/23792
Introduce wc_load_cart to dynamically load the cart
2019-05-22 20:51:09 -03:00
Claudio Sanches 28d49031d3
Merge pull request #23695 from james-allan/calc-base-zip-city
Calculate base store taxes including the store's zip and city
2019-05-22 20:49:57 -03:00
Claudio Sanches 8ea6c7c80e
Merge pull request #23651 from woocommerce/update/register-rest-routes
Set register_rest_route override to TRUE in Blocks REST API
2019-05-22 20:49:15 -03:00
Claudio Sanches 359fd9d7d5
Merge pull request #23791 from woocommerce/fix/23630
Clear notices when calling cart-errors.php template
2019-05-22 20:40:21 -03:00
Claudio Sanches 91a8592ebb Fixed conditional logic 2019-05-22 20:16:10 -03:00
Claudio Sanches 688d35e206
Merge pull request #23562 from benhuson/update/23558-related-product-order
Update/23558 Related product order
2019-05-22 19:59:25 -03:00
Claudio Sanches 3cc3565e61
Merge pull request #23774 from connorhu/patch-1
fixed availability schema protocol
2019-05-22 18:07:05 -03:00
Gerhard f6d9faa062 Introducde wc_load_cart to dynamically load the cart, this allows for functionality outside of frontend to initialise the cart. 2019-05-22 12:24:31 +02:00
sergey.r 98586f10f4 Catch WC_REST_Exception while calling do_action( "woocommerce_rest_insert_{$this->post_type}_object" 2019-05-22 13:00:34 +03:00
Gerhard 3a49e7a53b Clear notices after calling checkout/cart-errors.php to avoid duplicate notices on the cart page. cart-errors.php does not output notices but a general notice message yet error notices are still enqueued before calling the template. 2019-05-22 09:49:53 +02:00
Paul Sealock f7e56be638 Tracks: set cookie on admin_init 2019-05-22 12:14:28 +12:00
Claudio Sanches 196d5e77cb
Merge pull request #23041 from woocommerce/update/21701
Add hooks for helper subscription changes
2019-05-21 18:27:15 -03:00
Paul Sealock c74d5b30ca Tracks: use woocommerce_apply_user_tracking and woocommerce_apply_tracking 2019-05-22 09:18:34 +12:00
Rodrigo Primo 870ea9a935
Merge pull request #23704 from woocommerce/fix/23703
Fixed number of args for woocommerce_valid_order_statuses_for_cancel
2019-05-21 17:24:43 -03:00
Rodrigo Primo fbdfb7b87f
Merge pull request #23468 from woocommerce/update/23366
Return WP_Error messages from wp_insert_user()
2019-05-21 17:10:32 -03:00
Rodrigo Primo ae50379f7e
Merge pull request #23325 from woocommerce/fix/rest-api-purge-invalid-orders
[REST API] Stop orders being created if invalid data is sent
2019-05-21 16:36:04 -03:00
Rodrigo Primo 5a15713f95
Merge pull request #23207 from woocommerce/update/23205
Introduce `parse_published_field` in CSV importer
2019-05-21 16:24:03 -03:00
Rodrigo Primo c21a69ff6d Complement WC_Product_CSV_Importer::parse_published_field() phpdoc
Add a phrase to WC_Product_CSV_Importer::parse_published_field() phpdoc
to note that 'true' and 'false' are also supported to set product
published status.
2019-05-21 15:55:41 -03:00
Rodrigo Primo 3fed0d7cbc
Merge pull request #23112 from woocommerce/fix/persistent-cart-filter
Persistent cart improvements
2019-05-21 15:07:55 -03:00
Karoly Gossler a135f02f41
fixed availability schema protocol
As you can see in the example, the scheme only can be on http:
https://schema.org/InStock
The Google Search console has also marked it invalid.
2019-05-21 09:10:56 +02:00
Iulia Cazan 051277d26e Rename the hook 2019-05-21 09:20:46 +03:00
Iulia Cazan 1187563c93 Transform the filter into action, rewrite the piece of code to pass the coding standards, remove markup restriction. 2019-05-21 09:18:15 +03:00
Paul Sealock ca4e79bdd1 Tracks: Add check for OBW is-opting-in 2019-05-21 12:20:25 +12:00
Claudio Sanches a2301dc0cb Removed deprecated PHPCS flags 2019-05-20 17:06:41 -03:00
Claudio Sanches 5eaf71b483 Fixed coding standards 2019-05-20 17:04:24 -03:00
Claudio Sanches cc6d7996fd Restored WC_Shortcode_Products::order_by_rating_post_clauses 2019-05-20 16:57:14 -03:00
Mindaugas Budreika d67381148a Forward query (GET) parameters when executing a batch REST API request. 2019-05-20 14:24:48 +04:00
jorgept e214a85a8c
Update class-wc-countries.php
Add MZ array
postcode => false, 
hidden => true
2019-05-19 22:23:36 +01:00
Ibrahim 0db84aec56
Fixes #23756 2019-05-18 21:04:13 +05:30
Timmy Crawford 01f1749684 Change version compare. 2019-05-17 13:53:38 -07:00
Timmy Crawford 43cd7dc04c Add wc-admin notice. 2019-05-17 13:53:37 -07:00
Rodrigo Primo f8642f2fbb Remove code duplication from OBW payment gateway logic
In #23690 we implemented a few changes to the logic to decide which
payment gateways to display in the onboarding wizard. When working on
this code, we noticed that there was a bit of duplication in it that was
not necessary (see
https://github.com/woocommerce/woocommerce/pull/23690#discussion_r284004924).
We opted to remove this duplication in a different commit, since that PR
was included in a patch release.
2019-05-17 10:32:06 -03:00
Iulia Cazan a1ac64aa30 Implement a new filter that allows for custom info or extra actions to be exposed for each of the attachments selected in the Product gallery 2019-05-17 12:03:40 +03:00
Claudio Sanches f5bab51c6a Improve refund reason when changing order status to refunded
Refund reasons are public, can be visualized on emails, and shall not
contain any sensitive data or administration information.
2019-05-16 17:57:28 -03:00
Gerhard Potgieter afd7e72c03
Merge pull request #23690 from woocommerce/update/obw-stripe
Update OWB Payment Gateway structure
2019-05-16 18:26:29 +02:00
Gerhard 0eef8654f6 payapal enabled setting defaults to false 2019-05-16 16:08:46 +02:00
Gerhard 99b183e5bb Refactor paypal and stripe combined logic, add fallback to specified settings when previously saved settings were detected by no option present for the enabled setting. 2019-05-16 15:35:29 +02:00
Gerhard b0a831b64f OWB: Check PayPal by default when Stripe not available. 2019-05-16 15:26:58 +02:00
Gerhard Potgieter 945330c219
Merge pull request #23634 from woocommerce/fix/23626
Update PayPal capture_payment method triggers
2019-05-16 15:17:58 +02:00
Gerhard Potgieter 173b706ccb
Merge pull request #23734 from woocommerce/fix/23676-2
Dashboard stock queries should only include published products
2019-05-16 15:16:18 +02:00
Rodrigo Primo a247e08ad0 Fix query used to get the number of low stock products in the dashboard
This commits changes the query used to get the number of low stock
products in the WooCommerce Status widget in the admin dashboard. This
query should only count published products and ignore products with
other statuses to match the behavior used in the low stock report.
2019-05-16 09:45:44 -03:00
Gerhard Potgieter 10abe6d4be
Merge pull request #23731 from djboris88/fix/wc-order-wrong-param-type-phpdocs
get_formatted_line_subtotal takes Item object instead of an array
2019-05-16 14:43:30 +02:00
Rodrigo Primo 6e976c7f0c Remove unnecessary conditions from out of stock query
In the query to get the number of out of stock products for the admin
dashboard widget, it is not necessary to use `1=1` and also not
necessary to use `posts.post_type IN ( 'product', 'product_variation' )`
as only products are added to wp_wc_product_meta_lookup.
2019-05-16 09:41:52 -03:00
Gerhard Potgieter 58a04d42e5
Merge pull request #23697 from sokolby/patch-1
Add Filter for wc_prices_include_tax() function return
2019-05-16 14:37:50 +02:00
Gerhard Potgieter 9f0e1a6e64
Merge pull request #23534 from woocommerce/fix/233880-alt
Revise update stock logic
2019-05-16 14:15:13 +02:00
Gerhard Potgieter d8f145c2ca
Merge pull request #23714 from woocommerce/fix/23692
Add back backward compatibility for coupon expiry_date meta field
2019-05-16 14:10:03 +02:00
Gerhard Potgieter 2cfc7b64c1
Merge pull request #23713 from woocommerce/fix/webhooks-object-caching
Use WC_Cache_Helper::get_cache_prefix for webhook count cache
2019-05-16 14:07:27 +02:00
Gerhard Potgieter f76cf57ce8
Merge pull request #23546 from woocommerce/fix/23533
Version template caching
2019-05-16 14:01:25 +02:00
Boris Djemrovski c45e06a130 get_formatted_line_subtotal takes Item object instead of an array 2019-05-16 12:04:34 +02:00
Peter Fabian 207042f7df Put back the manage stock check for lookup table. 2019-05-16 10:57:42 +02:00
parmarhardip 470b0a5424 I have updated the code with suggestion and tested it. Please review from your side. 2019-05-16 10:24:00 +05:30
Rodrigo Primo 33ee11dd62
Merge pull request #23638 from woocommerce/update/23632
woocommerce_product_post_type_link_parent_category_only filter
2019-05-15 15:59:12 -03:00
Peter Fabian 9f0fb0b404 Foxed the use to correct stock quantity parameter. 2019-05-15 16:18:24 +02:00
Peter Fabian 1d29b36c4c Removed comments that are no longer relevant. 2019-05-15 15:46:53 +02:00
Gerhard Potgieter 30ce9ff6a3
Merge pull request #23689 from woocommerce/add/get_used_coupon_codes
Deprecate get_used_coupons in favor of get_coupon_codes
2019-05-15 15:34:40 +02:00
Peter Fabian af7950910c Removed the transaction and locking code.
NOWAIT is not supported on MySQL server 5.5,

SELECT ... FOR UPDATE can leave lingering locks on InnoDB ("When InnoDB performs a complete rollback of a transaction, all locks set by the transaction are released. However, if just a single SQL statement is rolled back as a result of an error, some of the locks set by the statement may be preserved. This happens because InnoDB stores row locks in a format such that it cannot know afterward which lock was set by which statement.", via https://dev.mysql.com/doc/refman/5.5/en/innodb-deadlock-detection.html)
2019-05-15 15:09:16 +02:00
Peter Fabian 68a325249f Removed the extra parameter that didn't make sense.
Also get_data_for_lookup_table should not be checking db value of  _manage_stock as that can be in the process of being changed.
2019-05-15 14:20:27 +02:00
parmarhardip d5337fac70 fix- 23589 I have fixed pricing issue. 2019-05-15 17:49:46 +05:30
Gerhard aadc7a1069 Add todo 2019-05-15 11:23:41 +02:00
Gerhard 8ed1a647bc Restore backward compatibility meta_key for coupon date_expires. @todo: migrate expiry_date in next release to date_expires 2019-05-15 11:21:52 +02:00
Gerhard 3d57a4b474 Use WC_Cache_Helper::get_cache_prefix for prefixing webhook count cache, fixes issue with cache not clearing when incrementing the prefix. 2019-05-15 10:47:50 +02:00
sokolby cb9f765eb2 Fix prefix filter name 2019-05-15 11:44:54 +03:00
James Allan 6069854d9f Replace wc_get_base_location() with individual getters 2019-05-15 15:43:15 +10:00
Claudio Sanches 836083c064 Fixed number of args for woocommerce_valid_order_statuses_for_cancel 2019-05-14 12:52:54 -03:00
Andrey Barashkov 58132056bd
Add Filter for wc_prices_include_tax() function return
It's great to have a filter, because there are some scenarios when it is necessary to create custom logic for displaying prices.
2019-05-14 13:14:50 +03:00
Gerhard Potgieter b7facc0674
Merge pull request #23663 from danielbitzer/add_get_coupons_method
Add WC_Abstract_Order::get_coupons()
2019-05-14 11:35:21 +02:00
Gerhard 486321161c Update usage of get_used_coupon_codes to get_coupon_codes 2019-05-14 11:21:27 +02:00
Gerhard efe3e4c5d6 Move get_used_coupons to WC_Abstract_Legacy_Order and renamed get_used_coupon_codes to get_coupon_codes. 2019-05-14 11:19:48 +02:00
Daniel Bitzer 0705730121 Add WC_Abstract_Order::get_coupons() 2019-05-14 15:46:48 +09:30
Gerhard b694efcb63 Klarna should not be featured. 2019-05-14 07:36:15 +02:00
James Allan 45b461639e Calculate base store taxes including the store's zip and city 2019-05-14 13:43:57 +10:00
Gerhard e131b01133 Modify payment gateway placement, defaults and new logos. 2019-05-13 15:54:44 +02:00
Gerhard 31acfbcb4a Deprecate WC_Abstract_Order::get_used_coupons in favor of WC_Abstract_Order::get_used_coupon_codes, this reflects the actual data being returned better. 2019-05-13 14:40:54 +02:00
Gerhard 36cab83d76 Update out of stock dashboard widget to use same query as in reporting, this only counts published products. 2019-05-13 11:02:50 +02:00