Commit Graph

365 Commits

Author SHA1 Message Date
Brent Shepherd 89e932c338 Fix shipping tax when calling calculate_shipping()
The $shipping_taxes is a multidimensional array so array_sum() does not
correctly sum the values. The $merged_taxes is a single level array with
all other taxes set, so array_sum() can be safely used on it.
2017-09-21 16:48:32 -07:00
Claudiu Lodromanean e713b5beb3 Merge pull request #16869 from woocommerce/fix/16861
Fix legacy access to array props (fees, taxes, coupon totals + taxes)
2017-09-21 09:47:29 -07:00
Brent Shepherd 470c5f7a1d Use __FUNCTION__ for filter hook name
To avoid including the WC_Cart class name and a double colon.

Example hook from WC_Cart::get_total():
 * Before this PR: woocommerce_cart_WC_Cart::get_total
 * After this PR: woocommerce_cart_get_total
2017-09-20 14:45:37 -07:00
Mike Jolley eb79566985 Fix legacy access to array props (fees, taxes, coupon totals + taxes)
Closes #16861
2017-09-20 15:39:05 +01:00
Gabor Javorszky d3ade84852 Add cart object to filters with quantity updates
No issue.

Other filters (remove cart item, restore cart item) have the cart object passed as well. These ones should be too.
2017-09-05 16:40:44 +01:00
claudiulodro 734ed70462 Fall back to defaults if not set in cart 2017-08-28 14:12:35 -07:00
Mike Jolley 22813663d7 Merge pull request #16569 from woocommerce/update/fees-api-class
WC_Cart_fees and negative fee calculations
2017-08-23 10:59:19 +01:00
Mike Jolley 00cb48a5fe Pass through to order 2017-08-22 16:20:23 +01:00
Mike Jolley 57865204aa Cart fees class and legacy 2017-08-22 15:17:58 +01:00
Umangvaghela 5794a9cb34 Update condition 2017-08-22 15:23:34 +05:30
Mike Jolley 3d002f842f Fix get totals method 2017-08-18 17:18:41 +01:00
Mike Jolley 4567169aa9 Fix remove from cart 2017-08-18 16:37:24 +01:00
Mike Jolley 1c8ad67a9e Fix tests and tax merges 2017-08-18 15:05:01 +01:00
Mike Jolley 302512e51f Combine taxes correctly 2017-08-18 13:48:53 +01:00
Mike Jolley a2858245fe Remove call - it's hooked 2017-08-18 12:52:29 +01:00
Mike Jolley d2e3839d99 Use getters and setters in cart class 2017-08-18 12:51:45 +01:00
Mike Jolley a190dc79c3 Legacy getters/setters 2017-08-18 12:24:17 +01:00
Mike Jolley b9fea8419b getters and setters for totals 2017-08-18 12:05:18 +01:00
Mike Jolley 0c751087f9 Cast to arrays 2017-08-18 11:44:07 +01:00
Mike Jolley aefb9c4705 Moved magic method to legacy 2017-08-18 11:37:22 +01:00
Mike Jolley c0368362ce First pass 2017-08-18 11:29:26 +01:00
Mike Jolley c74835ec31 Use WP_User_Query 2017-08-14 12:51:04 +01:00
Mike Jolley 40757ddf86 Search given email against all user fields for matches. 2017-08-14 12:28:19 +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 6dc67ee133 phpcs 2017-08-08 10:51:35 +01:00
Mike Jolley 6af275da6e Only return tax classes if product is taxable.
Fixes #16241
2017-08-03 08:44:02 +02:00
claudiulodro 43cbcd04ef Remove extra calcs and populate item totals 2017-07-31 11:48:34 -07:00
Claudiu Lodromanean 95ffa441e0 Merge pull request #16290 from woocommerce/feature/15500-1
Soft deprecated WC_Cart->coupon_applied_count
2017-07-31 09:16:33 -07:00
Claudio Sanches 77855f9d07 Soft deprecated WC_Cart->coupon_applied_count 2017-07-28 18:12:56 -03:00
Claudio Sanches b8305f150e Use WC_Cart_Totals to calculate totals 2017-07-28 17:41:46 -03:00
Mike Jolley 51fbb1aec3 set_items_from_cart 2017-07-28 13:02:39 +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 d24faebea8 Split fixed cart from other discounts in class. 2017-07-18 20:42:47 +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
Caleb Burks 03d71cd8ee Add filter for cart cross-sells 2017-07-11 13:33:51 -05:00
Caleb Burks 5af560e32a Add `cart_subtotal` to the shipping package 2017-07-04 03:05:39 -05:00
Mike Jolley 748c39d966 Add note about #15904 2017-07-03 10:26:26 +01:00
claudiulodro 4e7d3333cf Use type check in coupon constructor 2017-06-27 13:53:56 -07:00
Mike Jolley 66c7c20844 Should work in reverse 2017-06-14 12:57:26 +01:00
Mike Jolley 985f7e043f Update totals if local pickup is selected 2017-06-14 12:46:59 +01:00
Mike Jolley 6eacecfeb6 Append blog ID on persistent cart user meta 2017-06-08 13:47:23 +01:00
Beka Rice 494fa0974c Filter quantity being added to the cart 2017-06-02 00:07:06 -04:00
Rasmus Bengtsson 185934fad9 Fix phpdoc to include params and correct types 2017-05-15 13:50:52 +02:00
Mike Jolley 0d89250b3f Merge pull request #14748 from woocommerce/fix/stock-in-cart-notice
Correct the stock display notice when a variable product manages stock for it's children
2017-04-27 17:38:59 +01:00
Mike Jolley aacb01d1e7 Merge branch 'pr/13503'
# Conflicts:
#	assets/css/twenty-seventeen.css
#	assets/css/woocommerce-layout.css
#	assets/css/woocommerce-layout.scss
#	assets/css/woocommerce.css
2017-04-27 12:46:05 +01:00
Mike Jolley 60a5ecf775 Merge pull request #13761 from franticpsyx/sold-individually-found-in-cart
[3.1] Add woocommerce_add_to_cart_sold_individually_found_in_cart hook
2017-04-27 11:32:33 +01:00
Mike Jolley dac36505c2 Correct the stock display notice when a variable product manages stock for it's children 2017-04-27 11:03:56 +01:00
Mike Jolley f9dd3310b2 Unfiltered context rather than true 2017-04-13 12:38:54 +01:00
Claudiu Lodromanean 715656921d wc_is_attribute_in_product_name 2017-04-10 14:35:16 -07:00
Mike Jolley 95397188d5 Make get_cross_sells unique.
Fixes #14158
2017-04-10 15:20:41 +01:00