Commit Graph

518 Commits

Author SHA1 Message Date
Mike Jolley 0830543c4f Add disclaimer to woocommerce_adjust_non_base_location_prices 2015-09-15 16:01:11 +01:00
Mike Jolley 4959937689 Merge branch 'universal-pricing-test' 2015-09-15 15:57:04 +01:00
Mike Jolley 9f1a5e3c26 Remove unused arg 2015-09-15 12:51:45 +01:00
Mike Jolley 0164584aaf Reduce stock once and record in _order_stock_reduced meta
Also clears up the payment_complete method
2015-09-15 12:39:16 +01:00
rchq 332c1bdf9c Update abstract-wc-order.php
Created an action to be able to hook into and add additional notification triggers.
2015-09-08 11:00:22 -07:00
Mike Jolley 358f3f79fa Don't use extract() in add_rate
#9057
2015-09-07 16:02:23 +01:00
James Koster 8eebc7c900 Free is an amount!
All product prices are wrapped in `span class=“amount”`. To make
themers lives easier let’s be consistent. When the product is free the
price should still be wrapped.
2015-09-04 11:19:52 +01:00
Mike Jolley d90d562b42 Leave excl function alone 2015-09-04 10:57:22 +01:00
Mike Jolley e08f8d8902 Apply woocommerce_adjust_non_base_location_prices to all prices 2015-09-04 10:48:50 +01:00
Mike Jolley fad48bf800 Add filters to control shipped via text 2015-09-03 15:05:10 +01:00
Mike Jolley fdb25fa0c3 Pass through tax_display
Fixes #8951
2015-08-26 13:05:52 +01:00
Mike Jolley 57bb0ebe25 Record manual order status change 2015-08-18 16:33:38 +01:00
Mike Jolley 1999dbe92d Improve display_item_downloads numbering and use same function in emails. 2015-08-17 12:17:56 +01:00
Mike Jolley 63fe4a0c05 Correct docbloc Closes #8814 2015-08-13 18:05:55 +01:00
Nicola Mustone 1017798c6c instroducing WC_Session::delete 2015-08-11 10:11:36 +02:00
Brent Shepherd a826330ad0 Reinstate default value for $items
That was (accidentally?) removed with SHA: 877e39064

