Commit Graph

87 Commits

Author SHA1 Message Date
Claudio Sanches 996d3decfe Fixed file and class dockblock 2018-03-21 20:54:10 -03:00
Rodrigo Primo 45c1adec23 Remove unused private method WC_Shipping::get_default_method()
This method was create in commit 9f65d2a1fc and it was used only once inside WC_Shipping::calculate_shipping(). But commit 4c4f26ff41 removed this call to WC_Shipping::get_default_method() and left the method unused.
2018-03-14 17:50:38 -03:00
Rodrigo Primo e90ce56a50 PHPCS fixes in includes/class-wc-shipping.php 2018-03-14 17:50:19 -03:00
Caleb Burks c21cc2e8fe Replace “Cheatin’ uh?” with friendlier messages 2018-02-07 17:01:12 -05:00
Mike Jolley 8f9bd7d0bf Return packages with no rates. 2017-12-05 15:00:07 +00:00
claudiulodro d7161cb711 Refactor it a little bit 2017-11-02 09:24:09 -07:00
claudiulodro a3ffd72842 Packages are shippable until proven otherwise 2017-11-02 09:16:17 -07:00
Mike Jolley d2e3839d99 Use getters and setters in cart class 2017-08-18 12:51:45 +01:00
ragulka d73e7e4f9d Prevent unwanted double cart notices (#16460)
* Don't add shipping zone debug message when doing ajax

Prevent an issue where the "Customer matched zone" debug message is shown twice after first selecting a shipping method and then changing a product's quantity in cart and clicking Update cart.

* Don't pass event object to cart.update_cart

Prevent accidentally preserving cart notices when `wc_update_cart` event is triggered on body. If the event object is passed to update_cart() as the first param, it evaluates to true, forcing existing notices to be preserved.

* Pass custom arguments to cart.update_cart()

Instead of simply not passing the event object, pass any custom arguments, so it's possible to do something like: $( body ).trigger( 'wc_update_cart', true ); to still preserve notices if needed.
2017-08-16 11:34:35 +01:00
Mike Jolley 4c4f26ff41 Changes to allow shipping to be calculated from totals class
Moved some items from
https://github.com/woocommerce/woocommerce/pull/11889/files to support
this.
2017-07-25 15:11:32 +01:00
Mike Jolley c16acc6b51 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	assets/css/wc-setup-rtl.css
#	assets/css/wc-setup.css
2017-05-23 19:00:24 +01:00
Rasmus Bengtsson 185934fad9 Fix phpdoc to include params and correct types 2017-05-15 13:50:52 +02:00
Rasmus Bengtsson 4f00d7e5e3 PHPDoc: Add missing return statement 2017-05-15 13:37:59 +02:00
Boro Sitnikovski 5a0b70f291 Fix empty string case for `WC_Order::get_total_shipping` 2017-02-06 14:41:19 +01:00
Mike Jolley d7dfdd3d10 Wrap all deprecation calls. 2016-11-23 16:15:00 +00:00
Krzysztof Grabania 4711066490 Removed empty string param in _deprecated_function function (#12301)
`_deprecated_function` has conditional which is checking if third param (replacement) is null. Passing replacement as empty string to this function will fail this test and the end of triggered error will look like this: `Use instead.` instead of `with no alternative available.`. This PR removes all occurrences of empty strings in this function.
2016-11-10 10:17:32 +00:00
Dwain Maralack c27fd5c052 Check if the chosen method is set on the package rates. There are rare instances where store manager may disable a shipping option while the users session is still in progress. This results in an unexpected errors and checkout page hanging. Double checking that the chosen method is accessable on the package avoids the error. (#12111) 2016-10-18 11:38:44 +01:00
Aristeides Stathopoulos 734f284fa4 WordPress.PHP.YodaConditions.NotYoda 2016-09-08 01:32:24 +03:00
Aristeides Stathopoulos ff852038c9 WordPress.Arrays.ArrayKeySpacingRestrictions.NoSpacesAroundArrayKeys 2016-08-27 06:11:30 +03:00
Aristeides Stathopoulos b063bcfe4c last item in a multiline-array should end in a comma 2016-08-27 04:46:45 +03:00
Mike Jolley 0667c1cde1 Remove option based tools 2016-08-24 17:35:13 +01:00
Mike Jolley 84487d0f4b Shipping debug mode moved to shipping settings 2016-08-24 16:55:34 +01:00
Mike Jolley d4cc1f80d4 [2.6] Fix ship to specific counties option
Fixes #11642
2016-08-10 12:04:52 +01:00
Mike Jolley 6e1a640b1c Prevent dirty sessions by removing data objects from the package hash
Closes #11269
2016-08-02 17:10:26 +01:00
Claudio Sanches 7d9d091767 Fixed mixed tabs and spaces 2016-07-11 16:56:35 +02:00
Mike Jolley 3ab6a22146 Match zones with no countries 2016-06-20 13:22:58 +01:00
Mike Jolley 291a997161 Don't show debug on checkout
Closes #11166
2016-06-17 13:21:59 +01:00
Mike Jolley 7266e020fb Avoid normalization of zone postcodes so wildcard matching can be performed on postcodes with spaces. E.g. SP1 *
Also adds matching zone notice when shipping debug is on.

fixes #11154
2016-06-16 11:28:53 +01:00
Mike Jolley 032e57d602 If shipping method count changes, reset to default. 2016-06-15 14:38:08 +01:00
Mike Jolley 5329baee0a shipping_methods can be null 2016-06-07 14:24:10 +01:00
Mike Jolley 847dea6a2d docs/vars 2016-06-07 14:02:02 +01:00
Mike Jolley 730019ef18 scrutinizer best practice 2016-06-06 19:39:23 +01:00
Mike Jolley 3fd15ad50f Unused vars and code docs 2016-06-06 18:57:24 +01:00
Mike Jolley 18b45f55cd @claudiosmweb unregister_shipping_methods didn't unset correctly - this fixes unit tests 2016-05-26 13:03:40 +01:00
Mike Jolley 54231c2946 Allow shipping classes interface to be extended. 2016-05-19 12:38:28 +01:00
JeroenSormani 17878e3ffd Add extra 'chosen_method' argument to the 'wc_shipping_chosen_method' hook 2016-05-19 10:28:54 +02:00
Mike Jolley 15402c2c3d Store separate cache per package_key
Fixes #10872
2016-05-06 17:00:01 +01:00
Thiago Benvenuto 1847b0fab5 Adjusted since version 2016-03-15 20:31:39 -03:00
Thiago Benvenuto 180a09f52c Added docblock to filter
Removed duplicated filter

Renamed filter after shipping costs are calculated
2016-03-15 20:31:39 -03:00
Thiago Benvenuto 30a06d85df Fixed identation mistake 2016-03-15 20:31:39 -03:00
Thiago Benvenuto 7832039bb7 Implemented packages filter for marketplace 2016-03-15 20:31:39 -03:00
Mike Jolley 1549158981 Add 'is_enabled' column to instances table and allow toggle in zones screen
@allendav
2016-03-15 17:23:06 +00:00
Diego Zanella 8426e5cda0 Simplified last change 2016-02-10 21:25:05 +00:00
Diego Zanella 69a97d1af9 Postponed call to woocommerce_shipping_methods filter
* The filter should be called after adding all shipping methods, to provide a complete set of data to consumers that hook into it.
2016-02-10 21:22:44 +00:00
Mike Jolley 75c264837f Justins feedback/code tidy 2016-02-10 13:21:16 +00:00
Mike Jolley c661b4c78f JSlint 2016-01-13 17:08:53 +00:00
Mike Jolley aae956185e merge conflict 2016-01-11 11:49:02 +00:00
Mike Jolley 1076854608 Merge branch 'master' into shipping-zones
# Conflicts:
#	assets/css/admin.css
#	includes/abstracts/abstract-wc-shipping-method.php
#	includes/class-wc-shipping.php
#	includes/shipping/flat-rate/class-wc-shipping-flat-rate.php
#	includes/shipping/flat-rate/includes/class-wc-eval-math.php
#	includes/shipping/free-shipping/class-wc-shipping-free-shipping.php
#
includes/shipping/legacy-international-delivery/class-wc-shipping-legacy
-international-delivery.php
#
includes/shipping/legacy-local-delivery/class-wc-shipping-legacy-local-d
elivery.php
2016-01-11 11:48:18 +00:00
Fredrik Forsmo 65d610883f Improve docblock comments in various WP_Shipping classes
* Added comments to various methods
* Removed `method function` from some comments
2016-01-06 16:19:11 +01:00
Mike Jolley 1630913c62 Fix numeric rates 2016-01-05 15:06:39 +00:00