Commit Graph

1536 Commits

Author SHA1 Message Date
Claudio Sanches dac471273f Merge pull request #10884 from woothemes/wp-api-batch
[REST API] Batch create, update and delete items
2016-05-11 16:22:54 -03:00
Mike Jolley c9095abf8e Save line taxes for shipping rows
Fixes #10897
2016-05-11 16:32:51 +01:00
Mike Jolley 0927cbee8d Tweaks saved card markup and styling to improve CC form. 2016-05-10 15:43:39 +01:00
Claudio Sanches 0918a6b6bc Fixed batch errors response 2016-05-09 18:21:36 -03:00
Claudio Sanches 068b77cc43 Created WC_REST_Controller to allow batch create, update and delete items 2016-05-09 18:16:48 -03:00
Mike Jolley 167df8acce Tokens: Get cards on any screen 2016-05-09 17:36:40 +01:00
Mike Jolley fd001669fe woocommerce_email_order_items_args filter
Closes #10812
2016-05-03 15:40:34 +01:00
Mike Jolley f5e9875548 Allows stock status to be considered for availability and stock status on frontend.
Refactors code which make it so stock status was actually ignored if on
backorder. Fixes #10834

@claudiosmweb
2016-05-03 15:10:31 +01:00
Mike Jolley e53704431d Don't use abstract
Fixes #10815
2016-04-29 15:28:09 +01:00
Mike Jolley 2b1442c3f0 Added get_rate_id() method for consistent rate nams 2016-04-25 17:06:38 +01:00
Mike Jolley 87dc31ffac Force name to be set
Closes #10782
2016-04-25 13:25:15 +01:00
Mike Jolley 29c6acf767 Used positional placeholders in strings where the order of strings may require modification in the locale.
Closes #10775
2016-04-25 13:07:41 +01:00
Mike Jolley 87bc757de8 Correct $package usage and comments 2016-04-20 15:02:30 +01:00
Mike Jolley 04e9eef0ac Correct access props and comments 2016-04-20 15:02:19 +01:00
Diego Zanella e0c565da2d Backward compatibility with WC 2.5 and earlier
* Restored signature of WC_Shipping_Method::add_rate() method, while maintaining the features added in WC 2.6 to handle shipping zones.
2016-04-20 08:59:19 +01:00
Diego Zanella a506909822 Backward compatibility with WC 2.5 and earlier
* Slightly altered previous change to maintain the exact logic used before (i.e. the WC_Ajax class sets the POST data for the shipping method explicitly).
2016-04-20 08:49:32 +01:00
Diego Zanella ba46a5275f Backward compatibility with WC 2.5 and earlier
* Restored signature of WC_Settings_API::process_admin_options() method.
2016-04-20 08:48:29 +01:00
Claudio Sanches b6d33ee906 WP-API 2016-04-19 12:49:16 -03:00
Claudio Sanches 1021bfb754 Simplified the way how check terms permissions 2016-03-31 16:57:55 -03:00
Claudio Sanches 5091b36d41 Align variables 2016-03-31 16:34:16 -03:00
Claudio Sanches c890961f76 Fixed contexts on abstract terms controller 2016-03-31 16:17:39 -03:00
Claudio Sanches bf64942b28 Align variables 2016-03-31 16:14:18 -03:00
Claudio Sanches 8df7723895 Fixed permissions error messages 2016-03-31 16:03:59 -03:00
Claudio Sanches bb029747b7 Changed $namespace from public to protected in posts controller 2016-03-31 15:28:17 -03:00
Mike Jolley c757fd9940 Merge branch 'shipping-zone-modals'
# Conflicts:
#	assets/css/admin.css
#	assets/css/admin.scss
2016-03-31 15:20:06 +01:00
Claudio Sanches bb7e5ecfb6 Allow filter products by taxonomies and sku 2016-03-30 20:05:12 -03:00
Claudio Sanches 5d99b8b336 Register dp filter for orders and allow filter orders by customer id 2016-03-30 19:11:56 -03:00
Claudio Sanches f574a149d1 Attributes permissions 2016-03-30 14:49:22 -03:00
Claudio Sanches 82a6a5f18e Settings and reports permissions 2016-03-30 14:33:33 -03:00
Claudio Sanches 0fce9c5243 New product terms permissions 2016-03-30 14:17:40 -03:00
Claudio Sanches f4012b7f1f Reviewed post permissions 2016-03-30 11:17:16 -03:00
Mike Jolley 84d3fe2d82 wc_format_localized_decimal on dimensions 2016-03-30 13:19:01 +01:00
Mike Jolley 975f9d8c2d Remove nonce on cancel order URL
Nonces are invalid if the user ID changes during checkout e.g. through
registration. Cancel links are invalid.

cc @claudiosmweb

Fixes #10605
2016-03-30 12:45:25 +01:00
Claudio Sanches 5bf8c808fc Added methods to create and edit products 2016-03-29 21:22:10 -03:00
Mike Jolley 5f6aa6c160 Fix modals and ajax events 2016-03-24 19:06:51 +00:00
Mike Jolley 8b53d1a618 Only load modal if supported 2016-03-24 18:31:39 +00:00
Mike Jolley d3ac3f4073 Modals first pass 2016-03-24 17:26:40 +00:00
Mike Jolley dd68a57fff Merge pull request #10592 from woothemes/item-box-tweaks
Order Item Meta Box Tweaks
2016-03-23 15:03:24 +00:00
Joey Kudish bde619c4d6 Fix for older versions of php
Older versions of php cannot check `empty()` with a non-variable. Fixes
fatal introduced in 1d35fd6d73
2016-03-22 17:36:24 -07:00
Claudio Sanches 935a784061 Fixed header location when creating attribute terms 2016-03-22 15:34:27 -03:00
Mike Jolley f73149feaf Tweak variation display and reenable bulk editing 2016-03-22 17:13:39 +00:00
Mike Jolley 8d76396eaf Merge pull request #10588 from justinshreve/payment-tokens-wc-data
Convert WC_Payment_Tokens to use the new WC_Data
2016-03-22 14:14:29 +00:00
Justin Shreve 1d35fd6d73 Convert WC_Payment_Tokens (and CC/eCheck tokens) to use the new WC_Data and meta handling code. 2016-03-21 11:06:17 -07:00
Mike Jolley 7be2b129b6 Removed bulk actions from order items panel
Reduce/increase order item stock is less important these days do to
automatic stock reduction (when status changes) and because when you
refund items you can restock items via checkbox. Manual stock changes
can be performed by editing products.