Fixes "PHP Notice:  Undefined variable: items" when attempting to get
line items of a type that does not exist on the order, like coupons.
2015-08-07 12:12:08 -07:00
Mike Jolley 877e390646 Remove $type from prepare 2015-08-07 14:06:19 +01:00
Mike Jolley 4c8ef3ff33 Use esc_sql on item type instead of esc_attr 2015-08-07 11:37:19 +01:00
George Stephanis c938fa24da More missing esc_attr calls, :( 2015-08-05 15:17:52 -04:00
Mike Jolley 7f3c2a78c5 Get total functions should respect rounding settings.
Closes #8707
2015-08-05 14:33:53 +01:00
Mike Jolley afd0e9edd4 Pass $this to filters
#8722
2015-08-05 13:49:27 +01:00
Nicola Mustone 9822edda0b better naming 2015-08-05 13:54:20 +02:00
Nicola Mustone 9140ca0f76 added cross and up sells IDs filters 2015-08-05 11:01:47 +02:00
Mike Jolley d6bd46c55d Move expand_item_meta to own method
Fixes notices in some extensions (deposits)
2015-08-03 13:21:44 +01:00
Mike Jolley ef798921aa woocommerce_can_reduce_order_stock filter
Needed for extension (deposits)
2015-08-03 10:37:58 +01:00
Mike Jolley 7b2aec4791 Take item qty into consideration when refunding orders
Fixes #8675
2015-07-29 13:13:41 +01:00
Mike Jolley eb19532165 Show 'fee' label is empty 2015-07-28 11:32:53 +01:00
Mike Jolley 794af1c013 When the stock level is changed via update_post_meta ensure the stock_status is kept in sync
Closes #8605
2015-07-27 19:04:08 +01:00
Claudio Sanches c95988bc8a Improve password sanitization in WC_Settings_API, closes #8627
@mikejolley
2015-07-21 18:37:12 -03:00
Claudio Sanches 9e41552342 Removed all "@return void" 2015-07-16 16:55:48 -03:00
Mike Jolley 7285ce74e6 Tax display notice 2015-07-16 10:15:45 +01:00
Mike Jolley f42fa85eab Variation tax status should always come from parent 2015-07-15 19:12:12 +01:00
Mike Jolley db473cc369 Move refund logic into main order class.
These methods are not defined in the abstract.
2015-07-15 16:02:26 +01:00
Mike Jolley 506b5ef3f6 Set total after update_shipping
Based on add_shipping code Closes #8475
2015-07-09 16:48:34 +01:00
Vignesh 91faacb4c9 Return the output directly
Return the output directly instead of variable.
2015-07-09 13:39:29 +05:30
Claudio Sanches 89cef9ff02 Introduces methods to WC_Abstract_Order for get customer full name
New methods:

WC_Abstract_Order::get_formatted_billing_full_name()
WC_Abstract_Order::get_formatted_shipping_full_name()

closes #8535

cc: @mikejolley
2015-07-08 18:00:19 -03:00
Mike Jolley dc00921ced Merge pull request #8486 from justinshreve/get-price-suffix-price-param
Add $price and $qty parameters to get_price_suffix
2015-06-30 12:59:43 +02:00
Justin Shreve eb85cd1682 Add $price and $qty to get_price_suffix so custom values can be passed into get_price_including_tax and get_price_excluding_tax 2015-06-29 19:24:48 +00:00
Justin Sainton 4d5d018a34 Deprecate PHP4 constructor usage in widgets. This is deprecated in upcoming PHP versions. 2015-06-29 11:46:03 -07:00
Gregory Karpinsky 9094bb0662 Do not FATAL on $product->has_file 2015-06-29 09:08:16 -04:00
Mike Jolley 71f2c25da4 Calc totals should not calc tax if disabled 2015-06-23 13:29:38 +01:00
Mike Jolley e08e123988 Note version since 2015-06-19 13:43:18 +01:00
Gabor Javorszky 1dfb27f928 Adds WC_Abstract_Order->get_address
Adds a function to retrieve order address in non-localized, raw, non-formatted way.
2015-06-19 01:43:31 +01:00
Justin Shreve 133b9ce969 Implement the new color picker + preview for integrations as well. 2015-06-11 14:40:06 +00:00
Mike Jolley bb4c303c39 get_type has no args 2015-06-08 12:22:26 +01:00
Mike Jolley 3c87e39ce6 Product get_type() method 2015-06-08 12:20:39 +01:00
Mike Jolley 60dd4474db abstract email class should not exist ! legacy 2015-06-01 10:48:13 -03:00
Mike Jolley ed99be9aed Sanitize tooltips with htmlspecialchars and remove esc_attr usage
Part of #4
2015-06-01 13:36:03 +01:00
Claudio Sanches 51c8bbf87c wrong nonce verification 2015-06-01 13:33:51 +01:00
Nathan Dawson e535e005b7 Add a filter to override needs_shipping_address order method.
If an order doesn't have any shipping methods it's not possible to set needs_shipping_address to true. When 'woocommerce_cart_needs_shipping_address' is set to true the address needs to be shown on the front end and in confirmation emails.
2015-05-28 15:48:37 +01:00
Mike Jolley 5920b88d5d Add classes to tax and shipping labels/notices
Closes #8189
2015-05-27 16:17:36 +01:00
Mike Jolley 28d838c5cd [2.3] Related posts tweaks
Remove real randomness and add transient caching to improve performance.

The above was not worth the cost of the query - only users refreshing a
product page would see a difference.
2015-05-25 15:40:28 +01:00
Shiva Poudel cadc1ab301 Add id for title
Fixes scrutinizer issues for not having param
2015-05-25 17:32:30 +05:45
Shiva Poudel 2871df7451 Move the validate checkbox method above select 2015-05-25 16:58:08 +05:45
Shiva Poudel 4d46b35590 Clean settings-api docblock 2015-05-25 16:56:44 +05:45
Shiva Poudel d90bb50c20 Use get_field_key for validate_*_field 2015-05-25 16:41:08 +05:45
Shiva Poudel 3b9124e0cf Use get_field_key for generate_*_html 2015-05-25 16:28:19 +05:45
Shiva Poudel 597b152407 Introduce get_field_key method for settings API 2015-05-25 16:18:28 +05:45
Mike Jolley b8bcd24edd [2.3] Combine transients for get_rating_count
@claudiosmweb
2015-05-25 02:00:20 +01:00
Mike Jolley 1b73322874 [2.3] Replace max_related_posts_query with wp_count_posts 2015-05-25 01:20:31 +01:00
Mike Jolley 3e8ba7d591 Merge pull request #8062 from Victoor/master
Add order to woocommerce_get_return_url filter
2015-05-01 15:36:16 +01:00
Mike Jolley d6604cb668 Split order details into customer + item templates. Tidied up codebase/template based logic.
cc @jameskoster
2015-05-01 14:50:18 +01:00
Mike Jolley 77941a57c5 New way to gather item meta with bw compatibility on item meta class
#7210

This also includes a new template file for order item details.
@jameskoster Version bumping the order details template. Splitting it
up some more in next commit.
2015-05-01 12:42:29 +01:00
Víctor Falcón 226d940e72 Add order to woocommerce_get_return_url filter 2015-04-28 14:48:39 +02:00
Mike Jolley 30d2ab8af8 Avoid setting is_customer_note when 0
Closes #7995
2015-04-23 11:50:09 +01:00
Mike Jolley 9f57025a1e Remove unnecessary stock notice
Closes #7990
2015-04-23 11:04:16 +01:00
Mike Jolley 9debd84a7f Merge pull request #7978 from InoPlugs/patch-3
[2.3] Update abstract-wc-order.php
2015-04-20 11:12:25 +01:00
InoPlugs Webdesign 520282ff16 Update abstract-wc-order.php
Using a wrong key name -> 'cart_discount_tax' is calculated wrong a few lines below (= $cart_subtotal_tax)
2015-04-18 14:44:39 +02:00
Spreeuw 1e2d0775c4 tax text for negative shipping (refunds) 2015-04-17 12:45:32 +02:00
Spreeuw 3f0b589797 Make get_shipping_to_display compatible with refunds 2015-04-17 12:38:08 +02:00
Mike Jolley 467a269175 Only set author for user added notes so system notes can be distinguished 2015-04-17 11:23:09 +01:00
Mike Jolley 9f65d2a1fc Added priorities for shipping methods to give more control over defaults.
Closes #7871
2015-04-13 15:32:57 +01:00
Mike Jolley 06f2ac2f09 [2.3] Remove rounding from shipping cost to greater precision with taxes 2015-03-31 13:59:17 +01:00
Mike Jolley c410771de2 [2.3] Calculate taxes should save _line_tax_data 2015-03-31 13:21:10 +01:00
Mike Jolley c6dae2b286 Merge pull request #7834 from SiR-DanieL/scrutinizer-issues
Small tweaks and style fixes
2015-03-30 10:33:27 +01:00
Nicola Mustone 95cdb0390f fix related products error 2015-03-27 17:52:21 +01:00
Nicola Mustone 214a0b669f splitted get_related for complexity 2015-03-27 17:28:26 +01:00
Nicola Mustone d2af01df5b scrutinizer suggested tweaks 2015-03-27 16:15:40 +01:00
Mike Jolley 23932dbfca Default calculate_taxes to base
Closes #7765
2015-03-27 10:42:26 +00:00
Mike Jolley ca934ba0d9 Add get methods for length, width, height and add filters
Closes #7617
2015-03-24 16:52:26 +00:00
Mike Jolley 70bf6fc842 [2.3] prices_include_tax boolean fix
Closes #7788
2015-03-23 13:35:40 +00:00
Mike Jolley f04ebeb78e has_enough_stock - use get_stock_quantity
Closes #7779
2015-03-20 10:40:53 +00:00
Mike Jolley 70d125ae96 [2.3] Fix - get_total_discount() function with certain tax setups.
Revised how discounts/discount taxes are stored for consistency. Always
store ex. tax to make data retrieval easier, and to ensure totals are
correct after settings changes. Backwards compatibility maintained
through use of order versioning.

#7728
2015-03-16 12:17:09 +00:00
Mike Jolley d49b5eb182 pass args to order amount filters
Closes #7718
2015-03-13 10:03:08 +00:00
Mike Jolley 6447d4081f Prevent notice
Closes #7705
Fixes #7704
2015-03-13 09:25:24 +00:00
Mike Jolley c44100f9e7 wc_sanitize_tooltip 2015-03-13 09:14:28 +00:00
Mike Jolley 8554796c4b Show calculate total when shipping is needed, but shipping is hidden.
Closes #7650
2015-03-10 16:57:43 +00:00
Barry Kooij 44d8bee22c Use round instead of number_format 2015-03-09 18:10:49 +01:00
Barry Kooij 245a2cf4e7 Added the option to not round the line total. 2015-03-09 18:06:31 +01:00
Mike Jolley 3fc7a0ae65 Allow wc_attribute_label to support product-level attribute names.
Closes #7662
2015-03-09 13:40:07 +00:00
Mike Jolley fa0be55b01 transient cache dashboard reports
Closes #7641
2015-03-09 11:07:49 +00:00
Tamara Zuk d4b08daa64 Avoid 'division by zero' warnings
SHA 85befad283 does not avoid these
warnings if `$inc_tax` is `false`.
2015-03-06 17:46:31 -05:00
Mike Jolley 568a0fe4fa Tweak international delivery
Fixes #7651
2015-03-06 14:45:04 +00:00
Barry Kooij c45c4fd1a2 optimize PR#7605 2015-03-06 15:06:24 +01:00
Tamara Zuk 0e4cea8e85 Introduce `WC_Order::get_cancel_order_url_raw()` method 2015-03-03 02:01:17 -05:00
Claudio Sanches f2fc3b151f Merge pull request #7562 from tjuris/get-related-terms-filters
Apply filters to product/tag terms when querying related products
2015-03-02 10:39:31 -03:00
Tanel Jüris fe60425eeb Rename filter prefix from wc_ to woocommerce_ 2015-03-02 12:09:24 +02:00
Mike Jolley d98569327d Check payment title exists before output. 2015-03-02 10:03:30 +00:00
Barry Kooij ffc436957b Removed double @property comment 2015-02-26 17:14:06 +01:00
Tanel Jüris d9a568bbea Apply filters to product/tag terms when querying related products 2015-02-25 16:02:31 +02:00
Mike Jolley 26487a5734 Fix - Settings API - allow multiselect fields to be emptied.
Closes #7542
2015-02-24 12:12:42 +00:00
Mike Jolley d9455994c8 Use 30 days instead of year for transients to avoid bugs in memcache plugins.
Closes #7520
2015-02-24 12:02:56 +00:00
Mike Jolley 4c411a69e7 * Fix - Saving an order needs to save the discount amount ex. tax like
the cart.
* Tweak - Show discounts inc. tax when showing order totals inc. tax.

Closes #7532

@barrykooij @claudiosmweb How does this look? Looks like we were saving
order discounts inconsistent with the cart/checkout
2015-02-23 17:39:57 +00:00
Mike Jolley 6c9562112f Fix Related post offset. 2015-02-20 16:17:45 +00:00
Mike Jolley 44cf2c2b70 Filter before max_related_posts 2015-02-16 16:48:11 +00:00
Mike Jolley 5c1a0d92e8 Related posts - replace ORDER BY RAND() with random offset.
Closes #7436
2015-02-16 13:16:18 +00:00
Mike Jolley 969e2d3b18 Stock status when updating out of stock product.
Fixes #7402
2015-02-16 12:14:10 +00:00
Paul Wilde c913316f8b Introduce wc_get_page_permalink. 2015-02-15 19:13:22 +00:00
Mike Jolley 30abed2f9e Merge pull request #7375 from tamarazuk/rating-count-fix
Fix average product rating when ratings are not required
2015-02-12 00:04:26 +00:00
Tamara Zuk 7eaae2d561 Fix average product rating when ratings are not required
If ratings are not required, the total rating count was counting all
reviews which skewed the average rating. In other words, reviews with
no rating were counted as a “zero” rating in the average rating
calculation. This bug was introduced in
83a457b29c which provided a fix for #6839.

This change introduces a new product method `get_review_count()` which
can be used to accurately calculate the total number of reviews for a
product. Some instances of `get_rating_count()` were replaced with
`get_review_count()` where appropriate. Additionally, the
`single-product/rating.php` template was adjusted to display the
correct number of customer reviews and ratings in rich snippets. I’ve
also included the `bestRating` rich snippet detailed
[here](http://schema.org/AggregateRating). The version number was
adjusted to 2.3.2 on that template as I think this is a larger change.
2015-02-11 17:55:16 -05:00
Mike Jolley 43c24feffd Item meta removal query in order class. 2015-02-11 22:14:24 +00:00
Brent Shepherd f1fa927f57 Fix WC_Order::payment_complete() on back-end
SHA: c038001eab changed `WC_Abstract_Order::payment_complete()` to use
WC()->session->set( 'order_awaiting_payment' ) instead of
`WC()->session->order_awaiting_payment`, but `WC()->session` is only
set on front-end requests, meaning any extension that tries to complete
payment on an order from the back-end would cause a fatal error.
2015-02-10 16:55:47 -08:00
Claudio Sanches 22c4f02bbf Used filtered comment for woocommerce_new_customer_note action, closes #7349 2015-02-10 14:44:28 -02:00
Claudio Sanches 0558c3c286 Added woocommerce_product_get_rating_html filter for WC_Product class, closes #7337 2015-02-10 13:01:04 -02:00
Mike Jolley 840efcaa00 is_on_sale should compare type Fixes #7344 2015-02-10 12:34:53 +00:00
Mike Jolley 893babaaef woocommerce_product_get_weight filter Closes #7319 2015-02-10 11:18:38 +00:00
Mike Jolley 037242a9a2 More docblock tweaks 2015-02-03 16:03:28 +00:00
Mike Jolley 74abdf27c9 Cast to array 2015-02-03 15:06:08 +00:00
Mike Jolley f032a9c7dd Missing props 2015-02-03 14:44:57 +00:00
Mike Jolley f93e027b09 validate_multiselect_field had dead var 2015-02-03 14:05:09 +00:00
Mike Jolley f711ef32ce Missing bracket in previous commit #copypastefail 2015-02-03 13:16:41 +00:00
Mike Jolley 7c019c0c50 More docblocks; the check for WP_POST isn't needed as the second case (isset) runs regardless and is true for posts 2015-02-03 13:13:07 +00:00
Mike Jolley c038001eab Docblocks for order/product 2015-02-03 12:57:08 +00:00
Mike Jolley dc5b8d9710 @var 2015-02-03 12:28:15 +00:00
Mike Jolley 6bc269858a tweak docblock 2015-01-30 14:30:10 +00:00
Claudio Sanches d6023818fd Fixed the increase and decreate of coupons usage count 2015-01-30 12:14:34 -02:00
Claudio Sanches def250e912 Display taxes labels in order totals when order has refunded, closes #7229 2015-01-29 18:50:08 -02:00
Claudio Sanches c995f23354 Fixed WC_Abstract_Order coupon methods
@mikejolley
2015-01-26 16:48:03 -02:00
Claudio Sanches 8ff08e70af Fixed the WC_Abstract_Order::get_user_id() return type and fixed the orders customer_id 2015-01-26 14:41:19 -02:00
Mike Jolley 54e025939b Use get_post_status to avoid out of date order data.
Partly related to #7208
2015-01-26 13:07:29 +00:00
Brent Shepherd 95d87e28d6 Do not set property when calling __get()
SHA: 100b95a tweaked the `__get()` magic method in `WC_Product` to:
 * only call `get_post_meta()` once; and
 * set `$this->$key` to save the overhead of calling `__get()` every
   time that property needs to be accessed.

However, in the process, it also set an empty value (`''`) - the default
return value of `get_post_meta()` for every single value accessed on
the product object, meaning that any calls to `isset()` after attempting
to get that value would return `true`, even if `metadata_exists()` for
that property would return false (and no value is set in memory).
2015-01-23 15:01:10 -08:00
Claudio Sanches 04c584ccf6 Added properties docs for abstract product class 2015-01-23 15:51:33 -02:00
Scrutinizer Auto-Fixer 19f660171e Scrutinizer Auto-Fixes
This commit consists of patches automatically generated for this project on https://scrutinizer-ci.com
2015-01-23 14:37:20 +00:00
Mike Jolley 7f2a943075 Docblocks 2015-01-23 14:35:17 +00:00
Mike Jolley 2584041700 wc_price enhancements
- Renamed some 2.3 methods for consistency
- Allow more args to be passed to wc_price to control output
- Filter wc_price args which Closes #7188
- wc_get_price_decimal_separator function
- wc_get_price_thousand_separator function
- wc_get_price_decimals function
2015-01-23 11:50:32 +00:00
Mike Jolley 91de767442 Product constructor setting post incorrectly 2015-01-20 14:00:30 +00:00
Mike Jolley 5404006b29 MAP Url method 2015-01-20 13:31:02 +00:00
Mike Jolley de4129f9b2 WP_POST docs 2015-01-20 13:20:22 +00:00
Mike Jolley 5ab35bf212 Protected variables 2015-01-20 13:01:19 +00:00
Mike Jolley baea8f9ad4 Product class properties 2015-01-20 13:00:56 +00:00
Mike Jolley b941636068 Deprecate unused and pointless get_billing_address() get_shipping_address() methods
@claudiosmweb
2015-01-20 12:39:21 +00:00
Mike Jolley df66e0bcc8 Docblocks and code fixes in order class 2015-01-20 12:34:40 +00:00
Mike Jolley 2e624995b4 More magic properties and variable declarations in order class 2015-01-20 12:07:33 +00:00
Mike Jolley ea13b90340 Define magic properties for address data 2015-01-20 11:23:17 +00:00
Mike Jolley c0bea39c95 Seeing if magic properties are recognised 2015-01-20 11:06:15 +00:00
Mike Jolley a494bf84de Check if already set before setting in WC_Session.
Prevents unintended dirty sessions. Fixes #6846
2015-01-20 09:46:57 +00:00
Mike Jolley 3716329b16 Prevent error when user does not exist 2015-01-19 14:50:06 +00:00
Mike Jolley fef41c149c @uses WP_POST 2015-01-15 15:03:12 +00:00
Mike Jolley dc902ecfed form_fields docblock 2015-01-15 15:03:12 +00:00
Claudio Sanches 22da603567 Simplify commerce hosted payments feature 2015-01-13 13:40:43 -02:00