Commit Graph

357 Commits

Author SHA1 Message Date
claudiulodro a416ebe09b It kind-of works. 2017-08-09 14:55:35 -07:00
Mike Jolley 5874fb8715 Type and sum fix 2017-08-09 19:11:02 +01:00
Mike Jolley c556facd41 Fix percent coupon and display 2017-08-09 19:02:10 +01:00
Mike Jolley f71dc64d35 Manual discounts and negative taxes 2017-08-09 18:53:10 +01:00
Mike Jolley 2def474421 Order calc 2017-08-09 16:19:10 +01:00
Mike Jolley e9c3ebebdc Merge branch 'master' into feature/discounts-class
# Conflicts:
#	includes/abstracts/abstract-wc-data.php
#	woocommerce.php
2017-08-08 15:49:59 +01:00
Mike Jolley 6af275da6e Only return tax classes if product is taxable.
Fixes #16241
2017-08-03 08:44:02 +02:00
Mike Jolley 306db69eaf Remove order subclass 2017-07-27 10:49:47 +01:00
Mike Jolley abdb325d83 Order items 2017-07-26 15:47:30 +01:00
Jaydeep Rami 3522857d23 Fix typo in WooCommerce plugin (#16135)
* Fixed typo

* Fixed more typo

* Fixed more typo

* Fix tyop

* Fix more typo

* Fix more typo

* Fix typo

* Fix typo

* Fix typo

* Fix typo datatime object

* Fix short name of compat

* Fix typo: update short name

* Fix typo "deactive" to "deactivate" and short BW - Compat

* Fix typo "Backwards compat"

* Fix typo 'parameters'

* Fix more typo 'pararmeters'

* Fix typo 'compund'

* FIx typo order

* Fix typo

* Fix typo 'incorrecly'

* Fix typo 'genarate'

* Fix typo 'reletive'

* Fix typo 'Handly'

* Fix typo 'rotatated'

* Fix typo

* Fix typo 'additonal'

* Fix typos
2017-07-17 11:10:52 +01:00
Brent Shepherd 1992d90d37 Revert "Merge pull request #14706 from crodas/make_get_item_consistent"
This reverts commit 56ffa3d2aa, reversing
changes made to 64a60de24f.
2017-06-27 22:28:23 -07:00
jgacuca567 4a9950b4c5 Changed their to there 2017-06-06 17:30:20 -04:00
Cesar Rodas c96c62f380 Improved how taxes are applied
If by default the taxes are based on the shipping address and the current order doesn't have any, it would use the billing address rather than using the Shopping base location.

It's basically what WooCommerce is [doing already in Javascript](https://github.com/woocommerce/woocommerce/blob/master/assets/js/admin/meta-boxes-order.js#L526-L575). This kind of checks should be done in the backend, never in the client side.
2017-06-01 15:51:55 -04:00
Mike Jolley 56ffa3d2aa Merge pull request #14706 from crodas/make_get_item_consistent
Make get item consistent
2017-05-31 11:10:09 +01:00
Cesar Rodas 8c67ae6a7a Make `get_item` to rely no `get_items` 2017-05-29 12:38:25 -04:00
Cesar Rodas 563aa887f7 Apply woocommerce_order_get_items filter to get_item 2017-05-24 17:30:14 -04:00
Cesar Rodas ea9c573f2c Improved WC_Order::get_item()
Do not load all items, just load the items with a given order_item_type.
2017-05-23 20:12:47 -04:00
Cesar Rodas b612bab38b Fixed coding styles 2017-05-23 19:18:31 -04:00
Mike Jolley 6dfdc86111 Merge branch 'pr/14678' 2017-05-23 19:16:37 +01:00
Mike Jolley 109e951de3 Renamed filters and actions 2017-05-23 19:16:30 +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
Mike Jolley d3666738d8 Merge branch 'pr/15069' 2017-05-23 18:56:58 +01:00
Mike Jolley 00e5189a05 Merge pull request #15070 from rasmusbe/phpdoc-missing-return-throws
Phpdoc: Add missing return and throws
2017-05-23 18:50:58 +01:00
Mike Jolley dd798d219e Make calculate tax function clear taxes if disabled on recalculation
Fixes #15057
2017-05-15 14:55:39 +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
Claudio Sanches 257594a67c Merge pull request #14945 from woocommerce/pr/14875
Pr/14875
2017-05-08 13:56:12 -03:00
Mike Jolley 03a69e1d44 Prepend new item keys with `$items_key` to make them unique.
Fixes #14875
2017-05-08 17:44:10 +01:00
Boro Sitnikovski f493afe718 intval -> floatval 2017-05-04 10:09:16 +02:00
Boro Sitnikovski 8f63211f1c Fix non numeric warning for orders. 2017-05-03 08:31:35 +02:00
Cesar Rodas 7f357b18ba Fixed typo
This expression had a typo from the refactoring
2017-04-26 03:21:10 -04:00
Cesar Rodas d3fd16617c Improved phpdoc 2017-04-26 02:57:00 -04:00
Cesar Rodas 38f379a7d7 Make get_item() consistent (like get_items())
Right now get_item() is loading an item from the database directly. It doesn't
take advantage of our cache and it doesn't check if the item is already loaded in memory.

There is also another bug (or feature?) that it will let you load any item, even if the item is not related to the current order. I believe this is a bug, if somebody really wants to load any item regardless of the order they should use `WC_Order_Factory::get_order_item`.

Another bug is that items loaded with get_item() are not related to the order object, therefore any calls to Order::save() won't persist the changes made to the item.

This commits makes sure the item returned by get_item is loaded similarly like get_items() does, taking advantage of the cache and the $items protected property (chances are the item is already in memory, ready to be used).

If a given item is not found false will be returned. If item exists but it is not related to the current object it will return false as well (If this behaviour is wanted, I can easily change it load the item anyways instead of returning false).
2017-04-26 02:54:14 -04:00
Petar Petrov fdb28218ea items_type_key filter and woocommerce_order_line_item_object fix 2017-04-25 18:07:40 +03:00
Mike Jolley 9923612832 Prevent orders being their own parent (!)
Closes #14660
2017-04-25 14:18:27 +01:00
Petar Petrov 2b3ec357ad fix-14302 2017-04-25 14:12:36 +03:00
Mike Jolley 4a6c87d1cc docblock 2017-04-20 16:03:40 +01:00
Mike Jolley 8e28af8b87 define get_user_id/get_user methods for bw compat
Closes #14543
2017-04-20 16:02:10 +01:00
Mike Jolley de016c6615 Fix call to is_compound method
Fixes #14484
2017-04-18 12:00:21 +01:00
Beka Rice d35621f166 Cast unmodified tax as float as well 2017-04-15 12:01:37 -04:00
Beka Rice 9de8589c9c Fix PHP 7.1 warnings when manually adding order items 2017-04-14 11:12:53 -04:00
Claudiu Lodromanean 19361127a9 Array filter before saving 2017-04-06 14:47:22 -07:00
Mike Jolley fbcb46b273 filter items which are false
https://wordpress.org/support/topic/call-to-a-member-function-is_type-cl
ass-wc-order-php-on-line-1305/
2017-04-06 22:15:42 +01:00
Mike Jolley d917856378 Validate status if object_read
#13891
2017-04-04 12:39:35 +01:00
Mike Jolley 7857fbe41f Cast values to float
Fixes #13752
2017-03-24 12:05:28 +00:00
JeroenSormani 373bdda4f8 Add required filters to allow custom order item types 2017-03-20 10:37:06 +01:00
Claudio Sanches 59c2849736 Changed version 2.7 to 3.0 2017-03-15 13:36:53 -03:00
Mike Jolley d55653a408 Merge branch 'master' into fix-13498
# Conflicts:
#	includes/class-wc-order.php
#	tests/unit-tests/crud/data.php
2017-03-15 15:52:40 +00:00
Mike Jolley 6848fad224 Merge branch 'timezone-poc' into fix-13498 2017-03-09 16:10:07 +00:00
Mike Jolley 9427eb048d Set default status in getter, not during contruct.
Prevents loops like in Prospress/woocommerce-subscriptions#1902
2017-03-09 13:45:33 +00:00