Decreases complexity of order items box.
2016-03-21 14:58:14 +00:00
Justin Shreve 705213d4f5 Move meta_id into the _meta_data array instead of trying to use them as array keys.
This is so we can just use PHP's keys, instead of trying to add new meta and guess an avaible key.
2016-03-18 12:24:35 -07:00
Mike Jolley 1238a37124 Merge pull request #10576 from justinshreve/coupon-crud
Coupon CRUD
2016-03-18 11:12:32 +00:00
Mike Jolley c25ef5e55a Adjust OR logic
#10568
2016-03-17 17:54:09 +00:00
Justin Shreve ffc80ccd15 Start updating some usage, and start implementing the actual CRUD functions, and some new get/setters for username, email, etc. 2016-03-17 09:41:12 -07:00
Justin Shreve f65c9305bf Update WC_Coupon to use the new WC_Data class and meta methods. 2016-03-17 09:38:56 -07:00
Mike Jolley 12e23bb143 Adjust related query nesting
Fixes #10568
2016-03-17 16:02:33 +00:00
Mike Jolley 6765967be8 Add data and tostring handling to WC_Data 2016-03-17 15:22:29 +00:00
Justin Shreve a51e164fd7 Set versions to 2.6 2016-03-15 15:44:04 -07:00
Justin Shreve 9aff45e154 Feedback 2016-03-15 15:11:07 -07:00
Claudio Sanches f53e582566 Include prepare_links() to abstract posts controller 2016-03-15 16:55:41 -03:00
Claudio Sanches 218390071c Improve posts controller 2016-03-15 16:45:46 -03:00
Justin Shreve 5d6cdd05f1 Finish out tests, make sure to use cprrect meta ID field in order by clause. 2016-03-14 11:12:47 -07:00
Justin Shreve 97c0edf445 Start on tests for testing CRUD meta.
Includes Mock object for testing against the abstract WC_Data.
2016-03-14 11:12:47 -07:00
Justin Shreve f572a887e0 New Abstract WC_Data Class 2016-03-14 11:12:47 -07:00
Justin Shreve 5dbfc7ae16 Fix Payment Token 'set default' methods. Makes sure we are using the user ID of the payment token, and not the current user.
Also makes sure to properly unset other tokens when a new one is set as default. Finally, we make sure that a user is always set in our payment token tests (which was broken in some WP versions which alerted us to some broken tests).
2016-03-14 09:41:37 -07:00
Mike Jolley c573a5b75f Only add product line if product exists.
Fixes #10556
2016-03-14 15:40:58 +00:00
Mike Jolley 807b860a6c Merge pull request #10514 from SiR-DanieL/email-items-type
Added bool param for email order items hooks
2016-03-09 12:00:11 +00:00
Mike Jolley 55918626f5 [2.5] Update date for paid orders during non-manual updates only
Fixes #10510
2016-03-09 11:58:44 +00:00
Nicola Mustone c7756187e0 Added bool param for email order items hooks 2016-03-09 12:55:28 +01:00
Claudio Sanches 5f73c23da6 Better query params name 2016-03-09 01:46:04 -03:00
Claudio Sanches 396242b89c Fixed links for terms 2016-03-07 17:28:52 -03:00
Claudio Sanches 426410c2ae Manipule product attribute terms 2016-03-07 16:39:24 -03:00
Claudio Sanches 349b817d1e Fixed typo 2016-03-07 15:45:10 -03:00
Claudio Sanches 9f07be5271 Make easy to extend our rest controllers 2016-03-07 15:36:17 -03:00
Claudio Sanches b5e65c68b9 Added methods to update and create terms 2016-03-07 14:49:14 -03:00
Justin Shreve 927941e2ca Merge pull request #10260 from justinshreve/token-api
Payment Token API
2016-03-04 04:34:41 -08:00
Claudio Sanches d4d91d0fe9 Allow delete categories, tags and shipping classes 2016-03-03 18:19:02 -03:00
Mike Jolley e7e4808726 Correct status check and improved note
#10461
2016-03-03 17:04:20 +00:00
Mike Jolley fab1f224c6 When creating new order from draft, assume 'pending' for status transitions
Fixes #10461
2016-03-03 13:51:04 +00:00
Claudio Sanches 1f8e07108f Created methods to list and get terms 2016-03-02 20:22:12 -03:00
Claudio Sanches 0b0aa47421 Created methods to create and update customers 2016-03-02 19:14:03 -03:00
Claudio Sanches 8fe7935925 Fixed textdomains 2016-03-02 19:03:18 -03:00
Claudio Sanches c0affe96e0 Created API functions 2016-03-01 19:41:59 -03:00
Claudio Sanches 26c325acce Fixed __() functions 2016-03-01 17:53:25 -03:00
Justin Shreve ccb2c90ef3 Update references for the tokenization UI script (hiding/showing inputs) to use the correct file. 2016-03-01 11:49:43 -08:00
Justin Shreve 49c45c6dc1 Make sure the is_default/default token ability works correctly. Also adds a new method for getting a users default token. Fixes up some docblocks. 2016-03-01 11:49:42 -08:00
Justin Shreve 0985292a79 Make sure the tokenization script is output even if the current user is logged out (we still show save payment method if user is creating account). 2016-03-01 11:49:42 -08:00
Justin Shreve e3d7e206d0 Create a function for getting correctly formatted credit card type labels (MasterCard, American Express, etc) 2016-03-01 11:49:42 -08:00
Justin Shreve 75f2e6b85c Fix up some comments and add uninstalling code. 2016-03-01 11:49:42 -08:00
Justin Shreve c0b74296ff * Remove WC_Payment_Gateway_Form in favor of having a Payment_Gateway_CC and Payment_Gateway_eCheck
* Fix up some comments to match other comments in the WC code base
* Add some missing esc_* functions
* Add a gateway filter to get_customer_tokens + a test for it
2016-03-01 11:49:42 -08:00
Justin Shreve e6a527547f Add the ability for gateways to override the "new payment method" label. 2016-03-01 11:49:42 -08:00
Justin Shreve eff4e297f9 First pass at showing saved payment methods on checkout 2016-03-01 11:49:40 -08:00
Justin Shreve 5d8967c7d7 Prepare a list of payment methods for output on the payment methods "my account" page. 2016-03-01 11:49:40 -08:00
Justin Shreve 0061b36f3b Make sure WP knows about the payment token meta table, and return null in payment tokens get if a token cannot be found. 2016-03-01 11:49:39 -08:00
Justin Shreve df260c228d Prevent notice from being displayed for user_id and remove static on echeck validate 2016-03-01 11:49:39 -08:00
Justin Shreve 7b57b4c4cc Validate length for expiry - 4 chars for year and 2 for month. 2016-03-01 11:49:39 -08:00
Justin Shreve 214f077a91 Implement the rest of the WC_Data methods for creating, updating, reading, etc. 2016-03-01 11:49:39 -08:00
Justin Shreve c87c99f847 Start implementing the WC_Data interface. Move update, create, save, etc to the actual token class, and have the controller return our tokens. This matches the shipping zone API closer. 2016-03-01 11:49:39 -08:00
Justin Shreve f66b9e3681 Move meta (when creating) to its own sub meta array. 2016-03-01 11:49:39 -08:00
Justin Shreve f66a8b6478 Rename customer_id to user_id to match how orders reference the user. 2016-03-01 11:49:39 -08:00
Justin Shreve bfa9437a43 Rename the meta name _payment_tokens to remove the wc_ prefix, since this meta is a part of WC orders already. 2016-03-01 11:49:38 -08:00
Justin Shreve 6112752836 Misc cleanup based on PR feedback:
* Remove $token_id parameter from WC_Order's add_payment_token. get_id() can be used to access the ID
* Rename our list of token ids from meta to $token_ids as it makes more sense
* Cleaned up/fixed some of the comments in WC_Payment_Token
* Some code formatting fixes
2016-03-01 11:49:38 -08:00
Justin Shreve 204922e2ae Add methods for managing payment tokens associated with an order. 2016-03-01 11:49:37 -08:00
Justin Shreve c5aec06a8a First pass at a payment token API 2016-03-01 11:49:37 -08:00
Mike Jolley fa2280f3f8 Add notice on fail 2016-02-29 12:33:09 +00:00
Mike Jolley 09ef555e5a [2.5] Combine update post calls 2016-02-29 12:24:02 +00:00
Claudio Sanches 53db5ff4c8 Created coupons POST and PUT endpoints and coupons schema 2016-02-26 17:24:33 -03:00
Mike Jolley d7d609d85a Remove comment 2016-02-25 14:13:56 +00:00
Claudio Sanches f10846277b Added method to delete coupons 2016-02-23 15:28:43 -03:00
Claudio Sanches 0d88e3c380 Added endpoint to get coupons 2016-02-23 12:16:21 -03:00
Claudio Sanches a31ef08ed7 Improved permissions check 2016-02-22 17:48:38 -03:00
Claudio Sanches 43a5f6f842 Created abstract classes for posts and terms 2016-02-22 16:43:52 -03:00
Mike Jolley dbd6479f45 Comment on get_related limit
Closes #10398
2016-02-22 13:27:39 +00:00
Mike Jolley e9703da300 Merge pull request #9921 from peterrath/vat-exempt-and-tax-enabled-handling
VAT exempt and “TAX enabled” handling in back end and Orders API
2016-02-19 14:53:39 +00:00
Peter de1ecf9f78 Use === instead of == in abstract-wc-order.php
Use === here: 	if ( 'yes' === $this->is_vat_exempt or ! wc_tax_enabled() )
2016-02-18 19:56:55 +01:00
Claudio Sanches e926c54d29 Created WC_REST_Controller and structure to load WooCommerce controllers 2016-02-16 18:59:18 -02:00
Mike Jolley 3dba3378c2 Merge pull request #10315 from woothemes/layered-nav-wp-query
Layered Nav Improvements
2016-02-12 11:59:40 +00:00
Diego Zanella 6e4376511d Fixed incompatibility with PHP 5.4 and earlier 2016-02-10 19:47:16 +00:00
Mike Jolley fab8a871aa Merge branch 'master' into shipping-zones
# Conflicts:
#	assets/css/admin.css
#	includes/admin/class-wc-admin-assets.php
2016-02-10 14:12:39 +00:00
Mike Jolley 75c264837f Justins feedback/code tidy 2016-02-10 13:21:16 +00:00
Mike Jolley 1d5349bc83 Keep rating meta synced for filtering 2016-02-09 20:53:18 +00:00
Mike Jolley 75cbb74520 Rating widget standards 2016-02-09 15:18:27 +00:00
Mike Jolley 5525fadc09 Pass values to validation functions.
Closes #10032
2016-02-08 12:06:23 +00:00
Mike Jolley 352184cc06 Merge branch 'master' into shipping-zones
# Conflicts:
#	assets/css/admin.css
#	i18n/languages/woocommerce.pot
#	includes/abstracts/abstract-wc-payment-gateway.php
#	includes/abstracts/abstract-wc-shipping-method.php
#	includes/admin/settings/class-wc-settings-shipping.php
#	includes/wc-core-functions.php
#	uninstall.php
2016-02-05 14:58:48 +00:00
Mike Jolley 384c07b367 Merge pull request #10262 from Spreeuw/issue-10252
default order to processing for non-catalog products
2016-02-05 12:21:43 +00:00
Mike Jolley 787d36dee4 Merge pull request #10232 from marcusds/master
Add filter to is_in_stock
2016-02-05 12:01:10 +00:00
Ewout Fernhout a3634028fa default order to processing for non-catalog products
fixes #10252
2016-02-03 14:48:19 +01:00
Agbonghama Collins a742861cda minor typo
Found this error while trying to understand how gateways are built on WooCommerce
2016-02-02 15:35:01 +01:00
Mike Jolley 64d4bb5172 [2.5] Round shipping after tax calc
#10076 and
https://wordpress.org/support/topic/when-calculating-shipping-total-forc
e-rounding?replies=6#post-7972623
2016-02-02 11:09:02 +00:00
Marcus 780614b14e Add filter to is_in_stock 2016-02-01 11:09:12 -08:00
Mike Jolley 657521ffa4 [2.5] Don't show purchase note to admin 2016-01-27 15:30:07 +00:00
Mike Jolley f8df682f34 Hide stock amount when children are involved
Closes #10172
2016-01-27 13:00:50 +00:00
Mike Jolley 9ca216310d [2.5] When totalling up shipping, force round
Closes #10076
2016-01-27 11:06:08 +00:00
Claudio Sanches 2790307489 Changed allbuttons to select_buttons for multiselect #10079 2016-01-21 19:33:49 -02:00
Claudio Sanches f4fddf2252 Merge pull request #10079 from woothemes/add/select-all-buttons-multiselect-field
Settings API: add optional "select all"/"select none" buttons to multiselect fields
2016-01-21 19:30:12 -02:00
Mike Jolley 4cfd8ff214 [2.5] Don't show downloads in admin email 2016-01-20 16:58:58 +00:00
Florian Ludwig ddd5f9fb9b Fixed attribute check for PHP 7 compatibility 2016-01-20 15:53:51 +01:00
Brett a772457a32 remove unnecessary use of ternary operator 2016-01-20 12:30:56 +13:00
Joey Kudish 7bb99af123 Settings API: enhance multiselect fileds
Add optional "select all"/"select none" buttons to multiselect fields,
similarly to what already exists for the country field.
2016-01-14 22:07:31 -08:00
Mike Jolley a322b05f24 Avoid confusion between fields and field keys 2016-01-11 12:04:37 +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
Mike Jolley a33b9b9750 Unit tests for shipping zones 2016-01-08 13:56:01 +00:00
Mike Jolley 007abbc98e Shipping meta data
Closes #9094
2016-01-08 11:42:32 +00:00
Peter c5e3e018c3 is_vat_exempt and wc_tax_enabled handling in abstract-wc-order
If is_vat_exempt is 'yes', or wc_tax_enabled is false, then do not calculate tax.
2016-01-05 21:36:06 +01:00
Mike Jolley 7ece70a6ae Update _transaction_id
Closes #9970
2016-01-05 15:59:57 +00:00
Mike Jolley 97d47fb576 Move zones to main settings 2016-01-05 11:23:15 +00:00
Claudio Sanches 40d76ddc55 Merge pull request #9939 from frozzare/docs/abstract-wc-widget
Improve phpdoc comments for methods in abstract WC_Widget class
2016-01-04 12:59:32 -02:00
Fredrik Forsmo 513db93bd4 Improve phpdoc comments for methods in abstract WC_Widget class 2016-01-04 15:37:12 +01:00
Mike Jolley 62ca37f651 Merge branch 'master' into shipping-zones
# Conflicts:
#	includes/admin/class-wc-admin-assets.php
#	includes/class-wc-install.php
2016-01-04 14:35:45 +00:00
Fredrik Forsmo 39f37b1e30 Improve phpdoc comments for methods in abstract WC_Shipping_Method class 2016-01-04 15:18:14 +01:00
Fredrik Forsmo 450ae6e7fd Improve phpdoc comments and add missing param tags 2016-01-04 12:43:56 +01:00
Mike Jolley 520f1de24b Merge pull request #9932 from frozzare/wc-order-phpdoc
Fix phpdoc tags for methods in abstract WC_Order class
2016-01-04 11:08:45 +00:00
Fredrik Forsmo 9c8ef67249 Add better phpdoc comments and missing param and return value 2016-01-03 10:22:53 +01:00
Fredrik Forsmo b4a04a73ce Fix phpdoc tags for methods in abstract WC_Order class 2016-01-03 10:00:02 +01:00
Mike Jolley 4bf40cedb1 Tweak logic 2015-12-23 12:50:28 +00:00
Peter 458c755b5f Update abstract-wc-order.php
If the order has no shipping line, there must not generate an unnecessary shipping tax line with 0 value. It was happened if there is set a different tax class for shipping than tax classes of the actual product line items of the order, and the order has not got any shipping line.
The aim is to have the same tax calculation behavior if we create orders using the GUI (front end or back end), and the API.

This condition prevents to create the unnecessary tax line if there is no shipping methods of the order:

// Now calculate shipping tax
$matched_tax_rates = array();
$shipping_methods = $this->get_shipping_methods();
if ( ! empty( $shipping_methods ) ) {
	......
}


This conditional solution is similar than calc_line_taxes() in WC_AJAX class:

// Get shipping taxes
if ( isset( $items['shipping_method_id'] ) ) {
	.....
}
2015-12-21 23:42:59 +01:00
Mike Jolley 901db7b0f8 zone tweaks 2015-12-18 17:10:58 +00:00
Mike Jolley 119f19a5c1 Include and conditionally load legacy shipping methods 2015-12-18 14:24:34 +00:00
Mike Jolley 77f0e9d72a has settings handling 2015-12-18 13:12:20 +00:00
Mike Jolley bf06b6d7c3 Filter non-images from gallery
Fixes #9875
2015-12-18 11:55:51 +00:00
Mike Jolley 1a77563085 started on free shipping 2015-12-16 13:52:46 +00:00
Mike Jolley e25d876779 List and sort methods within zones 2015-12-15 17:48:03 +00:00
Mike Jolley b47423ff2b Moved rate calc logic into shipping class 2015-12-15 16:22:32 +00:00
Mike Jolley a0e0bb1e55 Load instance methods for calculations 2015-12-15 15:00:45 +00:00
Mike Jolley 091a8a7641 Zone matching functions 2015-12-15 12:39:52 +00:00
Mike Jolley 3b81642eec Instance and global level settings 2015-12-14 16:56:39 +00:00
Mike Jolley 2f97b16a91 Fix notice 2015-12-14 14:05:00 +00:00
Mike Jolley b27aed5753 Settings api 2015-12-14 14:03:46 +00:00
Mike Jolley f992f98b39 Merge branch 'pr/9790' 2015-12-14 12:48:11 +00:00
Mike Jolley 4b45812bac Only one sanitise hook is needed 2015-12-14 12:48:03 +00:00
Mike Jolley f3d6ce3c94 Round total discount to precision
Fixes #9834
2015-12-14 12:06:39 +00:00
Mike Jolley 63f8eebd6a Started on refactoring settings for instances 2015-12-11 16:41:38 +00:00
Mike Jolley 6cea054fca Method list screen and method screen with breadcrumbs 2015-12-11 14:11:12 +00:00
Shiva Poudel afd3aa2fc7 Let the additional third party widgets create and sanitize form fields 2015-12-08 16:19:49 +05:45
Claudio Sanches ff637abb7b Removed duplicated argument for PHP 7, closes #9788 2015-12-07 17:36:18 -02:00
Mike Jolley dd2fe6ff49 Make WC_Abstract_Order::update_status() return boolean
closes #9777
2015-12-07 10:12:17 +00:00
Shiva Poudel 88d7713a86 Modified checkbox class value from widefat 2015-12-05 05:26:28 +05:45
Shiva Poudel 69d6a25f5e Refactor to format the value based on widget settings type 2015-12-05 05:25:51 +05:45
Claudio Sanches d15c711855 Merge branch 'master' of github.com:woothemes/woocommerce 2015-12-04 21:17:47 -02:00
Max Rice 3befe1426f Introduce WC_Product::get_id() method 2015-12-04 15:17:25 -05:00
Claudio Sanches 92582e21cb Properly sanitize textarea field for widgets #9762 2015-12-04 17:14:42 -02:00
Shiva Poudel b3cd28e323 Added textarea widget form field 2015-12-04 21:23:19 +05:45
Mike Jolley 1c364e79e4 Enforce min and max
Closes #9761
2015-12-04 14:53:25 +00:00
Patrick Garman eb3dc97df9 Add filter to WC_Product::is_virtual() 2015-12-03 20:52:27 -05:00
Claudio Sanches 112f3bfc32 Merge pull request #9723 from shivapoudel/widget-field-class
Added support for class in each widget fields
2015-12-02 13:40:41 -02:00
Mike Jolley 350078b779 Merge branch 'pr/9708' 2015-12-02 12:42:09 +00:00
Mike Jolley 869dee2726 No need for rating HTML as we have no styling 2015-12-02 11:50:41 +00:00
Mike Jolley 328a84d278 Floatval to get rid of stray decimals 2015-12-02 11:46:51 +00:00
Shiva Poudel 2881587c44 Don't use key as default class 2015-12-02 15:47:57 +05:45
Mike Jolley 2e553cf220 Show order refunds in totals
Fixes #9589 @claudiosmweb
2015-11-30 15:25:48 +00:00
Mike Jolley b5a2c2a9d5 Unify all order email tables to use a single template
Closes #9587

@claudiosmweb @jameskoster
2015-11-30 15:16:23 +00:00
Shiva Poudel 532c1f9474 Added support for class in each widget fields 2015-11-30 12:11:29 +05:45
Claudio Sanches 753014da5a Merge pull request #9631 from woothemes/transient-tweaks
Transient tweaks
2015-11-21 22:48:14 -02:00
Illimar Tambek d91dfb6fe6 Introduce woocommerce_recorded_sales action hook 2015-11-19 18:07:04 +02:00
Claudio Sanches d931405156 Fixed the type returned when get_stock_quantity() is empty
Since expect return an integer value, we can't return an empty string.
This can generate some kinds of errors like:

 '' >= 1 returns false
 '' >= -1 returns true

This can be a problem comparing stock quantity like we do in
WC_Product::has_enough_stock()

But using null we have:

 null >= 1 returns false
 null >= -1 returns false

cc @mikejolley

ref #9598
2015-11-14 15:53:36 -02:00
Mike Jolley b59ec6de76 Move var definition to abstract 2015-11-14 16:39:53 +00:00
Mike Jolley 3a096b3b64 Remove transient from get_total_stock and combine into abstract
Grouped and variable methods were identical. Caching benefit comes from
get_children
2015-11-14 16:34:47 +00:00
Mike Jolley 851fc2a442 Use get_cache_prefix in orders class 2015-11-13 23:11:05 +00:00
Mike Jolley 3082c5bba6 wc_related_ and get_related method tweaks
Remove use of multiple expiring transients. See function docblock for
explanation.
2015-11-13 21:14:42 +00:00
Mike Jolley 3ceed757bd Store rating and reviews in postmeta rather than transients
These don’t change often, and as long as we listen for comment count
update events will be kept in sync.
2015-11-13 20:41:20 +00:00
Shiva Poudel d31859ab6c Remove unused variable declaration 2015-11-10 16:53:45 +05:45
Mike Jolley 4e5baf23aa Cache get_item_meta_array for better performance
Closes #8810 @claudiosmweb
2015-11-05 15:21:28 +00:00
Shiva Poudel d9e8057df3 Tweak the dockblocks and periodic-ending fix 2015-11-04 00:05:08 +05:45
Claudio Sanches 5893875b0c Removed period for file headers 2015-11-03 11:53:50 -02:00
Claudio Sanches efa19f799d Fixed some coding standards for docblocks 2015-11-03 10:28:01 -02:00
Mike Jolley aec0e0e327 supports() method which mirrors gateways
Closes #9471
2015-11-02 11:23:50 +00:00
Kathy Darling 856d192bff Use generic `ajax_add_to_cart` class for adding items in the loop to the cart via ajax. 2015-10-30 12:54:49 -05:00
Mike Jolley 5b6e16682c Handle partial/full refund for orders containing free items
Also adds helper method to determine if such as free item exists or
not. Closes #9460
2015-10-29 15:34:33 +00:00
Ari-Pekka Koponen 11ab216993 WC_Product __get should check for False instead of empty 2015-10-28 12:45:54 +02:00
Claudio Sanches b85ae9056c Rename wc_add_help_tip() function to wc_help_tip() 2015-10-23 13:09:08 -02:00
Claudio Sanches 2e95a68357 Use new "question" mark icon font
Created wc_add_help_tip() function to generate the icons
Replaced all .help_tip elements and [?]

We'll keep the old image and styles in order to maintain backwards
compatibility

Closes #9381
2015-10-23 01:40:52 -02:00
Mike Jolley 4dbfe1551c Settings API - don't save title fields
Closes #9401
2015-10-22 11:27:39 +01:00
Mike Jolley dda0f0c2bd Check for existence of global attribute when you get_attributes() for a product
Fixes #9141
2015-10-08 13:55:01 +01:00
Mike Jolley 1ec3cb0ef6 [2.4] Default value should not apply if value of option is 0
Fixes #9270 @claudiosmweb
2015-10-05 15:07:46 +01:00
Mike Jolley 42d90594af Fix password with & saving
@claudiosmweb
2015-10-05 14:09:11 +01:00
Mike Jolley d4fbe0e45c Use SKU for stock order notes
Fixes #9133
2015-10-01 18:13:37 +02:00
Claudio Sanches 1522a4d87b Added download-url class in WC_Abstract_Order::display_item_downloads(), closes #9158 2015-09-21 18:28:03 -03:00
Mike Jolley 0c56fe0844 Merge pull request #9149 from JeroenSormani/stock-changes
Add get_stock_quantity filter
2015-09-17 10:57:47 +01:00
JeroenSormani cb75a1e8af Add get_stock_quantity filter 2015-09-17 10:19:04 +02:00
Mike Jolley 83838358fe Revert "Merge pull request #8768 from SiR-DanieL/session-delete"
This reverts commit f63c500848, reversing
changes made to 2a31d1fe98.
2015-09-16 13:38:28 +01:00
Mike Jolley f63c500848 Merge pull request #8768 from SiR-DanieL/session-delete
Instroducing WC_Session::delete
2015-09-16 10:34:51 +01:00
Nicola Mustone 7d6bf488c9 using unset also in the magic method 2015-09-16 11:34:22 +02:00
Nicola Mustone 6bc17c65c8 delete to unset 2015-09-16 11:34:03 +02:00
Claudio Sanches f7d035e739 Merge pull request #9084 from rchq/patch-1
Added an action for notifications
2015-09-15 19:59:16 -03:00
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
Andrew Benbow fa8aeb605c Update abstract-wc-order.php 2015-01-12 12:34:53 +00:00
James Koster 9cf1a8e7e8 is_sold_individually() tweak. closes #7041 2015-01-07 10:03:49 +00:00
Claudio Sanches d1f9cbfcf2 Merge pull request #6954 from SiR-DanieL/patch-2
Introduced woocommerce_get_product_attributes filter
2015-01-05 13:39:25 -02:00
Mike Jolley cab9e14fcd Use number format instead of round in get_item_subtotal()
Closes #6913
2015-01-05 11:42:10 +00:00
Mike Jolley f847b92a0f Merge branch 'wc-geolocation' 2015-01-05 10:18:25 +00:00
Claudio Sanches b4cc3cfcd5 Improved the widget title 2015-01-02 11:05:06 -02:00
Mike Jolley 7ef8f4d156 Invalidate unknown product transients Closes #6815 2014-12-30 15:27:08 +00:00
Mike Jolley 6800ee0ec3 Base vs default 2014-12-23 17:34:05 +00:00
Nicola Mustone d6bf1e81f9 added variation ID in order stock notes 2014-12-23 12:01:11 +01:00
Bryce 1c31af94f5 remove var keyword in WC_Shipping_Method 2014-12-16 18:38:58 +07:00
Nicola Mustone 7cec3c9f0b introduced woocommerce_get_product_attributes filter 2014-12-15 14:40:23 +01:00
Mike Jolley 100b95ae4f Tweak the get magic method in product class 2014-12-11 14:54:56 +00:00
Claudio Sanches a579ce4578 Merge pull request #6894 from franticpsyx/add_shop_prices_in_variation_data_array
Add display_prices in available_variations array
2014-12-10 15:52:57 -02:00
Mike Jolley fd15ac4c64 Allow a cancelled order to be marked paid, if there is a payment delay
Closes #6810
2014-12-10 16:54:08 +00:00
Claudio Sanches ec30dab6c4 Improved the colorpicker field 2014-12-09 10:10:59 -02:00
Claudio Sanches 5ea4e1b0a7 Created new colorpicker settings api field 2014-12-09 10:07:29 -02:00
Mike Jolley eba8206540 Merge branch 'tax-coupon-handling' Closes #6830
Conflicts:
	assets/js/admin/meta-boxes-order.min.js
	includes/api/class-wc-api-coupons.php
	includes/class-wc-cart.php
	templates/checkout/review-order.php
2014-12-03 12:33:15 +00:00
Manos Psychogyiopoulos 4b04701cc8 add display_prices in variation data
The commit introduces 3 changes:
1. It adds 2 extra fields to the available_variations array,
display_price and display_regular_price, to be used by extensions in
cases like
https://github.com/woothemes/woocommerce-product-addons/issues/19
2. Introduces a get_display_price() function in WC_Product to retrieve
product prices incl or excl tax relative to the
woocommerce_tax_display_shop setting.
3. Fixes a minor issue where passing a 0 price to
get_price_including_tax() or get_price_excluding_tax() results in a
wrong output.
2014-12-03 11:28:04 +02:00
claudiosmweb 676549b4ab Fixed docblock for WC_Product::get_categories() 2014-12-01 22:09:42 -02:00
Bryce 83a457b29c improve get_rating_count() for rating-less reviews
Should close #6839.

According to `woocommerce_enable_review_rating` &
`woocommerce_review_rating_required`, it will do a different DB query,
so that when reviews without ratings are allowed, it will do a query
that counts those comments as reviews.
2014-11-27 14:32:09 +07:00
Mike Jolley 3c82331a8b Store discount 'tax' to show discounts on prices including tax more accuratly
Also deprecated some functions named after having 2 levels of discounts.
2014-11-25 13:05:03 +00:00
Mike Jolley 4a8c541fbf Remove 'order' discounts from classes 2014-11-25 11:05:14 +00:00
Barry Kooij 47cc448028 Added correct docblock. 2014-11-21 22:34:30 +01:00
Barry Kooij 4b539e7a9a Merge branch 'master' of github.com:woothemes/woocommerce 2014-11-21 22:31:17 +01:00
Barry Kooij 6ebadd572a Added correct docblock. 2014-11-21 22:31:09 +01:00
Michael Tieso 70d5fc834a Spelling correction - calculdate to calculate 2014-11-21 13:26:32 -08:00
Barry Kooij f8a161c406 Documentation improvement. 2014-11-21 22:16:15 +01:00
Barry Kooij ae1ed2b7f6 Added missing param docblock. 2014-11-21 22:14:13 +01:00
Barry Kooij b131f250b6 Added missing docblock return statement. 2014-11-21 22:12:37 +01:00
Barry Kooij 64227fe9d8 Added missing docblock 2014-11-21 22:12:03 +01:00
Barry Kooij 33b53c30b5 Updated docblock and added return statement. 2014-11-21 22:09:46 +01:00
Gerhard fa42c9d397 Change remove_order_items subqueries to inner joins.
Closes #6804
Hat tip Jason @ WPEngine
2014-11-21 09:18:31 +02:00
claudiosmweb b4e544e5dc Fixed coding styles and docblocks 2014-11-20 00:14:06 -02:00
claudiosmweb 6d4650dd7b Declared all Settings API variables 2014-11-19 23:11:08 -02:00
claudiosmweb 74ba11c189 Removed some unused code 2014-11-19 21:36:47 -02:00
claudiosmweb d4c480a6ea Fixed process_refund() docblock 2014-11-19 21:14:28 -02:00
claudiosmweb e87aefc8e0 Fixed missing initial $query = array() 2014-11-19 16:26:10 -02:00
claudiosmweb f34cead914 Removed old code in favor of wc_tax_enabled() and wc_prices_include_tax() 2014-11-18 14:45:29 -02:00
Mike Jolley e476a3f76b Merge pull request #6785 from SiR-DanieL/make_clickable
Automatically creates clickable links in item metas
2014-11-18 16:21:29 +00:00
claudiosmweb da43955416 Introduces the wc_get_default_location() function 2014-11-18 12:56:13 -02:00
Nicola Mustone 913cc42c06 Fixes https://github.com/woothemes/woocommerce-product-addons/issues/24 2014-11-18 14:22:21 +01:00
claudiosmweb 6077a10e44 Removed some dead variables 2014-11-18 10:42:54 -02:00
Mike Jolley e6a5825f8c Some shipping class tidyup 2014-11-17 16:30:18 +00:00
Mike Jolley 65ace6818b Merge pull request #6757 from tamarazuk/master
Introduce `woocommerce_product_is_on_sale` filter
2014-11-17 14:11:59 +00:00
claudiosmweb 24e17e36d3 Preventing errors when adding a widget using the WP Customize
Fixed coding standards and used methods from WC_Widget for start and end the widget
2014-11-14 23:12:59 -02:00
Tamara Zuk 20655d367d Introduce `woocommerce_product_is_on_sale` filter
This filter is useful for extensions like Measurement Price Calculator
which alter the product price quite a bit, but would still like the
sale badge to appear :)

Current workaround is to use three filters ( `woocommerce_get_price`,
`woocommerce_get_regular_price`, and `woocommerce_get_sale_price` )
which most extension may be using already, but not all need/want to
alter these prices.
2014-11-14 18:00:03 -05:00
Mike Jolley 2e2ce3c286 [2.2] During refunds, correctly set shipping tax totals
Fixes #6691
2014-11-14 12:52:43 +00:00
Marin Atanasov 7c5be1ebde fixing small typo 2014-11-11 22:32:06 +02:00
Mike Jolley cb8fe34b4c get_base_tax_rates() + filter. Closes #6668 2014-11-11 11:56:17 +00:00
Mike Jolley 69ca69ce52 Split up the product widget methods 2014-10-29 11:07:06 +00:00
Mike Jolley 2b8be95360 Remove # (hash) from get_order_number and add to strings instead as needed.
Most places use Order #X
Some places use Order Number: X

Both are now valid.

Fixes #6518
2014-10-24 14:53:43 +01:00
Mike Jolley e4b212cb3a [2.2] Fix stock report queries Closes #6565 2014-10-21 14:50:18 +01:00
Mike Jolley 1922b377e8 Corrected comment 2014-10-20 16:10:39 +01:00
Mike Jolley 8766cfa6df Tweak woocommerce_get_price_html_from_to in #6455 2014-10-17 16:25:54 +01:00
Mike Jolley 2668f0b8dd Merge pull request #6455 from paulwilde/from-to-filters
Introduce filters to get_price_html_from_text() and get_price_html_from_to()
2014-10-17 16:25:16 +01:00
Tamara Zuk f34187d5d3 Allow for non-integer stock quantities
It looks like a3b522aff8 removed this
ability.
This would be very useful for extensions like Measurement Price
Calculator.
2014-10-17 00:52:56 -04:00
Mike Jolley e03cf9c204 Set order_type property, and move actual order loading to separate method to make it easier for sub-classes to handle just that process.
Closes #6513
2014-10-14 14:25:53 +01:00
Mike Jolley 30edd0aa05 [2.2] Prevent notice if meta is not set Closes #6514 2014-10-14 11:26:14 +01:00
claudiosmweb 61e96b0a8b Prevent warnings in WC_Shipping_Method::is_available() when exclude countries 2014-10-10 23:01:19 -03:00
claudiosmweb 86ef09970a Prevented warnings when countries is empty in shipping methods.
Stopped this erros:

PHP Warning:  array_intersect(): Argument #1 is not an array in
wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-shipping-method.php
on line 182
PHP Warning:  in_array() expects parameter 2 to be array, null given in
wp-content/plugins/woocommerce/includes/abstracts/abstract-wc-shipping-method.php
on line 194

@mikejolley
2014-10-10 22:46:19 -03:00
Mike Jolley e9393ddaf7 Settings API should use h3 rather than h4 when outputting titles 2014-10-08 15:06:38 +01:00
Mike Jolley 80716fbd46 Corrected get_return_url docblock 2014-10-07 11:09:38 +01:00
Mike Jolley 742594e207 Tweaks to order class 2014-10-07 11:09:29 +01:00
Mike Jolley 700369c386 Refund report changes
1. Ensure refund order_total is negative and reflects the full amount,
not just line items
2. Ensure transients are cleared when doing refunds
3. sales-reports order types so we can exclude refunds from pure
‘sales’ reporting
4. Tweak placement of refunds in legend.

Closes #6411
2014-10-06 13:39:53 +01:00
Paul Wilde 279c01d005 Introduce filters to get_price_html_from_text() and get_price_html_from_to(). 2014-10-02 20:11:34 +01:00
Mike Jolley e5ebeff99c Merge pull request #6383 from BFTrick/iss-6358
Refactoring Email Classes to Use One Send Method
2014-10-02 14:00:18 +01:00
mgiulio 56c2e5838d Fix get_cart_tax() comment 2014-09-29 17:11:34 +02:00
Patrick Rauland 1498198215 renaming and moving abstract-wc-email file 2014-09-23 10:12:43 -06:00
shivapoudel 303a5b28d0 Absolute path fix for abstract classes :) 2014-09-21 00:24:49 +05:45
Mike Jolley 493285f101 When updating order status, ensure its a valid WC order status.
Fixes #6285
2014-09-17 12:24:10 +01:00
Illimar Tambek fb19f5b9c5 Improve naming & comments 2014-09-17 11:27:43 +03:00
Illimar Tambek 386011ffae Allow getting rating count for a specific rating number 2014-09-17 11:03:10 +03:00
Mike Jolley ce1236bd95 Merge branch 'master' of https://github.com/woothemes/woocommerce
Conflicts:
	readme.txt
2014-09-16 10:48:46 +01:00
Mike Jolley a3b522aff8 Prepare update queries. 2014-09-16 10:45:28 +01:00
Barry Kooij 9723ed8096 Added settings sub title styling 2014-09-15 17:47:01 +02:00
Barry Kooij a93b107e55 removed unused default 2014-09-15 17:30:15 +02:00
claudiosmweb 066eb3c5b0 fixed wc_get_order_status_name() appear as wc 2.1 order status 2014-09-12 10:01:49 -03:00
claudiosmweb 591d3dc3be added methods to dynamically get the address fields in WC_Checkout::create_order(), closes #6226 2014-09-11 17:12:17 -03:00
Mike Jolley 7ae41bb4ed Fix - Ensure shipping address gets displayed - fixes needs_shipping_address() method. 2014-09-11 11:11:22 +01:00
Mike Jolley 3a4ba6e4c8 For regular products, ensure stock level saves on product creation. 2014-09-10 23:55:40 +01:00
Max Rice 55d3ba0d9d Fix warnings with WC_Order::get_item_total()
When calling WC_Order::get_item_total() for a fee, $item[‘qty’] is not
set which causes a notice and warning.
2014-09-09 21:23:46 -04:00
claudiosmweb 2f1533ff94 created the wc_get_order_status_label() function 2014-09-09 14:14:10 -03:00
claudiosmweb c85a71dcee fixed the order status label 2014-09-09 14:00:37 -03:00
Mike Jolley 27a20dd80e Docblock changes 2014-09-08 16:35:40 +01:00
Mike Jolley c4ef86d44e scrutinizer patches 2014-09-08 00:37:55 +01:00
Mike Jolley 1d13f767b3 Merge pull request #6157 from tamarazuk/coding-standards
Coding standards Part 1
2014-09-03 17:05:42 +01:00
Mike Jolley 349c85b639 Remove redundant wc_order_can_be_edited filter
#6154
2014-09-03 10:09:31 +01:00
Mike Jolley cb76bd7fb8 Merge pull request #6154 from thenbrent/is_editable
Add `WC_Abstract_Order::is_editable()` method and `'wc_order_is_editable'` filter
2014-09-03 10:06:04 +01:00
claudiosmweb 78c7fefe3e fixed some docblocks 2014-09-02 16:50:19 -03:00
thenbrent 3acfb14214 Store order's editable status in property
To save overhead of a function call
2014-09-02 12:27:26 -07:00
thenbrent 4dea71314f Add 'wc_order_is_editable' filter 2014-09-02 11:49:05 -07:00
thenbrent 78d932e6d2 Add WC_Abstract_Order::is_editable()
To centralise logic used to determine if an order can be edited from
the Edit Order screen
2014-09-02 11:47:56 -07:00
Tamara Zuk 9c7826319c Coding Standards: Abstract classes
* fixed indentation - swapped spaces for tabs at start of line, swapped
tabs for spaces min-line for alignment
* removed instances of `@return void` and `@access public`
* improved readability

@see http://make.wordpress.org/core/handbook/coding-standards/php/
2014-08-31 01:49:58 -04:00
justinstern 8417209d6c Improve, fix, WC_Payment_Gateway::get_transaction_url()
* Make the new get_transaction_url() method a bit more
flexible/convenient by passing in the full order object rather than
transaction_id
* Fix bug with core PayPal gateway get_transaction_url() override
2014-08-27 21:51:03 -04:00
Barry Kooij 94365791af Changed all use of get_product to wc_get_product 2014-08-19 12:09:29 +02:00
Mikel Martin 1ed0a9e9db Payment unavailable if max_amount greater than 0 and order totar greater than max_amount 2014-08-17 22:10:35 +02:00
Mike Jolley c51fac23e0 Availability with backorders not requiring notification. 2014-08-15 15:29:14 +01:00
Barry Kooij 6655188f0b Changed use of get_order with wc_get_order 2014-08-15 14:29:21 +02:00
Mike Jolley da483198f8 Simplify icons 2014-08-15 11:50:53 +01:00
Mike Jolley 3f53512c7f Fix up visibility of stock options, drop downs, and get_availability() when parent is managing stock for a variation.
Fixes #6017
2014-08-13 15:03:30 +01:00
claudiosmweb acb0699e94 updated the reason default value 2014-08-11 10:07:09 -03:00
claudiosmweb 066ba904cb added $reason param in WC_Payment_Gateway::process_refund() 2014-08-07 15:57:29 -03:00
Mike Jolley 760cd6861c Small refactor of is_visible
Also returns false for non-published products and fixes #5955
2014-08-04 11:19:58 +01:00
Mike Jolley 368e6b9412 Round shipping quote totals to store DP setting
Fixes #5888
2014-07-30 11:04:01 +01:00
claudiosmweb 70541f85e7 fixed the woocommerce_order_item_needs_processing filter 2014-07-29 15:08:08 -03:00
Mike Jolley c465c7235d Merge branch 'credit-notes'
Conflicts:
	includes/abstracts/abstract-wc-order.php
	includes/class-wc-order-factory.php
	includes/class-wc-post-types.php
	includes/wc-formatting-functions.php
	includes/wc-order-functions.php
2014-07-29 12:09:52 +01:00
Mike Jolley cdc0efed75 Merge pull request #5843 from maxrice/feature-orders-endpoint-issue-4160
Create/Edit/Delete orders via the REST API
2014-07-28 09:18:49 +01:00
Max Rice f656d57282 Add WC_Order::get_order_subtotal()
Convenience method to return the order subtotal

Part of #4160
2014-07-27 23:31:26 -04:00
Max Rice 3cc9952fea Include order item ID and rate ID in WC_Order::get_tax_totals()
Part of #4160
2014-07-27 23:31:02 -04:00
Max Rice f4feefc100 Fix WC_Order::get_user() 2014-07-27 23:30:21 -04:00
Max Rice e47ac33eb1 Add calculate_shipping() method to WC_Abstract_order
When the update_shipping() method is used, the order shipping amount is
not properly calculated unless the shipping costs are summed.

Part of #4160
2014-07-27 23:29:40 -04:00
Max Rice 1598d1b539 Add update methods to WC_Abstract_Order
These methods compliment the existing add_*() methods and provide a
consistent interface to add and update items for the order.

Part of #4160
2014-07-27 23:28:25 -04:00
Max Rice cca54879fa Fix misc docblocks 2014-07-27 23:23:59 -04:00
Mike Jolley 029bbbec39 Updated reports 2014-07-25 15:46:19 +01:00
Mike Jolley 19b6922044 Refund line items and taxes 2014-07-24 15:34:14 +01:00
claudiosmweb 5152457d9d improved the saving the new tax data 2014-07-20 01:28:16 -03:00
claudiosmweb 3a28c56876 save and display shipping taxes in order items meta box 2014-07-20 00:32:52 -03:00
claudiosmweb 93cf3c88bd initial implementation of order items taxes 2014-07-19 01:08:02 -03:00
claudiosmweb 50113fa531 fixed "Invalid argument supplied for foreach()" warning in line 127 2014-07-19 00:16:34 -03:00
Patrick Rauland e735fe45e0 fixing typos in abstract settings class 2014-07-15 16:41:28 -06:00
Mike Jolley 664dad3766 Process_refund()
#3164
2014-07-07 11:43:27 +01:00
Mike Jolley 979f2c0b48 Get transaction ID method 2014-07-07 11:43:06 +01:00
EmilEriksen 2f3793e49b pass to get_subtotal_to_display(). Fixes #5790 2014-07-04 20:29:17 +02:00
Coen Jacobs 86a4add087 Merge remote-tracking branch 'upstream/master' into order-factory-refactor
Conflicts:
	includes/class-wc-order.php
2014-07-03 13:38:55 +02:00
Mike Jolley 5e1bc4aeb1 Tweak get_availability 2014-06-27 14:46:39 +01:00
Mike Jolley c2475c2073 Merge pull request #5745 from claudiosmweb/4164-feature-products-api
Products API - PUT/POST/DELETE
2014-06-27 13:14:20 +01:00
Mike Jolley cc1d1e2237 Included method to define a link format for a transaction ID, set transaction ID manually, and tweaked display. 2014-06-27 13:12:10 +01:00
Mike Jolley 50a4c5bd23 Merge branch 'variation-stock-management'
Conflicts:
	includes/class-wc-product-variation.php
2014-06-27 11:15:42 +01:00
Mike Jolley 6390e387e2 Additional check for product coupons and sale product exclusion. Fixes #5697 2014-06-25 13:46:47 +01:00
Mike Jolley 0f6f04e017 Added wc_stock_amount() core function and replaced intval
#4612
2014-06-25 11:25:28 +01:00
claudiosmweb 770d81091d fixed a error when get the thumbnail by API
Fixed the error:

PHP Notice: Trying to get property of non-object in wp-includes/post-template.php on line 29
2014-06-24 14:56:33 -03:00
Mike Jolley 3ca70b30f5 Add sanity check to stock status change 2014-06-24 13:01:34 +01:00
darkrain 8f530a156c bugfix in get_related() - return trash posts 2014-06-24 13:11:10 +07:00
darkrain ea476af2ca add filter to method get_sku() 2014-06-19 22:28:49 +07:00
Mike Jolley cf3cca4c8e Merge branch 'feature-wc-create-order' 2014-06-18 16:07:29 +01:00
Coen Jacobs e7b6c49c7c Added comment to indicate that WC_Order shouldn't be directly instantiated 2014-06-14 23:36:20 +02:00
Coen Jacobs aa60022297 Restore get_order call in WC_Order constructor 2014-06-13 15:38:24 +02:00
Coen Jacobs 476870d9f2 Created WC_Abstract_Order, extended by WC_Order 2014-06-13 15:37:20 +02:00
Coen Jacobs 89ea6c46ab Replace new WC_Order calls with get_order 2014-06-13 15:24:51 +02:00
Mike Jolley 375a0e2652 static WC_Tax class - no need for a constructor in this 2014-06-12 16:47:43 +01:00
Tsz Ming WONG 35159c50c8 Add filter to allow override the cache widget id 2014-06-07 00:34:12 +08:00
Mike Jolley b2ddcf29cf Set keys for find/replace to prevent duplicate keys
Fixes #5168
2014-05-30 10:42:47 +01:00
justinstern 88e82c5640 Check for Existence of Cart Before Using
check for the existence of the cart during the is_available() check
before getting the order total (which otherwise will result in a PHP
notice from the admin, etc)
2014-05-23 22:12:15 -04:00
Coen Jacobs 6aa9bcadab Added product id parameter to related posts filters 2014-05-21 11:35:54 +02:00
Mike Jolley 63fc4262b6 Merge pull request #5418 from tamarazuk/backorders_allowed
Introduce woocommerce_product_backorders_allowed filter
2014-05-06 15:09:56 +01:00
Tamara Zuk 651f1ac96f Introduce woocommerce_product_backorders_allowed filter 2014-05-04 17:29:43 -04:00
bolderelements fb80f6ba09 Update abstract-wc-shipping-method.php
The order is backward so if you use the default 'is_available' function for your extensions, the 'excluding' option will always deny every country because this line returns an empty array.
2014-05-03 15:59:01 -04:00
Mike Jolley ca9955fa9a Update stock amounts with DB queries Closes #5367
@claudiosmweb and @coenjacobs please review
2014-04-25 15:28:02 +01:00
Mike Jolley 3d8f7963df Update abstract docblock 2014-04-25 12:33:14 +01:00
Mike Jolley 630eeb4945 Merge pull request #5373 from claudiosmweb/5237-feature-max-transaction-amount
Feature maximum transaction amount for payment gateways
2014-04-25 10:20:54 +01:00
Mike Jolley 0e1fcbda64 Abstract product constructor
Check for numeric $product, and expand the checking to see if its
passed a post object. Fixes #5341
2014-04-25 10:19:00 +01:00
claudiosmweb fe467282cd improved the get_order_total() method 2014-04-24 15:49:41 -03:00
claudiosmweb 4ac0b28537 updated the method to get the order id from "pay for order" page 2014-04-24 14:52:17 -03:00
claudiosmweb 47d14e9df3 updated the WC_Payment_Gateway class to set a maximum transaction amount, closes #5237 2014-04-24 14:39:20 -03:00
Mike Jolley 9c37d83f11 Let get_file get the first file if no ID is defined
#5296
2014-04-24 16:00:35 +01:00
Mike Jolley 2a27663f1f get_image_id method + use in email template
Closes #5288
2014-04-08 15:02:11 +01:00
Mike Jolley 34f2170a47 Merge pull request #5198 from claudiosmweb/credit_card_form
Becomes possible to translate the credit card form placeholders
2014-03-24 10:47:10 +00:00
claudiosmweb 7ba14b4bd7 becomes possible to translate the credit card form placeholders 2014-03-23 19:51:27 -03:00
bolderelements 4ce392c7f8 Update abstract-wc-email.php
wp_mail does return a bool just in case something goes wrong with the function so it might be nice to carry it through. While extending this class I thought it might be a good idea to double check everything I can.
2014-03-23 13:09:01 -04:00
Patrick Rauland e4296cc5f7 fixing cool typo. see #5189 2014-03-21 16:37:26 -05:00
Coen Jacobs 3617316357 Updated expiry times for transients 2014-03-12 12:58:41 +01:00
Coen Jacobs 03163c54b0 set_transient calls should have expiration to prevent autoloading 2014-03-07 09:29:01 +01:00
splashingpixels b279487535 get_related fixed tags OR query not excluding product ID 2014-03-04 16:19:12 -08:00
splashingpixels f66be96f88 get related products added DISTINCT to prevent querying duplicates 2014-02-25 15:17:50 -08:00
Justin Hill eed9485e6c Update abstract-wc-product.php
Add filter to is_taxable() method so that plugins can better control what is and isn't taxable based on various conditions, such as customer's billing or shipping address, etc.
2014-02-22 13:15:41 -07:00
Mike Jolley 97dd163c5e Fix ampersands in plan text Closes #4799 2014-02-14 15:37:30 +00:00
Mike Jolley 566a9c4dc6 Set countries as an array by default in the shipping abstract 2014-02-13 11:54:54 +00:00
Mike Jolley 1cafd4f566 Fix to ensure stock status is updated, even when meta is blank. Prevents new products being hidden when the option to hide out of stock products is enabled. 2014-02-12 14:38:56 +00:00
Mike Jolley fbfdc0ea95 Fix saving of checkboxes (off state) in widgets API 2014-02-12 09:29:47 +00:00
claudiosmweb 617b6b07ae fixed some coding standards in includes/abstracts/abstract-wc-product.php 2014-02-07 15:35:45 -02:00
claudiosmweb 6758bab16a fixed the indentation in includes/abstracts/abstract-wc-product.php file 2014-02-07 15:31:25 -02:00
claudiosmweb 35b5614972 fixed docblock for WC_Product::get_children(), closes #4664 2014-02-07 15:31:00 -02:00
Gerhard 435257bc95 Improve credit card form to allow use of the woocommerce_credit_card_form_fields filter 2014-02-06 15:00:00 +02:00
Mike Jolley 39344f2ed5 Allow gateways to change the checkout place order button text on selection. Closes #4573 2014-01-28 11:25:57 +00:00
Mike Jolley 0d52064bd8 Attachments is an array Closes #4531 2014-01-20 15:33:33 +00:00
James Collins 7f497b3fc9 Fix PHP Warning: parse_url() expects parameter 1 to be string, array given in includes/wc-formatting-functions.php on line 41. Fixes #4535. 2014-01-20 09:21:50 +08:00
Mike Jolley 72f51e7b05 Disabled for checkbox Closes #4387 2014-01-08 13:50:59 +00:00
Aristeides Stathopoulos c5c340588e Minor bugfix, missing comma
Missing comma causing errors in some cases
2014-01-07 22:14:35 +02:00
Mike Jolley 9154eed860 Merge pull request #4461 from justinstern/master
Rename new woocommerce_order_item_quantity filter
2014-01-07 07:37:56 -08:00
justinstern 32d850a76a woocommerce_stock_amount rather than intval
Using woocommerce_stock_amount filter rather than intval cast
2014-01-07 02:13:31 -05:00
PURPORC d18bff3f5b Update abstract-wc-email.php
Adds a plain text replacement for the dollar sign encoded as html entity.
2014-01-06 18:39:41 +11:00
Mike Jolley 685403dc30 wordwrap #4397 2014-01-03 14:13:18 +00:00
justinstern e131804d7a Notice fix and Checkout Shipping Method classes
Fixes an admin notice.  Adds a single class to the checkout shipping
method elements for convenience in collecting all of them via CSS
selector
2013-12-29 04:31:44 -05:00
Justin Stern ae91c698f2 Downloadable File Fixes/Tweaks
* Hooked up new downloadable product permissions function to
completed/processing actions
* WC_Product::get_files() is used rather than the underlying
_downloadable_files meta directly
* $this is passed to downloadable product filters in WC_Product in place
of $this->id which doesn't does not afford you the particular variation
when a product variation is being used.
2013-12-16 18:27:57 -05:00
Mike Jolley 3bd2d0d456 Credit card form actions - start and end 2013-12-14 12:03:32 +00:00
Mike Jolley 5239bf7b46 get_form_fields method Closes #4275
@coenjacobs please review. I believe its cleaner this way.
2013-12-05 15:57:01 +00:00
Coen Jacobs bcf025694e Updated docblocks for #4292 2013-12-05 09:36:46 +01:00
Brent Shepherd f7df434399 Remove $from param on get_price_html_from_text()
As it's not used at all.
2013-12-04 17:46:12 -08:00
Mike Jolley 00ff09e3a2 sort sale price 2013-12-04 12:45:23 +00:00
Coen Jacobs a8444eb567 Fixed faulty double return 2013-12-03 15:11:01 +01:00
Coen Jacobs 61a783886d Suggested code changes in #4266 2013-12-03 15:03:25 +01:00
Gregory K f937c36250 Inconsistent return types: TODOs 2013-12-03 14:53:49 +01:00
Coen Jacobs 3e6acf7aab Code changes for #4252 2013-12-02 12:34:27 +01:00
Gregory K 7b38c7300b Inconsistent return types: mostly TODOs, some fixes 2013-11-29 13:50:31 -05:00
Gregory K 43ca01badc PhpDocs and TODO comments 2013-11-28 12:59:09 -05:00
Coen Jacobs 5291f2eec6 Code changes as suggested in #4238 2013-11-28 14:12:08 +01:00
Gregory K cac9d12bf9 PhpDocs 2013-11-28 07:54:19 -05:00
Gregory K dd5a2fb334 PhpDocs 2013-11-27 13:20:31 -05:00
Coen Jacobs 4afbd0b556 Merge branch 'function-call-refactor'
Conflicts:
	includes/admin/post-types/meta-boxes/class-wc-meta-box-order-data.php
	includes/shortcodes/class-wc-shortcode-cart.php
	includes/wc-template-functions.php
2013-11-25 15:42:26 +01:00
Coen Jacobs 47ae00be28 Page functions woocommerce to wc refactor 2013-11-25 15:07:22 +01:00
Mike Jolley 51ba9c393f WC globals 2013-11-25 14:01:38 +00:00
Mike Jolley 3408965b8a Product functions 2013-11-25 14:01:38 +00:00
Mike Jolley 3973beae5d woocommerce_ functions to wc_ - replaced attribute functions 2013-11-25 14:01:37 +00:00
Coen Jacobs c1a439eb99 Formatting functions woocommerce to wc refactor 2013-11-25 14:34:21 +01:00
Coen Jacobs aaa14894ca Core functions woocommerce to wc refactor 2013-11-25 13:45:04 +01:00
Coen Jacobs 8978f75f36 Remove safety net for calling WC_Product directly #4194 2013-11-25 09:25:45 +01:00
Andrew Benbow 0f29761268 Bracing 2013-11-25 09:02:51 +01:00
Andrew Benbow 2d03022b76 Brace all the things 2013-11-24 10:24:12 +00:00
Scott Basgaard 922fa990a5 esc_attr() all the things. 2013-11-20 20:11:59 +01:00
Scott Basgaard faf64a4d96 Product->get_title() should be raw format by default. Pass at #4124 2013-11-18 16:03:32 +01:00
Mike Jolley a957248a4d woocommerce_product_gallery_attachment_ids filter Closes #4113 2013-11-18 12:40:58 +00:00
Coen Jacobs faaebab2ff Always require braces (since yesterday ;) )
In order to comply to the new coding standards:
http://make.wordpress.org/core/2013/11/13/proposed-coding-standards-change-always-require-braces/
2013-11-14 20:31:08 +01:00
Scott Basgaard 9f7f36b232 Merge branch 'master' of github.com:woothemes/woocommerce
Conflicts:
	woocommerce-ajax.php
2013-11-14 19:37:34 +01:00
Mike Jolley d7ee32b18a Consistant naming with core 2013-11-14 09:48:41 +00:00
Scott Basgaard c36369010d When adding new widget instance, use isset() to make sure setting key exists and avoid notices/warnings. 2013-11-13 21:03:46 -05:00
Mike Jolley 02c47b2723 get_related wpdb query Closes #4086 2013-11-13 18:00:01 +00:00
Mike Jolley 2b57114a12 WC() > $woocommerce 2013-11-13 16:59:42 +00:00
Mike Jolley dbdf66aec0 Multiselect 2013-11-13 12:12:26 +00:00
Mike Jolley 3fd02a57d0 Locales - store standardised values, and display using locale in admin #3862 2013-11-12 17:43:30 +00:00
Coen Jacobs b9b9f3a49e Fixed docs for enabled params (string, not bool), closes #4052 2013-11-04 11:29:20 +01:00
RistoNiinemets ff26037372 replace function with new filter 2013-10-29 20:16:12 +02:00
RistoNiinemets fcaaa129f2 use wooocommerce_locate_template
This allows woocommerce_locate_template filter to work on admin also
2013-10-26 13:32:38 +03:00
Mike Jolley 19c3ab7172 calc_tax functions 2013-10-24 16:16:39 +01:00
Mike Jolley 7fb60ccc99 blogname is the actual option, but WP terminolgy in settings is "Site Title".
Closes #3952
2013-10-23 15:57:14 +01:00
Mike Jolley 5eafe2065b ake shipping methods check if taxable, so when customer is VAT excempt taxes are not included in price. Closes #3888 2013-10-16 14:31:31 +01:00
Mike Jolley 44f50cb6cd Code from .17 + readme 2013-10-16 10:28:24 +01:00
Mike Jolley 0f1a8001cf Use subtotal for free shipping, remove unused min_amount from abstract #3924 2013-10-15 17:19:30 +01:00
Andrew Benbow e4d18d6f57 Update abstract-wc-payment-gateway.php
Update icon alt to use title filter
2013-10-11 10:17:23 +01:00
Mike Jolley 66c04b0f72 Check values are set before casting as floats 2013-10-02 12:50:03 +01:00
Mike Jolley 24a3e3e17b Format decimals with single function, convert locale to standard form. #3862 2013-10-01 17:54:32 +01:00
Mike Jolley b892815336 Remove html5 number inputs (unreliable at present, locale issues), add JS validation for price inputs. New price input type in settings API to make future changes easier to implement. Closes #3587
@coenjacobs hows this look?
2013-09-27 20:28:42 +01:00
Mike Jolley 72c00a601a Standardized, default credit card form for gateways to use if they support 'default_credit_card_form'. Closes #3616 2013-09-27 13:22:08 +01:00
Mike Jolley 21f48bea99 Re-init settings after saving. Closes #3770. 2013-09-26 17:01:29 +01:00
Mike Jolley ef49977905 add_to_cart_url add_to_cart_text and single_add_to_cart_text class methods allowing greater control with custom classes.
Closes #3484 and Closes #3143. Pinging @thenbrent as the handler was
originally his idea and I've killed it.

@helgatheviking In 2.1, add to cart URLs will only be used in loops, so
conditonal logic should no longer be neccessary. Single templates post
to themselves without the need for the URL.
2013-09-25 12:35:06 +01:00
Mike Jolley c58d5d5ea4 is_in_stock uses notify_no_stock_amount option. Closes #3446. 2013-09-24 13:31:15 +01:00
Mike Jolley 06ef44c9df Pass args to variation forms from cart page. Closes #3568 2013-09-23 15:47:47 +01:00
Mike Jolley 71cb94ebfa Simpler tax rate check which Closes #3813
Could do with some more testing @ChromeOrange, and applying to .15 if
ok @coen
2013-09-23 12:44:15 +01:00
Mike Jolley 96a7a4b730 Restructure 'file_paths' to allow for names (Closes #3320) etc. For #2765.
@coenjacobs @justinstern @maxrice These are major changes - CC ing you
guys in to take a quick look through. I know some extensions such as
vouchers will be affected.
2013-09-20 17:01:09 +01:00
Mike Jolley b93df4e706 Excl and incl. display options for prices, and suffix to add additonal info and prices. Closes #1506. 2013-09-19 16:31:54 +01:00
Gabriel Reguly a5f2b01219 Fixes blank page error
Fix to avoid blank page error, apparently prevents a memory exausted condition.

Error source: 
http://wordpress.org/support/topic/blank-page-after-return-form-cielo-buypage?replies=15

Some info:
http://stackoverflow.com/questions/8379829/domdocument-php-memory-leak

Another people using the same code: http://nathanstaines.com/articles/wordpress-word-count/

Cheers,
Gabriel
2013-09-14 00:42:03 -03:00
Mike Jolley 519c24a540 Merge pull request #3653 from pixeltrix/add-email-style-inline-filters
Add hooks for overriding default email inline styles
2013-09-13 03:15:55 -07:00
Mike Jolley 355dd16962 Removed @coenjacobs helpers and cleaned up main clas 2013-09-12 14:41:02 +01:00
Mike Jolley b883e92ba1 Fix from .14 2013-09-05 14:52:34 +01:00
Mike Jolley ffa53754ac get_categories returns string Closes #3720 2013-09-04 14:57:12 +01:00
Mike Jolley aef58e8bf3 Merge pull request #3697 from BFTrick/fix-email-html-encoding
Removing HTML Decoding From Email From Name
2013-09-04 06:50:20 -07:00
Mike Jolley 14e27bb073 Fixes from .14 2013-09-04 14:32:16 +01:00
Patrick Rauland 793303d2ad adding esc_html back in to properly escape html from email from name 2013-09-04 07:24:01 -05:00
Patrick Rauland 80fc4ab0a7 allowing quotes in store name 2013-09-03 17:11:03 -05:00
Mike Jolley 807534095e Introduce WC_HTTPS Helper to handle redirects and make checkout urls https before visiting them. Fixes #3311 2013-09-03 13:03:05 +01:00
Patrick Rauland fe4b13d36d removing html decoding from email from name 2013-08-27 12:23:42 -05:00
Mike Jolley 3d078397b3 Merge branch 'Re-organise-settings'
Moves settings together. Fixes #3497
2013-08-22 11:58:03 +01:00
Andrew White e05e970d6a Add hooks for overriding default email inline styles
Currently any h1, h2, h3, a and img tags in a HTML email without a
style attribute will have a default inline style applied to them.
These styles are hard-coded and cannot currently overridden without
patching the source code.

This commit adds two filter hooks that allows the theme developer to
override both the list of tags that have a default style applied to
them and the default styles applied to each tag. The hooks are:

1. woocommerce_email_style_inline_tags
This filter hook returns an array of tags which will have a default
style applied to them - you can both remove and add any tags which
you need for your theme's custom emails.

2. woocommerce_email_style_inline_{name}_tag
This filter is called for every tag name returned by the filter hook
woocommerce_email_style_inline_tags. The styles are passed as an
associative array so you can both add and remove any of the default
styles applied by WooCommerce.

Fixes #3597.
2013-08-20 23:33:26 +01:00
Mike Jolley 9ce810fdcf Needs shipping filter 2013-08-14 10:53:08 +01:00
Mike Jolley d021980c10 Rather than have hooks *everywhere* use a single set stock function in admin and on the frontend Closes #3593 2013-08-13 16:56:09 +01:00
Mike Jolley 57157db9bf Function refactoring. 2013-08-09 17:11:21 +01:00
Mike Jolley 03af136986 Separate ship to options from sell to. Closes #3215. 2013-08-02 16:54:28 +01:00
Illimar Tambek 27ed699ea7 Prefix stock hooks with product_ 2013-08-01 15:09:15 +03:00
Illimar Tambek 40ee077624 Add woocommerce_set_stock, woocommerce_increase_stock and woocommerce_reduce_stock action hooks 2013-08-01 15:06:26 +03:00
Juan Jose Gonzalez Alanis 1339426164 Fixed "Strict Standards" warning on the process_payment() declaration of the WP_Payment_Gateway class. 2013-07-24 13:24:52 +02:00
Mike Jolley 725cb7714b More endpoints for myaccount pages, and endpoint options so they can be modified. Closes #3170. 2013-07-23 17:05:01 +01:00
Mike Jolley 805a9e617c Use get_price and introduce get_regular and get_sale_price methods. Closes #3427 2013-07-23 11:29:04 +01:00
Mike Jolley a5aa58b135 Allow iframe html to be input for sharethis. Closes #3254. 2013-07-19 07:54:51 +01:00
Mike Jolley a9569ccd6f Only allow those who can edit the post to add drafts to cart. For testing. Closes #3381 2013-06-28 11:14:21 +01:00
Mike Jolley 9d37e5bf92 Stripslashes 2013-06-22 11:43:57 +01:00
Mike Jolley 2db3d24a82 Enforce session as array data, and settings api tweak for special chars. Closes #3135. 2013-06-14 14:42:28 +01:00
Mike Jolley f87505b445 Rounding tweaks 2013-06-13 17:01:47 +01:00
Mike Jolley 60bc15e61f Session class improvements - get and set + defaults 2013-06-11 15:59:23 +01:00
Mike Jolley c75ea04c1c classes -> includes 2013-06-11 14:25:30 +01:00